mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Commented out idle loop in timer (was giving problems under Linux) and added comments.
This commit is contained in:
@ -228,13 +228,17 @@ void timerPause(unsigned short pause_ms)
|
|||||||
|
|
||||||
// loop until time expires
|
// loop until time expires
|
||||||
while( ((TimerPauseReg<<8) | inb(TCNT0)) < (pause+timerThres) )
|
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
|
// save power by idling the processor
|
||||||
set_sleep_mode(SLEEP_MODE_IDLE);
|
//set_sleep_mode(SLEEP_MODE_IDLE);
|
||||||
sleep_mode();
|
//sleep_mode();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* old inaccurate code, for reference
|
/* old inaccurate code, for reference
|
||||||
|
@ -257,7 +257,9 @@ void printBinary(unsigned int n)
|
|||||||
printIntegerInBase(n, 2);
|
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, ...)
|
void print(const char *format, ...)
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
Reference in New Issue
Block a user