mbed with working rtos for DISCO F746NG
Dependencies: BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG mbed-rtos mbed
main.cpp
00001 #include "mbed.h" 00002 #include "TS_DISCO_F746NG.h" 00003 #include "LCD_DISCO_F746NG.h" 00004 #include "rtos.h" 00005 00006 #define STACK_SIZE DEFAULT_STACK_SIZE 00007 00008 DigitalOut led1(LED1); 00009 00010 LCD_DISCO_F746NG lcd; 00011 TS_DISCO_F746NG ts; 00012 00013 00014 void thread_1(void const *argument) { 00015 while (true) { 00016 led1 = !led1; 00017 Thread::wait(500); 00018 } 00019 } 00020 00021 void thread_2(void const *argument) { 00022 while (true) { 00023 printf("this is a sample string\n"); 00024 Thread::wait(1000); 00025 } 00026 } 00027 00028 00029 int main() 00030 { 00031 Thread t1(thread_1, NULL, osPriorityNormal, STACK_SIZE); 00032 Thread t2(thread_2, NULL, osPriorityNormal, STACK_SIZE); 00033 00034 while(1) { 00035 00036 } 00037 }
Generated on Fri Jul 15 2022 12:28:55 by 1.7.2