66 lines
1.6 KiB
C
66 lines
1.6 KiB
C
/*********************************************************************
|
|
* SEGGER Microcontroller GmbH *
|
|
* The Embedded Experts *
|
|
**********************************************************************
|
|
|
|
-------------------------- END-OF-HEADER -----------------------------
|
|
|
|
File : main.c
|
|
Purpose : Generic application start
|
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
#include "sl_system_init.h"
|
|
|
|
static void exampleTask( void * parameters )
|
|
{
|
|
/* Unused parameters. */
|
|
( void ) parameters;
|
|
uint8_t i = 0;
|
|
for( ; ; )
|
|
{
|
|
printf( "hello world %d\n",i++ );
|
|
/* Example Task Code */
|
|
vTaskDelay( 100 ); /* delay 100 ticks */
|
|
}
|
|
}
|
|
|
|
/*********************************************************************
|
|
*
|
|
* main()
|
|
*
|
|
* Function description
|
|
* Application entry point.
|
|
*/
|
|
|
|
int main(void) {
|
|
static StaticTask_t exampleTaskTCB;
|
|
static StackType_t exampleTaskStack[ configMINIMAL_STACK_SIZE ];
|
|
|
|
printf( "Example FreeRTOS Project\n" );
|
|
|
|
sl_system_init();
|
|
|
|
/* create tasks */
|
|
xTaskCreateStatic( exampleTask,
|
|
"example",
|
|
configMINIMAL_STACK_SIZE,
|
|
NULL,
|
|
configMAX_PRIORITIES - 1U,
|
|
&( exampleTaskStack[ 0 ] ),
|
|
&( exampleTaskTCB ) );
|
|
|
|
/* Start the scheduler. */
|
|
vTaskStartScheduler();
|
|
|
|
for( ; ; )
|
|
{
|
|
/* Should not reach here. */
|
|
}
|
|
}
|
|
|
|
/*************************** End of file ****************************/
|