2011-05-05 11:40:22 +00:00
|
|
|
template<unsigned cycle_frequency>
|
|
|
|
void SMP::Timer<cycle_frequency>::tick() {
|
|
|
|
if(++stage1_ticks < cycle_frequency) return;
|
|
|
|
|
|
|
|
stage1_ticks = 0;
|
|
|
|
if(enable == false) return;
|
|
|
|
|
|
|
|
if(++stage2_ticks != target) return;
|
|
|
|
|
|
|
|
stage2_ticks = 0;
|
|
|
|
stage3_ticks = (stage3_ticks + 1) & 15;
|
|
|
|
}
|
|
|
|
|
2011-05-05 11:37:46 +00:00
|
|
|
template<unsigned cycle_frequency>
|
|
|
|
void SMP::Timer<cycle_frequency>::tick(unsigned clocks) {
|
|
|
|
stage1_ticks += clocks;
|
|
|
|
if(stage1_ticks < cycle_frequency) return;
|
2011-05-02 13:53:16 +00:00
|
|
|
|
2011-05-05 11:37:46 +00:00
|
|
|
stage1_ticks -= cycle_frequency;
|
2011-05-02 13:53:16 +00:00
|
|
|
if(enable == false) return;
|
2011-05-05 11:37:46 +00:00
|
|
|
|
2011-05-05 11:40:22 +00:00
|
|
|
if(++stage2_ticks != target) return;
|
2011-05-02 13:53:16 +00:00
|
|
|
|
|
|
|
stage2_ticks = 0;
|
2011-05-05 11:40:22 +00:00
|
|
|
stage3_ticks = (stage3_ticks + 1) & 15;
|
2011-05-02 13:53:16 +00:00
|
|
|
}
|