mirror of
https://github.com/eggman/ameba-gcc-sample-rtos.git
synced 2024-11-23 04:14:14 +00:00
add main.c
This commit is contained in:
parent
c2015827cb
commit
c9188e1122
1 changed files with 27 additions and 0 deletions
27
src/main.c
Normal file
27
src/main.c
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "cmsis_os.h"
|
||||
|
||||
osThreadId main_tid = 0;
|
||||
|
||||
void main_task(void const *arg)
|
||||
{
|
||||
int i=0;
|
||||
|
||||
while (1) {
|
||||
DiagPrintf("Hello World : %d\r\n", i++);
|
||||
HalDelayUs(1000000);
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
osKernelInitialize();
|
||||
|
||||
DiagPrintf("Starting main task\n");
|
||||
|
||||
osThreadDef(main_task, osPriorityHigh, 1, 8152);
|
||||
main_tid = osThreadCreate (osThread (main_task), NULL);
|
||||
|
||||
osKernelStart();
|
||||
while(1);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue