Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd mbed-rtos mbed
Fork of rtos_queue by
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 #include "C12832_lcd.h" 00004 00005 C12832_LCD lcd; 00006 00007 /* send int by queue */ 00008 00009 Queue<int, 16> queue; 00010 00011 /* Send Thread */ 00012 void send_thread (void const *args) { 00013 int message_s = 0 ; 00014 while (true) { 00015 message_s++; 00016 queue.put(&message_s); 00017 Thread::wait(1000); 00018 } 00019 } 00020 00021 int main (void) { 00022 int *message_r; 00023 00024 Thread thread(send_thread); 00025 00026 while (true) { 00027 osEvent evt = queue.get(); 00028 if (evt.status == osEventMessage) { 00029 message_r = (int*)evt.value.p; 00030 lcd.printf("%d ", *message_r); 00031 } 00032 } 00033 }
Generated on Sat Jul 16 2022 09:51:14 by
1.7.2
