In our bootloader, abuse one of the TX/RX LEDs (D5) as the

boot status LED
pull/18/head
Jesse Vincent 10 years ago
parent fefc124d9b
commit baf4bb23b6

@ -66,17 +66,17 @@
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
#define LED_SETUP() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5); #define LED_SETUP() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5);
#define L_LED_OFF() PORTC &= ~(1<<7) #define TX_LED_OFF() PORTC &= ~(1<<7)
#define L_LED_ON() PORTC |= (1<<7) #define TX_LED_ON() PORTC |= (1<<7)
#define L_LED_TOGGLE() PORTC ^= (1<<7) #define L_LED_TOGGLE() PORTD ^= (1<<5)
#if DEVICE_PID == 0x0037 // polarity of the RX and TX LEDs is reversed on the Micro #if DEVICE_PID == 0x0037 // polarity of the RX and TX LEDs is reversed on the Micro
#define TX_LED_OFF() PORTD &= ~(1<<5) #define TX_LED_OFF() PORTD &= ~(1<<5)
#define TX_LED_ON() PORTD |= (1<<5) #define TX_LED_ON() PORTD |= (1<<5)
#define RX_LED_OFF() PORTB &= ~(1<<0) #define RX_LED_OFF() PORTB &= ~(1<<0)
#define RX_LED_ON() PORTB |= (1<<0) #define RX_LED_ON() PORTB |= (1<<0)
#else #else
#define TX_LED_OFF() PORTD |= (1<<5) #define L_LED_OFF() PORTD |= (1<<5)
#define TX_LED_ON() PORTD &= ~(1<<5) #define L_LED_ON() PORTD &= ~(1<<5)
#define RX_LED_OFF() PORTB |= (1<<0) #define RX_LED_OFF() PORTB |= (1<<0)
#define RX_LED_ON() PORTB &= ~(1<<0) #define RX_LED_ON() PORTB &= ~(1<<0)
#endif #endif

Loading…
Cancel
Save