remove old port definitions and fix missing include
This commit is contained in:
		
							
								
								
									
										15
									
								
								led1642gw.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								led1642gw.c
									
									
									
									
									
								
							@@ -45,35 +45,26 @@ static void write_data(uint16_t data, uint8_t le_clocks)
 | 
			
		||||
{
 | 
			
		||||
  uint16_t mask = 0x8000;
 | 
			
		||||
  int8_t bit;
 | 
			
		||||
  //PORTC &= ~(1<<PC2);
 | 
			
		||||
  SET_LE_L();
 | 
			
		||||
  for (bit=15; bit>=le_clocks; bit--) {
 | 
			
		||||
	//PORTC &= ~(1<<PC3);
 | 
			
		||||
	SET_CLK_L(); 
 | 
			
		||||
    if(data&mask) { SET_SDI_H(); }
 | 
			
		||||
    else { SET_SDI_L(); }
 | 
			
		||||
    //PORTC |= (1<<PC3);    
 | 
			
		||||
	SET_CLK_H();
 | 
			
		||||
    mask >>= 1;
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  //PORTC |= (1<<PC2);
 | 
			
		||||
  SET_LE_H();
 | 
			
		||||
  for (/*noting to initialize*/; bit>=0; bit--) {
 | 
			
		||||
	//PORTC &= ~(1<<PC3);
 | 
			
		||||
	SET_CLK_L();
 | 
			
		||||
    if(data&mask) { SET_SDI_H(); }
 | 
			
		||||
    else { SET_SDI_L(); }
 | 
			
		||||
    //PORTC |= (1<<PC3);    
 | 
			
		||||
	SET_CLK_H();
 | 
			
		||||
    mask >>= 1;
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
  //PORTC &= ~(1<<PC3);
 | 
			
		||||
  SET_CLK_L();
 | 
			
		||||
  //PORTC &= ~(1<<PC2);
 | 
			
		||||
  SET_LE_L();
 | 
			
		||||
  //PORTC &= ~(1<<PC4);
 | 
			
		||||
  SET_SDI_L();
 | 
			
		||||
  
 | 
			
		||||
}
 | 
			
		||||
@@ -122,17 +113,11 @@ void led1642gw_turn_all_off(void)
 | 
			
		||||
void led1642gw_init(void)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  //PORTC &= ~(1<<PC3); // SCK
 | 
			
		||||
  SET_CLK_L();
 | 
			
		||||
  //PORTC &= ~(1<<PC4); // DATA
 | 
			
		||||
  SET_SDI_L();
 | 
			
		||||
  //PORTC &= ~(1<<PC2); // LE
 | 
			
		||||
  SET_LE_L();
 | 
			
		||||
  //DDRC |= (1<<PC3); // SCK
 | 
			
		||||
  DDR_CLK |= (1<<PIN_CLK);
 | 
			
		||||
  //DDRC |= (1<<PC4); // DATA
 | 
			
		||||
  DDR_SDI |= (1<<PIN_SDI);
 | 
			
		||||
  //DDRC |= (1<<PC2); // LE
 | 
			
		||||
  DDR_LE |= (1<<PIN_LE);
 | 
			
		||||
  memset(ledbuffer, 0x00, sizeof(ledbuffer));
 | 
			
		||||
  led1642gw_flush();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,10 @@
 | 
			
		||||
 | 
			
		||||
#include "rgbyteclock.h"
 | 
			
		||||
#include "timer.h"
 | 
			
		||||
#include "rtc.h"
 | 
			
		||||
#include "lcd.h"
 | 
			
		||||
#include "ledcontroller.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void rgbyteclock(void)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	while (1) {
 | 
			
		||||
		
 | 
			
		||||
		led_set(0, 4000, 0, 0);
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
#define RGBYTECLOCK_H
 | 
			
		||||
 | 
			
		||||
#include <avr/io.h>
 | 
			
		||||
 | 
			
		||||
#include "ledcontroller.h"
 | 
			
		||||
 | 
			
		||||
void rgbyteclock(void);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user