led example with 2 timers

Dependencies:   mbed mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers writer.cpp Source File

writer.cpp

00001 #include "main.h"
00002 
00003 extern Serial pc;
00004 extern Queue<string, 16> WriterQueue;
00005 
00006 void Writer_init()
00007 {
00008     
00009 }
00010 
00011 void Writer_thread(void const *args)
00012 {
00013     string *queueItem;
00014     osEvent evt;
00015     Writer_init();
00016      
00017     while(1)
00018     {
00019         evt = WriterQueue.get();
00020         pc.printf("get from queue \n\r");
00021         if (evt.status == osEventMessage) 
00022         {
00023             queueItem = (string*)evt.value.p;
00024             pc.printf("%s \n\r", queueItem->c_str());
00025         }
00026        
00027     } 
00028 }