/*---------------------------------------------------------------------------- * CMSIS-RTOS 'main' function template *---------------------------------------------------------------------------*/ #include "Driver_USART.h" #include #include #include "stdio.h" #include "cmsis_os.h" // ARM::CMSIS:RTOS:Keil RTX #include "Board_LED.h" // ::Board Support:LED #include "Board_Buttons.h" // ::Board Support:Buttons #include "Board_UART.h" #define osObjectsPublic // define objects in main module #include "osObjects.h" // RTOS object definitions #include "MKW40Z4.h" volatile int32_t delay_val = 5000; void myUART_Thread(void const *argument); osThreadId tid_myUART_Thread; /* CMSIS-RTOS Thread - UART command thread */ void myUART_Thread(const void* args) { UART0_Init(); UART0_Startup(); UART0_Tx((const uint8_t*)"HEllo",6U); UART0_Flush(); } osThreadDef(myUART_Thread, osPriorityNormal, 1, 0); /* * main: initialize and start the system */ int main (void) { static char Buffer[20]; osKernelInitialize (); // initialize CMSIS-RTOS // initialize peripherals here tid_myUART_Thread = osThreadCreate (osThread(myUART_Thread), NULL); // create 'thread' functions that start executing, // example: tid_name = osThreadCreate (osThread(name), NULL); osKernelStart (); // start thread execution for(;;) { osDelay(delay_val); } }