From 9da799190ee21df5b48c425ac3df0d52613f0c95 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Thu, 20 Feb 2014 01:07:08 +0100 Subject: firmware: fixed LED --- firmware/bootloaderconfig.h | 7 ++++--- firmware/main.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 9005b12..0ae3d2b 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -278,16 +278,17 @@ these macros are defined, the boot loader uses them. * Use to define pattern. */ -#define LED_PRESENT 0 +#define LED_PRESENT 1 #define LED_DDR DDRB #define LED_PORT PORTB #define LED_PIN PB1 #if LED_PRESENT - #define LED_INIT(x) LED_PORT &=~_BV(LED_PIN); +// #define LED_INIT(x) LED_PORT &=~_BV(LED_PIN); // Use this with low active LED + #define LED_INIT(x) LED_PORT = _BV(LED_PIN); // Use this with high active LED #define LED_EXIT(x) LED_DDR &=~_BV(LED_PIN); - #define LED_MACRO(x) if ( x & 0xd ) {LED_DDR&=~_BV(LED_PIN);} else {LED_DDR|=_BV(LED_PIN);} + #define LED_MACRO(x) if ( x & 0xd0 ) {LED_DDR&=~_BV(LED_PIN);} else {LED_DDR|=_BV(LED_PIN);} #else #define LED_INIT(x) #define LED_EXIT(x) diff --git a/firmware/main.c b/firmware/main.c index 5342498..b0aaa6b 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -314,7 +314,7 @@ int main(void) { if (pgm_read_byte(BOOTLOADER_ADDRESS - TINYVECTOR_RESET_OFFSET + 1)!=0xff) break; } - LED_MACRO( idlePolls.b[1] ); + LED_MACRO( idlePolls.b[0] ); // Test whether another interrupt occurred during the processing of USBpoll and commands. // If yes, we missed a data packet on the bus. This is not a big issue, since -- cgit v1.2.3