Eurobot_2012_Secondary

Dependencies:   mbed tvmet

system.cpp

Committer:
narshu
Date:
2012-04-20
Revision:
0:fbfafa6bf5f9

File content as of revision 0:fbfafa6bf5f9:

#include "system.h"

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); // looks like wait uses a RTC
        
        int thistime = timer.read_us()-1000000;
        cpupercent = thistime;
    }
}