void setup() { int i; setupSystemClock(); setupUART(); setup_system_tick(SYSTEM_TICK_FREQ); ID_Init(); // MO: Is it also system init? GetID(); /* Init AHRS I2C */ /* ----Initialize I2C slave mode--- */ if(devNum == 0) I2C_MS_Master_Init(); else I2C_MS_Slave_Init(); //I2CWakeUpInit(); TIDMstFirstInitFIN = 0; TIDMstInitFIN = 0; TIDMstStage = 0; TIDMstInitDevState = 1; FlashInit(); // Setup function pointers for default sensor boards. for(i=0; i<MAX_TID_DEV; i++) { if (pTidList[i]) SetDeviceFunction(pTidList[i], &(pfnDevFunc[i])); } // Call board init function if (pTidList[devNum]->func.pfnSetup) pTidList[devNum]->func.pfnSetup(); // Load TID feature from flash GetFlashTID(&(pTidList[devNum]->Feature), devNum); // Set Timer1 to (1000/value) in (Hz) Timer1Init(1000 / (pTidList[devNum]->Feature.data1.value)); /* TID initialize */ SlvDataInit(); MstDataInit(); }
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 }