Closed manitou48 closed 4 years ago
With scope I noticed that Teensy 3* threads have 10 ms timeslice, but Teensy 4 has 5 ms timeslice?
I think the problem is that GPT ISR will fire twice unless you have asm volatile ("dsb"); at the end of the isr.
static void attribute((naked, noinline)) gpt1_isr() { GPT1_SR |= GPT_SR_OF1; // clear set bit asm volatile("dsb"); __asm volatile("b context_switch"); }
Thanks for catching that. It's a subtle bug. I have commited your suggested fix.
With scope I noticed that Teensy 3* threads have 10 ms timeslice, but Teensy 4 has 5 ms timeslice?
I think the problem is that GPT ISR will fire twice unless you have asm volatile ("dsb"); at the end of the isr.
static void attribute((naked, noinline)) gpt1_isr() { GPT1_SR |= GPT_SR_OF1; // clear set bit asm volatile("dsb"); __asm volatile("b context_switch"); }