Access to the SystemTick interrupt
Posted: Sun Feb 26, 2017 8:02 am
I wish to create a number of timers, each with a resolution of the system tick. Is it possible to access the SystemTick interrupt so it can drive my timer module?
The code i wish to access has very low overhead:
The alternative is setting up an entire Task just to handle this timer, which seems a lot of overhead for a simple timer module.
Thanks
Lachlan
The code i wish to access has very low overhead:
Code: Select all
for (uint8_t timer=0; timer < TMR_MAX; timer++){
if ((timer_status>>timer) & 0x01) // Is Timer enabled ?
if ( (--timer_count[timer]) == 0){ // If Timer timed-out, activate flag
if ((timer_reset >> timer) & 0x01) // If auto reset on
timer_count[timer] = timer_value[timer]; // re-initiate timer
else
timer_status &= ~(1 << timer); // else Clear Timer enable flag
time_out |= 1 << timer; // Set Time_out Flag
}
}
Thanks
Lachlan