void SHELL_Init(void) { SHELL_val = 0; SQUEUE_Init(); #if !CLS1_DEFAULT_SERIAL && PL_CONFIG_CONFIG_HAS_BLUETOOTH (void)CLS1_SetStdio(&BT_stdio); /* use the Bluetooth stdio as default */ #endif #if PL_CONFIG_HAS_RTOS if (FRTOS1_xTaskCreate(ShellTask, "Shell", configMINIMAL_STACK_SIZE+100, NULL, tskIDLE_PRIORITY+1, NULL) != pdPASS) { for(;;){} /* error */ } #endif }
void APP_Init(void) { //DbgConsole_Printf("hello world.\r\n"); #if PL_CONFIG_HAS_SHELL_QUEUE SQUEUE_Init(); #endif semSW2 = xSemaphoreCreateBinary(); if (semSW2==NULL) { /* semaphore creation failed */ for(;;){} /* error */ } vQueueAddToRegistry(semSW2, "Sem_SW2"); semSW3 = xSemaphoreCreateBinary(); if (semSW3==NULL) { /* semaphore creation failed */ for(;;){} /* error */ } vQueueAddToRegistry(semSW3, "Sem_SW3"); semLED = xSemaphoreCreateBinary(); if (semLED==NULL) { /* semaphore creation failed */ for(;;){} /* error */ } vQueueAddToRegistry(semLED, "Sem_LED"); semMouse = xSemaphoreCreateBinary(); if (semMouse==NULL) { /* semaphore creation failed */ for(;;){} /* error */ } vQueueAddToRegistry(semMouse, "Sem_Mouse"); semKbd = xSemaphoreCreateBinary(); if (semKbd==NULL) { /* semaphore creation failed */ for(;;){} /* error */ } vQueueAddToRegistry(semKbd, "Sem_Kbd"); #if 0 /*! \todo 1 Increase stack size by 50 */ if (xTaskCreate(ButtonTask, "Buttons", configMINIMAL_STACK_SIZE+50, NULL, tskIDLE_PRIORITY+2, NULL) != pdPASS) { /*! \todo 1 Increase stack size by 50 */ #else if (xTaskCreate(ButtonTask, "Buttons", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+2, NULL) != pdPASS) { #endif for(;;){} /* error */ } if (xTaskCreate(AppTask, "App", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, NULL) != pdPASS) { for(;;){} /* error */ } #if configUSE_TRACE_HOOKS vTraceSetISRProperties("ISR_USB", TRACE_PRIO_ISR_USB); #endif }
void PL_Init(void) { #if PL_CONFIG_HAS_LED LED_Init(); #endif #if PL_CONFIG_HAS_EVENTS EVNT_Init(); #endif #if PL_CONFIG_HAS_TIMER TMR_Init(); #endif #if PL_CONFIG_HAS_TRIGGER TRG_Init(); #endif #if PL_CONFIG_HAS_BUZZER BUZ_Init(); #endif #if PL_CONFIG_HAS_RTOS RTOS_Init(); #endif #if PL_CONFIG_HAS_SHELL SHELL_Init(); #endif #if PL_CONFIG_HAS_SHELL_QUEUE SQUEUE_Init(); #endif #if PL_CONFIG_HAS_MOTOR MOT_Init(); #endif #if PL_CONFIG_HAS_LINE_SENSOR REF_Init(); #endif #if PL_CONFIG_HAS_MOTOR_TACHO TACHO_Init(); #endif #if PL_CONFIG_HAS_MCP4728 MCP4728_Init(); #endif #if PL_CONFIG_HAS_ULTRASONIC US_Init(); #endif #if PL_CONFIG_HAS_PID PID_Init(); #endif #if PL_CONFIG_HAS_DRIVE DRV_Init(); #endif #if PL_CONFIG_HAS_TURN TURN_Init(); #endif #if PL_CONFIG_HAS_LINE_FOLLOW LF_Init(); #endif #if PL_CONFIG_HAS_RADIO RNETA_Init(); #endif #if PL_CONFIG_HAS_REMOTE REMOTE_Init(); #endif #if PL_CONFIG_HAS_IDENTIFY ID_Init(); #endif #if PL_CONFIG_HAS_LINE_MAZE MAZE_Init(); #endif }