From 38ee1b7330f25b0a74737efb524cb708d5d0bddf Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 23 Nov 2005 00:28:35 +0000 Subject: [PATCH] Commented out idle loop in timer (was giving problems under Linux) and added comments. --- targets/arduino/timer.c | 16 ++++++++++------ targets/arduino/wiring.c | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/targets/arduino/timer.c b/targets/arduino/timer.c index 3258f338c..edc9b7181 100755 --- a/targets/arduino/timer.c +++ b/targets/arduino/timer.c @@ -228,13 +228,17 @@ void timerPause(unsigned short pause_ms) // loop until time expires while( ((TimerPauseReg<<8) | inb(TCNT0)) < (pause+timerThres) ) - { - if( TimerPauseReg < (pause>>8)); - { + { + // DAM: these lines (in particular, the call to set_sleep_mode) + // caused avr-gcc to give an error about a misplaced } in linux, + // presumambly caused by a macro somewhere. Since they're not + // vital (and are causing problems), I'm commenting them out. + //if( TimerPauseReg < (pause>>8)); + //{ // save power by idling the processor - set_sleep_mode(SLEEP_MODE_IDLE); - sleep_mode(); - } + //set_sleep_mode(SLEEP_MODE_IDLE); + //sleep_mode(); + //} } /* old inaccurate code, for reference diff --git a/targets/arduino/wiring.c b/targets/arduino/wiring.c index d5d18a63f..7260cc9d6 100755 --- a/targets/arduino/wiring.c +++ b/targets/arduino/wiring.c @@ -257,7 +257,9 @@ void printBinary(unsigned int n) printIntegerInBase(n, 2); } -/* Including print() adds approximately 1500 bytes to the binary size. +/* Including print() adds approximately 1500 bytes to the binary size, + * so we replace it with the smaller and less-confusing printString(), + * printInteger(), etc. void print(const char *format, ...) { char buf[256];