![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
working version with calibration done
Fork of Eurobot2013 by
Diff: system/system.cpp
- Revision:
- 11:5ba926692210
diff -r 2bd9f4e02b74 -r 5ba926692210 system/system.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/system/system.cpp Tue Apr 09 15:32:47 2013 +0000 @@ -0,0 +1,29 @@ +#include "system.h" + +//Defining the externs +DigitalOut OLED1(LED1); +DigitalOut OLED2(LED2); +DigitalOut OLED3(LED3); +DigitalOut OLED4(LED4); + +//nop style wait function +void nopwait(int ms){ +while(ms--) + for (volatile int i = 0; i < 24000; i++); +} + +float cpupercent; //defining the extern +void measureCPUidle (void const* arg) { + + Timer timer; + cpupercent = 0; //defined in system.h + + while(1) { + timer.reset(); + timer.start(); + wait(1); + + int thistime = timer.read_us()-1000000; + cpupercent = thistime; + } +} \ No newline at end of file