void BOOT_Start(void) { #if PL_IS_BOOTLOADER BL_Bootloader(); /* does not return */ #else RTOS_Start(); /* does not return */ #endif }
void Initial() { CyGlobalIntEnable; //Check_Boot(); Timer_RTOS_Start(); PWM_Start(); I2C_Start(); UART_Start(); RTC_Start(); RTC_SetPeriod(1,1000); RTOS_Start(); SetTask(Brightles_PID_Controll); LCD_WS0010Start(); SetTask(WaitPowerStab); SetTimerTask(OPT_Get_Result, 1300); //BLE_Status(); GlobalStruct.OS_Status = 0; SetTimerTask(Display_Controll, 2000); }
void main(void) { /* Write your local variable definition here */ #if PL_BOARD_LCD /* NOTE: the JM128 on the TWR-LCD needs at least to pull-up the microSD card detection pin, otherwise the signal is floating for the the driver in U5A */ PTGPE_PTGPE3 = 1; /* pull up enable for card detection line. Otherwise a CPU on the elevator will not be able to read the SD card detection signal */ #endif #if PL_BOARD_LCD && !PL_IS_BOOTLOADER && !PL_APP_MODE_I2C_LCD /* we are the TWR-LCD, and not the bootloader or the I2C application */ /* if we are not the bootloader: - if JM_ELE (SW1-3) is ON/low, then TWR CPU has control over the display (tristate lines) - if EuSD (SW1-4) is ON/low, then TWR CPU has control over the microSD card (tristate lines, pull-up CD line) - if TP_SEL (SW1-6) is OFF/high, then TWR CPU has control over the touch panel lines (tristate lines) */ if (!CanUseTouchPanel()) { for(;;) {} } if (!CanUseDisplay()) { for(;;) {} } #endif #if PL_HAS_BOOTLOADER BL_RedirectUserVectors(); /* need to redirect vectors before initializing the drivers below */ #endif /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ #if PL_IS_BOOTLOADER BL_Bootloader(); /* does not return */ #else RTOS_Start(); /* does not return */ #endif /*** Don't write any code pass this line, or it will be deleted during code generation. ***/ /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/ for(;;){} /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
void APP_Run(void) { LCD_Test(); EVNT1_SetEvent(EVNT1_INIT); TRG1_AddTrigger(TRG1_LED_BLINK, 100, APP_LedBlink); RTOS_Start(); }