Commented out idle loop in timer (was giving problems under Linux) and added comments.

This commit is contained in:
David A. Mellis 2005-11-23 00:28:35 +00:00
parent 6b17c6ec36
commit 38ee1b7330
2 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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];