Joscha Ihl
/
Nucleo_rtos_basic3
test
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 #include <iostream> 00004 00005 using namespace std; 00006 00007 DigitalOut led1(LED1); 00008 00009 void print_thread(void const *argument) 00010 { 00011 while (true) { 00012 Thread::wait(1000); 00013 cout << "print_thread!\r" << endl; 00014 } 00015 } 00016 00017 int main() 00018 { 00019 cout << "BASIC EXAMPLE\r\n"; 00020 Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); 00021 while (true) { 00022 led1 = !led1; 00023 Thread::wait(500); 00024 cout << "LED Thread\r" << endl; 00025 } 00026 }
Generated on Thu Jul 14 2022 08:36:07 by 1.7.2