예제 #1
0
void APP_Run(void) {
  appState = APP_STATE_INIT;
  MOT_Init();
  SHELL_Init();
#if PL_HAS_LINE_SENSOR
  REF_Init();
  LF_Init();
  TURN_Init();
#endif
#if PL_HAS_ULTRASONIC
  US_Init();
#endif
#if PL_HAS_BUZZER
  BUZ_Init();
#endif
#if PL_HAS_EVENTS
  EVNT_Init();
#endif
#if PL_HAS_RADIO
  RADIO_Init();
#endif
#if PL_HAS_REMOTE
  REMOTE_Init();
#endif
#if PL_HAS_QUEUE
  QUEUE_Init();
#endif
  if (FRTOS1_xTaskCreate(MainTask, (signed portCHAR *)"Main", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, NULL) != pdPASS) {
    for(;;){} /* error */
  }
  FRTOS1_vTaskStartScheduler();
}
예제 #2
0
void APP_Run(void) {
  appState = APP_STATE_INIT;
  REF_Init();
  MOT_Init();
  SHELL_Init();
  LF_Init();
  TURN_Init();
#if 0
  US_Init();
#endif
#if PL_HAS_BUZZER
  BUZ_Init();
#endif
  if (FRTOS1_xTaskCreate(MainTask, (signed portCHAR *)"Main", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1, NULL) != pdPASS) {
    for(;;){} /* error */
  }
  FRTOS1_vTaskStartScheduler();
}
예제 #3
0
파일: Platform.c 프로젝트: miklpikl/My_ROBO
void PL_INIT(void)
{
	#if PL_HAS_LED
		LED_INIT();
	#endif

	#if PL_HAS_RTOS
		RTOS_Init();
	#endif

	#if PL_HAS_EVENTS
		EVENT_Init();
	#endif

	#if PL_HAS_KEYS
		KEY_Init();
	#endif

	#if PL_HAS_TRIGGER
		TRG_Init();
	#endif

	#if PL_HAS_DEBOUNCE
		DBNC_Init();
	#endif

	#if PL_HAS_MEALY
		MEALY_Init();
	#endif

	#if PL_HAS_BUZZER
			BUZ_Init();
	#endif

	#if PL_HAS_SHELL
		SHELL_Init();
	#endif
}
예제 #4
0
static portTASK_FUNCTION(TaskMain, pvParameters ) {
  byte i;
#if PL_HAS_HW_LED
  byte cntr;
#endif
  
	/* The parameters are not used. */
	(void)pvParameters;
#if PL_HAS_WATCHDOG
	WDOG_Clear();
#endif
#if PL_HAS_HW_TOUCHSCREEN
  TouchScreen_CheckTouchScreenCalibrationData();
#endif
  BUZ_Init();
#if PL_HAS_UI
  APP_Init();
#endif
#if PL_HAS_HW_LED
  cntr = 0;
  LED3_On(); LED4_Off();
#endif
	for(;;) {
  #if PL_HAS_HW_TOUCHSCREEN
    TCHS1_Scan();
  #endif
  #if PL_POLL_KEYS2    
    KEY2_ScanKeys(); /* poll keys */
  #endif
    i = 10; /* to avoid stalling */
    while (EVNT1_EventsPending() && i>0) {
      EVNT1_HandleEvent();
      i--;
    }
  #if PL_HAS_HW_LED
    cntr++;
    if (cntr == 10) {  /* change LED's */
      LED3_Neg();
      LED4_Neg();
      cntr = 0;
    }
  #endif
#if PL_HAS_AUTO_DEMO
  #if PL_HAS_FONT_DEMO
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
    APP_SetApplicationMode(APP_MODE_FONT_DEMO);
    FRTOS1_vTaskDelay((10*1000)/portTICK_RATE_MS);
  #endif
  #if PL_HAS_ACCEL_DEMO
    APP_SetApplicationMode(APP_MODE_ACCEL_DEMO);
    FRTOS1_vTaskDelay((15*1000)/portTICK_RATE_MS);
    ACCEL_StopAccelDemo();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
  #if 0 && PL_HAS_TETRIS_DEMO
    APP_SetApplicationMode(APP_MODE_TETRIS);
    FRTOS1_vTaskDelay((5*1000)/portTICK_RATE_MS);
    TETRIS_KillTask();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
  #if PL_HAS_CUBE_DEMO
    APP_SetApplicationMode(APP_MODE_3D_CUBE);
    FRTOS1_vTaskDelay((8*1000)/portTICK_RATE_MS);
    CUBE_CloseShipWindow();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
    CUBE_CloseCubeWindow();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
    //APP_SetApplicationMode(APP_MODE_MAIN_MENU);
    //FRTOS1_vTaskDelay((5*1000)/portTICK_RATE_MS);
    heapSize = FRTOS1_xPortGetFreeHeapSize();
#endif
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
	} /* for */
}
예제 #5
0
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
}