123
Fork of LG by
Diff: DeviceTimers.c
- Revision:
- 161:efd949e8d536
- Parent:
- 156:e68ee0bcdcda
- Child:
- 167:bedc0a9d559a
--- a/DeviceTimers.c Fri May 13 14:04:22 2016 +0000 +++ b/DeviceTimers.c Sun May 15 19:12:12 2016 +0000 @@ -6,14 +6,11 @@ device.controller.timer[0].settings.match = 8064; //CCLK / 8064 = 12800.0Hz; Vibro: Timer1/32 = 400.0Hz; } -//void DeviceInitMeasurementTimer(unsigned int TimerInterval) { void InitMeasurementTimer(void) { LPC_SC->PCONP |= (1<<2); //Power on timer 1 - //LPC_TIM1->MR0 = TimerInterval; device.controller.timer[0].state.MR0 = device.controller.timer[0].settings.match; LPC_TIM1->MR0 = device.controller.timer[0].state.MR0; device.controller.timer[0].state.MCR = 3; - //LPC_TIM1->MCR = 3; //Interrupt and Reset on MR1 LPC_TIM1->MCR = device.controller.timer[0].state.MCR; //Interrupt and Reset on MR1 NVIC_EnableIRQ(TIMER1_IRQn); } @@ -43,14 +40,14 @@ } /* -//Measurement cycle timer interrupt +//Measurement floating cycle timer interrupt __irq void TIMER1_IRQHandler(void) { DeviceMeasurementInterruptHandler(); LPC_TIM1->IR = 1; } -//Regular cycle timer interrupt +//Regular cycle 100kHz timer interrupt __irq void TIMER2_IRQHandler(void) { DeviceRegularInterruptHandler();