Shuto Naruse / system
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers system.cpp Source File

system.cpp

00001 #include "system.h"
00002 
00003 //Defining the externs
00004 DigitalOut     OLED1(LED1);
00005 DigitalOut     OLED2(LED2);
00006 DigitalOut     OLED3(LED3);
00007 DigitalOut     OLED4(LED4);
00008 
00009 float cpupercent; //defining the extern
00010 void measureCPUidle (void const* arg) {
00011     
00012     Timer timer;
00013     cpupercent = 0; //defined in system.h
00014     
00015     while(1) {
00016         timer.reset();
00017         timer.start();
00018         wait(1);
00019         
00020         int thistime = timer.read_us()-1000000;
00021         cpupercent = thistime;
00022     }
00023 }