void LED_Initialize(void) { state = (controller_state_t)0xFF; BSPInterface_SetOutputState(BSP_OUTPUT_LED_GROUP0, false); BSPInterface_SetOutputState(BSP_OUTPUT_LED_GROUP1, false); Timer_Initialize(&timer, TIMER_MODE_RECURRING, 50); Timer_Initialize(&timer, TIMER_MODE_RECURRING, 10); }
void APP_Initialize ( void ) { /* Place the App state machine in its initial state. */ appData.state = APP_STATE_INIT; Debug_Initialize(); //myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_READWRITE); xQueue = xQueueCreate(10, sizeof( struct MessageStruc ) ); SendQueue = xQueueCreate(20, sizeof( struct MessageStruc ) ); if(xQueue == 0 || SendQueue == 0) { ErrorRoutine(); } Timer_Initialize(); /* TODO: Initialize your application's state machine and other * parameters. */ }
UI_TimerControl *Initialize_ProgrammableIntervalTimer(void) { timerctrl = (UI_TimerControl *)System_Memory_Allocate(sizeof(UI_TimerControl)); timerctrl->tick_10ms = 0; timerctrl->TaskSwitch = &Timer_TaskSwitch_Invalid; //config watch timerctrl->timer_root = Timer_Initialize(); Timer_Config(timerctrl->timer_root, 0xfffffff, Null, 0, True); timerctrl->timer_root->timeout = 0xffffffff; timerctrl->timer_root->flags.bit.running = True; //config PIT IO_Out8(PIT_CTRL, 0x34); IO_Out8(PIT_CNT0, 0x9c); IO_Out8(PIT_CNT0, 0x2e); System_GateDescriptor_Set(0x20, (uint)asm_InterruptHandler20, 0x02, AR_INTGATE32); ProgrammableInterruptController_InterruptMask_Clear(0x00); return timerctrl; }