summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2014-02-20 01:07:08 +0100
committercpldcpu <cpldcpu@gmail.com>2014-02-20 01:07:08 +0100
commit9da799190ee21df5b48c425ac3df0d52613f0c95 (patch)
tree1ccea93eb6cffdf56b2dce0715dcc7115edf9d3c
parentc3a88f32b94a6ad0447ef091f1739baa029193f7 (diff)
downloadmicronucleus-9da799190ee21df5b48c425ac3df0d52613f0c95.tar.gz
micronucleus-9da799190ee21df5b48c425ac3df0d52613f0c95.tar.bz2
micronucleus-9da799190ee21df5b48c425ac3df0d52613f0c95.zip
firmware: fixed LED
-rw-r--r--firmware/bootloaderconfig.h7
-rw-r--r--firmware/main.c2
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