Sfoglia il codice sorgente

Fix systick when yield overridden

teensy4-core
PaulStoffregen 7 anni fa
parent
commit
2d7cf7acdd
2 ha cambiato i file con 14 aggiunte e 1 eliminazioni
  1. +13
    -0
      teensy3/EventResponder.cpp
  2. +1
    -1
      teensy3/mk20dx128.c

+ 13
- 0
teensy3/EventResponder.cpp Vedi File

@@ -320,6 +320,19 @@ void MillisTimer::runFromTimer()
}
}

// Long ago you could install your own systick interrupt handler by just
// creating your own systick_isr() function. No longer. But if you
// *really* want to commandeer systick, you can still do so by writing
// your function into the RAM-based vector table.
//
// _VectorsRam[15] = my_systick_function;
//
// However, for long-term portability, use a MillisTimer object to
// generate an event every millisecond, and attach your function to
// its EventResponder. You can attach as a software interrupt, so your
// code will run at lower interrupt priority for better compatibility
// with libraries using mid-to-high priority interrupts.

extern "C" volatile uint32_t systick_millis_count;
void systick_isr(void)
{

+ 1
- 1
teensy3/mk20dx128.c Vedi File

@@ -145,7 +145,7 @@ void usage_fault_isr(void) __attribute__ ((weak, alias("fault_isr")));
void svcall_isr(void) __attribute__ ((weak, alias("unused_isr")));
void debugmonitor_isr(void) __attribute__ ((weak, alias("unused_isr")));
void pendablesrvreq_isr(void) __attribute__ ((weak, alias("unused_isr")));
void systick_isr(void) __attribute__ ((weak, alias("unused_isr")));
void systick_isr(void);

void dma_ch0_isr(void) __attribute__ ((weak, alias("unused_isr")));
void dma_ch1_isr(void) __attribute__ ((weak, alias("unused_isr")));

Loading…
Annulla
Salva