Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 #if !DEVICE_SEMIHOST
00004   #error [NOT_SUPPORTED] Semihost not supported
00005 #endif
00006 
00007 Serial pc(USBTX, USBRX);
00008 
00009 extern "C" void mbed_reset();
00010 
00011 int main() {
00012     pc.printf("start\n");
00013     wait(1);
00014 
00015     unsigned int counter = 0;
00016     while(1) {
00017         pc.printf("%u\n",counter++);
00018         wait(1);
00019         mbed_reset();
00020     }
00021 }