|
|
@ -47,19 +47,16 @@ void initTimer(uint32_t init_clock) |
|
|
|
// create the clockTask
|
|
|
|
// create the clockTask
|
|
|
|
xTaskCreate(clockTask, "clockTask", CLOCK_STACK_SIZE, NULL, 1, &taskHandle); |
|
|
|
xTaskCreate(clockTask, "clockTask", CLOCK_STACK_SIZE, NULL, 1, &taskHandle); |
|
|
|
|
|
|
|
|
|
|
|
_uclockTimer = timerBegin(TIMER_ID, 80, true); |
|
|
|
_uclockTimer = timerBegin(1000000); |
|
|
|
|
|
|
|
|
|
|
|
// attach to generic uclock ISR
|
|
|
|
// attach to generic uclock ISR
|
|
|
|
timerAttachInterrupt(_uclockTimer, &handlerISR, false); |
|
|
|
timerAttachInterrupt(_uclockTimer, &handlerISR); |
|
|
|
|
|
|
|
|
|
|
|
// init clock tick time
|
|
|
|
// init clock tick time
|
|
|
|
timerAlarmWrite(_uclockTimer, init_clock, true);
|
|
|
|
timerAlarm(_uclockTimer, init_clock, true, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// activate it!
|
|
|
|
|
|
|
|
timerAlarmEnable(_uclockTimer); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void setTimer(uint32_t us_interval) |
|
|
|
void setTimer(uint32_t us_interval) |
|
|
|
{ |
|
|
|
{ |
|
|
|
timerAlarmWrite(_uclockTimer, us_interval, true);
|
|
|
|
timerAlarm(_uclockTimer, us_interval, true, 0);
|
|
|
|
} |
|
|
|
} |