/* *------------------------------------------------------------------------------ * void main(void) * Summary : Application specifc main routine. Initializes all port and * : pheriperal and put the main task into an infinite loop. * * Input : None * * Output : None * *------------------------------------------------------------------------------ */ void main(void) { UINT8 i; BOARD_init(); TIMER0_init(TIMER0_RELOAD,0); APP_init(); EnableInterrupts(); //DelayMs(3000); while(TRUE) { if( heartBeatCount >= 100 ) { HB_task(); heartBeatCount = 0; } if( comUpdateCount >= 2 ) { MB_task(); //COM_task(); comUpdateCount = 0; } //ClrWdt(); if( appUpdateCount >= 50 ) { APP_task(); appUpdateCount = 0; } //ClrWdt(); ClrWdt(); } }
void main(void) { UINT8 count=0, i, uartData; UINT8 blink = 0; BRD_init(); //board initialization DigitDisplay_init(NO_OF_DIGITS); //Digit Display initialization TMR0_init(DIGIT_REFRESH_PERIOD,DigitDisplay_task); //initialize timer0 COM_init(CMD_SOP , CMD_EOP ,RESP_SOP , RESP_EOP , APP_comCallBack); APP_init(); EnableInterrupts(); //Interrupts initialization ENABLE_GLOBAL_INT(); while(1) { ` if(heartBeatCount >= 600 ) { HB_task(); heartBeatCount = 0; } if(appUpdateCount >= 500) { APP_task(); appUpdateCount = 0; } COM_task(); } }
void main(void) #endif { BOARD_InitPins(); BOARD_BootClockRUN(); BOARD_InitDebugConsole(); APPInit(); while (1) { APP_task(); #if USB_DEVICE_CONFIG_USE_TASK #if defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0U) USB_DeviceEhciTaskFunction(s_cdcVcom.deviceHandle); #endif #if defined(USB_DEVICE_CONFIG_KHCI) && (USB_DEVICE_CONFIG_KHCI > 0U) USB_DeviceKhciTaskFunction(s_cdcVcom.deviceHandle); #endif #endif } }
/* *------------------------------------------------------------------------------ * void main(void) * Summary : Application specifc main routine. Initializes all port and * : pheriperal and put the main task into an infinite loop. * * Input : None * * Output : None * *------------------------------------------------------------------------------ */ void main(void) { UINT8 i; #ifdef KEYPAD_TEST UINT8 scancode, duration; #endif BOARD_init(); TIMER0_init(TIMER0_RELOAD,0); LCD_init(); #ifdef TEST_LCD for(i = 0 ; i< 26; i++) { LCD_putChar(i+'A'); DelayMs(200); } LCD_clear(); #endif #ifdef TOWER_LAMP_TEST GREEN = 1; DelayMs(1000); GREEN = 0; YELLOW = 1; DelayMs(1000); YELLOW = 0; RED = 1; DelayMs(1000); RED = 0; BUZZER = 1; DelayMs(1000); BUZZER = 0; #endif KEYPAD_init(); UI_init(); //MUST BE DONE AFTER IAS INIT APP_init(); #ifdef __UART_TEST__ COM_txStr("IDEONICS ANDON TERMINAL "); #endif EnableInterrupts(); //DelayMs(3000); while(TRUE) { if( heartBeatCount >= 100 ) { HB_task(); heartBeatCount = 0; } if( keypadUpdateCount >= 8 ) { KEYPAD_task(); LinearKeyPad_scan( ); keypadUpdateCount = 0; } if( comUpdateCount >= 2 ) { MB_task(); //COM_task(); comUpdateCount = 0; } //ClrWdt(); if( appUpdateCount >= 50 ) { APP_task(); appUpdateCount = 0; } //ClrWdt(); #ifdef KEYPAD_TEST if( KEYPAD_read(&scancode, &duration) == TRUE ) LCD_putChar(scancode); #else if( uiUpdateCount >=40 ) { UI_task(); uiUpdateCount = 0; } #endif ClrWdt(); } }
void main(void) { UINT8 i,j; BOOL ledStrip_On = 0; BRD_init(); HB_init(); External_Init(); MMD_init(); // Display initialization COM_init(CMD_SOP,CMD_EOP,RESP_SOP,RESP_EOP,APP_comCallBack); LinearKeyPad_init( ); DelayMs(3000); InitializeRtc(); APP_init(); TMR0_init(TICK_PERIOD,0); //initialize timer0 TMR1_init(MMD_REFRESH_PERIOD,MMD_refreshDisplay); EnableInterrupts(); #ifdef __SET_RTC__ WriteRtcTimeAndDate(writeTimeDateBuffer); #endif while(1) { if( comUpdateCount > 5 ) { COM1_task(); //COM2_task(); comUpdateCount = 0; } #ifdef TIME_DEBUG if( heartBeatCount >= 250 ) { #endif UpdateRealTimeClockTask(); if( TimeClockUpdateRequired == TRUE) { HB_task(); TimeClockUpdateRequired = FALSE; } #ifdef TIME_DEBUG heartBeatCount = 0; } #endif if( heartBeatCount >= 250 ) { APP_task(); heartBeatCount = 0; } if( mmdUpdateCount >= 5 ) { MMD_task(); mmdUpdateCount = 0; } if(keypadUpdate_count >= 10) { //LinearKeyPad_scan(); keypadUpdate_count = 0; } } }
/* *------------------------------------------------------------------------------ * void main(void) * Summary : Application specifc main routine. Initializes all port and * : pheriperal and put the main task into an infinite loop. * * Input : None * * Output : None * *------------------------------------------------------------------------------ */ void main(void) { UINT8 i; volatile UINT16 StartupDelay = 0 ; #ifdef KEYPAD_TEST UINT8 scancode, duration; #endif BOARD_init(); TIMER0_init(TIMER0_RELOAD,0); LCD_init(); for(i = 0 ; i< strlen(DeviceTag); i++) { LCD_putChar(DeviceTag[i]); //DelayMs(200); } //LCD_clear(); #ifdef TOWER_LAMP_TEST GREEN = 1; DelayMs(1000); GREEN = 0; YELLOW = 1; DelayMs(1000); YELLOW = 0; RED = 1; DelayMs(1000); RED = 0; BUZZER = 1; DelayMs(1000); BUZZER = 0; #endif KEYPAD_init(); UI_init(); //MUST BE DONE AFTER IAS INIT APP_init(); #ifdef __UART_TEST__ COM_txStr(DeviceTag); #endif EnableInterrupts(); //DelayMs(3000); while(TRUE) { if( heartBeatCount >= 100 ) { HB_task(); heartBeatCount = 0; if(StartupDelay <= STARTDELAY_TIME) StartupDelay++; } if( keypadUpdateCount >= 8 ) { if(StartupDelay >= STARTDELAY_TIME) { KEYPAD_task(); keypadUpdateCount = 0; } } if( comUpdateCount >= 2 ) { COM_task(); comUpdateCount = 0; } //ClrWdt(); if( appUpdateCount >= 100 ) { APP_task(); appUpdateCount = 0; } //ClrWdt(); #ifdef KEYPAD_TEST if( KEYPAD_read(&scancode, &duration) == TRUE ) LCD_putChar(scancode); #else if( uiUpdateCount >=40) { UI_task(); uiUpdateCount = 0; } #endif ClrWdt(); } }