Browse Source

Merge remote-tracking branch 'PaulStoffregen/master'

main
duff2013 8 years ago
parent
commit
6879aa53df
2 changed files with 16 additions and 1 deletions
  1. +6
    -1
      teensy3/DMAChannel.cpp
  2. +10
    -0
      teensy3/IntervalTimer.h

+ 6
- 1
teensy3/DMAChannel.cpp View File

#include "DMAChannel.h" #include "DMAChannel.h"


#if DMA_NUM_CHANNELS > 16
#undef DMA_NUM_CHANNELS
#define DMA_NUM_CHANNELS 16
#endif



// The channel allocation bitmask is accessible from "C" namespace, // The channel allocation bitmask is accessible from "C" namespace,
// so C-only code can reserve DMA channels // so C-only code can reserve DMA channels
__disable_irq(); __disable_irq();
dma_channel_allocated_mask &= ~(1 << channel); dma_channel_allocated_mask &= ~(1 << channel);
__enable_irq(); __enable_irq();
channel = 16;
channel = DMA_NUM_CHANNELS;
TCD = (TCD_t *)0; TCD = (TCD_t *)0;
} }



+ 10
- 0
teensy3/IntervalTimer.h View File

nvic_priority = n; nvic_priority = n;
if (PIT_enabled) NVIC_SET_PRIORITY(IRQ_PIT_CH, n); if (PIT_enabled) NVIC_SET_PRIORITY(IRQ_PIT_CH, n);
} }
operator IRQ_NUMBER_t() {
if (PIT_enabled) {
#if defined(KINETISK)
return (IRQ_NUMBER_t)(IRQ_PIT_CH + PIT_id);
#elif defined(KINETISL)
return IRQ_PIT;
#endif
}
return (IRQ_NUMBER_t)NVIC_NUM_INTERRUPTS;
}
#if defined(KINETISK) #if defined(KINETISK)
friend void pit0_isr(); friend void pit0_isr();
friend void pit1_isr(); friend void pit1_isr();

Loading…
Cancel
Save