fix 3S hang & enable SPLIT

This commit is contained in:
Bob-the-Kuhn
2017-09-29 23:52:17 -05:00
parent 6904561fd5
commit 1beaef0452
2 changed files with 51 additions and 35 deletions

View File

@ -79,8 +79,16 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
static FORCE_INLINE void HAL_timer_set_count(const uint8_t timer_num, const HAL_TIMER_TYPE count) {
switch (timer_num) {
case 0: LPC_TIM0->MR0 = count; break;
case 1: LPC_TIM1->MR0 = count; break;
case 0:
LPC_TIM0->MR0 = count;
if (LPC_TIM0->TC > count)
LPC_TIM0->TC = count - 5; // generate an immediate stepper ISR
break;
case 1:
LPC_TIM1->MR0 = count;
if (LPC_TIM1->TC > count)
LPC_TIM1->TC = count - 5; // make sure we don't have one extra long period
break;
}
}