Andriy Makukha
/
football_project_wo_output
football_project_wo_output
Fork of football_project by
Diff: main.cpp
- Revision:
- 37:8f15b14d6994
- Parent:
- 35:c1405da88d3a
- Child:
- 44:4ad6133987ed
- Child:
- 45:1eb335c00cb2
--- a/main.cpp Wed Jan 06 20:38:09 2016 +0000 +++ b/main.cpp Wed Jan 06 22:19:10 2016 +0000 @@ -258,7 +258,7 @@ if( wasCharging ) { pct = 102; // Show 102% at charger unplug. - tickTock = 50; // Cause another normal update in 10 half-seconds. + tickTock = 25; // Cause another normal update in 5 seconds. } else { @@ -568,6 +568,10 @@ void periodicCallback( void ) { + static int callCnt; + if( (callCnt++ % 5) != 0 ) return; + callCnt = 1; + #if BLENANO led0 = !led0; #endif @@ -575,11 +579,8 @@ led2 = !led2; // rts = !rts; -// if( 0 == (tickTock % 60) ){ led0 = 0; buzz = 0; } -// if( 2 == (tickTock % 60) ){ led0 = 1; buzz = 1; } - // Check battery level every 30s. - if( 0 == (tickTock % 60) ) updateBatt( getBattLevel() ); + if( 0 == (tickTock % 30) ) updateBatt( getBattLevel() ); tickTock++; } @@ -600,7 +601,7 @@ int main( void ) { Ticker ticker; - ticker.attach( periodicCallback, 0.2 /*** 0.1 ***/ /* 1 */ ); + ticker.attach( periodicCallback, 0.2 /** 0.5 **/ /* 1 */ ); /* // Thread thread( led_thread );