enabled RTOS

main
Jonas Arnold 4 years ago
parent e60539beb8
commit 2d304cdf0c
  1. 2
      ADIS_tinyK22_SplitFlap/source/IncludeMcuLibConfig.h
  2. 28
      ADIS_tinyK22_SplitFlap/source/application.c
  3. 4
      ADIS_tinyK22_SplitFlap/source/platform.c

@ -96,7 +96,7 @@ add_compile_options(-include "../config/IncludeMcuLibConfig.h")
#endif #endif
#define McuULN2003_CONFIG_USE_ACCELERATION (1) #define McuULN2003_CONFIG_USE_ACCELERATION (1)
/* ------------------- RTOS ---------------------------*/ /* ------------------- RTOS ---------------------------*/
#define McuLib_CONFIG_SDK_USE_FREERTOS (0) #define McuLib_CONFIG_SDK_USE_FREERTOS (1)
/* #define configUSE_SEGGER_SYSTEM_VIEWER_HOOKS (1) */ /* #define configUSE_SEGGER_SYSTEM_VIEWER_HOOKS (1) */
/* #define configTOTAL_HEAP_SIZE (24*1024) */ /* #define configTOTAL_HEAP_SIZE (24*1024) */
/* #define configUSE_HEAP_SECTION_NAME (1) */ /* #define configUSE_HEAP_SECTION_NAME (1) */

@ -25,6 +25,8 @@
/* vars */ /* vars */
static McuLED_Handle_t LED_blue; static McuLED_Handle_t LED_blue;
static SF_Handle_t splitflap0, splitflap1; static SF_Handle_t splitflap0, splitflap1;
static uint32_t taskParameter1 = 5;
static TaskHandle_t appTaskHandle = NULL;
/* function declaration */ /* function declaration */
void configureSplitflaps(void); void configureSplitflaps(void);
@ -47,9 +49,9 @@ void App_Init(void){
MultiSplitFlap_AddFlap(splitflap1); MultiSplitFlap_AddFlap(splitflap1);
} }
/* Application run */ /* App Task */
void App_Run(void){ static void App_Task(void* pv){
PRINTF("Initializing split flap motors.\n"); PRINTF("Initializing split flap motors.\n");
bool successfulInit0 = SF_MoveMotorToZeroPosition(splitflap0, 12); bool successfulInit0 = SF_MoveMotorToZeroPosition(splitflap0, 12);
PRINTF("Init of motor 0 done. Success = %s\n\n", successfulInit0 ? "true" : "false"); PRINTF("Init of motor 0 done. Success = %s\n\n", successfulInit0 ? "true" : "false");
@ -95,6 +97,26 @@ void App_Run(void){
} }
} }
/* Application run */
void App_Run(void){
BaseType_t res;
res = xTaskCreate( App_Task,
"appTask",
900/sizeof(StackType_t),
&taskParameter1,
tskIDLE_PRIORITY,
&appTaskHandle);
if(res != pdPASS) // task creation not successful?
{ // TODO error handling
PRINTF("Task creation of app task failed");
for(;;) {} // Endless loop
}
vTaskStartScheduler();
}
/* Application de-initialization */ /* Application de-initialization */
void App_Deinit(void){ void App_Deinit(void){

@ -27,12 +27,12 @@ void PL_Init(void){
McuLED_Init(); McuLED_Init();
McuULN2003_Init(); McuULN2003_Init();
SF_InitConfig(); SF_InitConfig();
//McuRTOS_Init(); McuRTOS_Init();
} }
void PL_Deinit(void){ void PL_Deinit(void){
//McuRTOS_Deinit(); McuRTOS_Deinit();
SF_DeInitConfig(); SF_DeInitConfig();
McuULN2003_Deinit(); McuULN2003_Deinit();
McuLED_Deinit(); McuLED_Deinit();

Loading…
Cancel
Save