Allow pins override of *_TIMER_NUM and HAL_*_TIMER_ISR (#18128)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
@ -34,8 +34,6 @@
|
||||
#include "fastio.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include "timers.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/atomic.h>
|
||||
|
||||
|
@ -27,8 +27,7 @@
|
||||
|
||||
#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
|
||||
|
||||
#include "HAL.h"
|
||||
#include "timers.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
/** \brief Instruction Synchronization Barrier
|
||||
Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||
|
@ -46,9 +46,15 @@ typedef uint32_t hal_timer_t;
|
||||
|
||||
#define HAL_TIMER_RATE (FTM0_TIMER_RATE)
|
||||
|
||||
#define STEP_TIMER_NUM 0
|
||||
#define TEMP_TIMER_NUM 1
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#ifndef STEP_TIMER_NUM
|
||||
#define STEP_TIMER_NUM 0 // Timer Index for Stepper
|
||||
#endif
|
||||
#ifndef PULSE_TIMER_NUM
|
||||
#define PULSE_TIMER_NUM STEP_TIMER_NUM
|
||||
#endif
|
||||
#ifndef TEMP_TIMER_NUM
|
||||
#define TEMP_TIMER_NUM 1 // Timer Index for Temperature
|
||||
#endif
|
||||
|
||||
#define TEMP_TIMER_FREQUENCY 1000
|
||||
|
||||
@ -67,8 +73,12 @@ typedef uint32_t hal_timer_t;
|
||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
|
||||
#ifndef HAL_STEP_TIMER_ISR
|
||||
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr() //void TC3_Handler()
|
||||
#endif
|
||||
#ifndef HAL_TEMP_TIMER_ISR
|
||||
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr() //void TC4_Handler()
|
||||
#endif
|
||||
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
|
||||
|
Reference in New Issue
Block a user