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;
 | 
					  uint16_t mask = 0x8000;
 | 
				
			||||||
  int8_t bit;
 | 
					  int8_t bit;
 | 
				
			||||||
  //PORTC &= ~(1<<PC2);
 | 
					 | 
				
			||||||
  SET_LE_L();
 | 
					  SET_LE_L();
 | 
				
			||||||
  for (bit=15; bit>=le_clocks; bit--) {
 | 
					  for (bit=15; bit>=le_clocks; bit--) {
 | 
				
			||||||
	//PORTC &= ~(1<<PC3);
 | 
					 | 
				
			||||||
	SET_CLK_L(); 
 | 
						SET_CLK_L(); 
 | 
				
			||||||
    if(data&mask) { SET_SDI_H(); }
 | 
					    if(data&mask) { SET_SDI_H(); }
 | 
				
			||||||
    else { SET_SDI_L(); }
 | 
					    else { SET_SDI_L(); }
 | 
				
			||||||
    //PORTC |= (1<<PC3);    
 | 
					 | 
				
			||||||
	SET_CLK_H();
 | 
						SET_CLK_H();
 | 
				
			||||||
    mask >>= 1;
 | 
					    mask >>= 1;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  //PORTC |= (1<<PC2);
 | 
					 | 
				
			||||||
  SET_LE_H();
 | 
					  SET_LE_H();
 | 
				
			||||||
  for (/*noting to initialize*/; bit>=0; bit--) {
 | 
					  for (/*noting to initialize*/; bit>=0; bit--) {
 | 
				
			||||||
	//PORTC &= ~(1<<PC3);
 | 
					 | 
				
			||||||
	SET_CLK_L();
 | 
						SET_CLK_L();
 | 
				
			||||||
    if(data&mask) { SET_SDI_H(); }
 | 
					    if(data&mask) { SET_SDI_H(); }
 | 
				
			||||||
    else { SET_SDI_L(); }
 | 
					    else { SET_SDI_L(); }
 | 
				
			||||||
    //PORTC |= (1<<PC3);    
 | 
					 | 
				
			||||||
	SET_CLK_H();
 | 
						SET_CLK_H();
 | 
				
			||||||
    mask >>= 1;
 | 
					    mask >>= 1;
 | 
				
			||||||
 }
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //PORTC &= ~(1<<PC3);
 | 
					 | 
				
			||||||
  SET_CLK_L();
 | 
					  SET_CLK_L();
 | 
				
			||||||
  //PORTC &= ~(1<<PC2);
 | 
					 | 
				
			||||||
  SET_LE_L();
 | 
					  SET_LE_L();
 | 
				
			||||||
  //PORTC &= ~(1<<PC4);
 | 
					 | 
				
			||||||
  SET_SDI_L();
 | 
					  SET_SDI_L();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -122,17 +113,11 @@ void led1642gw_turn_all_off(void)
 | 
				
			|||||||
void led1642gw_init(void)
 | 
					void led1642gw_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //PORTC &= ~(1<<PC3); // SCK
 | 
					 | 
				
			||||||
  SET_CLK_L();
 | 
					  SET_CLK_L();
 | 
				
			||||||
  //PORTC &= ~(1<<PC4); // DATA
 | 
					 | 
				
			||||||
  SET_SDI_L();
 | 
					  SET_SDI_L();
 | 
				
			||||||
  //PORTC &= ~(1<<PC2); // LE
 | 
					 | 
				
			||||||
  SET_LE_L();
 | 
					  SET_LE_L();
 | 
				
			||||||
  //DDRC |= (1<<PC3); // SCK
 | 
					 | 
				
			||||||
  DDR_CLK |= (1<<PIN_CLK);
 | 
					  DDR_CLK |= (1<<PIN_CLK);
 | 
				
			||||||
  //DDRC |= (1<<PC4); // DATA
 | 
					 | 
				
			||||||
  DDR_SDI |= (1<<PIN_SDI);
 | 
					  DDR_SDI |= (1<<PIN_SDI);
 | 
				
			||||||
  //DDRC |= (1<<PC2); // LE
 | 
					 | 
				
			||||||
  DDR_LE |= (1<<PIN_LE);
 | 
					  DDR_LE |= (1<<PIN_LE);
 | 
				
			||||||
  memset(ledbuffer, 0x00, sizeof(ledbuffer));
 | 
					  memset(ledbuffer, 0x00, sizeof(ledbuffer));
 | 
				
			||||||
  led1642gw_flush();
 | 
					  led1642gw_flush();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,5 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "rgbyteclock.h"
 | 
					#include "rgbyteclock.h"
 | 
				
			||||||
#include "timer.h"
 | 
					 | 
				
			||||||
#include "rtc.h"
 | 
					 | 
				
			||||||
#include "lcd.h"
 | 
					 | 
				
			||||||
#include "ledcontroller.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void rgbyteclock(void)
 | 
					void rgbyteclock(void)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,7 @@
 | 
				
			|||||||
#define RGBYTECLOCK_H
 | 
					#define RGBYTECLOCK_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <avr/io.h>
 | 
					#include <avr/io.h>
 | 
				
			||||||
 | 
					#include "ledcontroller.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void rgbyteclock(void);
 | 
					void rgbyteclock(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user