Make HAL ISR macros function-like
This commit is contained in:
parent
e3ce346f24
commit
1f7e220387
@ -197,7 +197,7 @@ FORCE_INLINE void HAL_timer_start(const uint8_t timer_num, const uint32_t freque
|
|||||||
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
#define HAL_timer_isr_epilogue(TIMER_NUM)
|
||||||
|
|
||||||
/* 18 cycles maximum latency */
|
/* 18 cycles maximum latency */
|
||||||
#define HAL_STEP_TIMER_ISR \
|
#define HAL_STEP_TIMER_ISR() \
|
||||||
extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
extern "C" void TIMER1_COMPA_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
||||||
extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
extern "C" void TIMER1_COMPA_vect_bottom (void) asm ("TIMER1_COMPA_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||||
void TIMER1_COMPA_vect (void) { \
|
void TIMER1_COMPA_vect (void) { \
|
||||||
@ -270,7 +270,7 @@ void TIMER1_COMPA_vect (void) { \
|
|||||||
void TIMER1_COMPA_vect_bottom(void)
|
void TIMER1_COMPA_vect_bottom(void)
|
||||||
|
|
||||||
/* 14 cycles maximum latency */
|
/* 14 cycles maximum latency */
|
||||||
#define HAL_TEMP_TIMER_ISR \
|
#define HAL_TEMP_TIMER_ISR() \
|
||||||
extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
extern "C" void TIMER0_COMPB_vect (void) __attribute__ ((signal, naked, used, externally_visible)); \
|
||||||
extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
extern "C" void TIMER0_COMPB_vect_bottom(void) asm ("TIMER0_COMPB_vect_bottom") __attribute__ ((used, externally_visible, noinline)); \
|
||||||
void TIMER0_COMPB_vect (void) { \
|
void TIMER0_COMPB_vect (void) { \
|
||||||
|
@ -65,9 +65,9 @@ typedef uint32_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||||
|
|
||||||
#define HAL_STEP_TIMER_ISR void TC3_Handler()
|
#define HAL_STEP_TIMER_ISR() void TC3_Handler()
|
||||||
#define HAL_TEMP_TIMER_ISR void TC4_Handler()
|
#define HAL_TEMP_TIMER_ISR() void TC4_Handler()
|
||||||
#define HAL_TONE_TIMER_ISR void TC6_Handler()
|
#define HAL_TONE_TIMER_ISR() void TC6_Handler()
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Types
|
// Types
|
||||||
|
@ -45,7 +45,7 @@ void noTone(const pin_t _pin) {
|
|||||||
extDigitalWrite(_pin, LOW);
|
extDigitalWrite(_pin, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
HAL_TONE_TIMER_ISR {
|
HAL_TONE_TIMER_ISR() {
|
||||||
static uint8_t pin_state = 0;
|
static uint8_t pin_state = 0;
|
||||||
HAL_timer_isr_prologue(TONE_TIMER_NUM);
|
HAL_timer_isr_prologue(TONE_TIMER_NUM);
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ typedef uint64_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||||
|
|
||||||
#define HAL_TEMP_TIMER_ISR extern "C" void tempTC_Handler(void)
|
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
|
||||||
#define HAL_STEP_TIMER_ISR extern "C" void stepTC_Handler(void)
|
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
|
||||||
|
|
||||||
extern "C" void tempTC_Handler(void);
|
extern "C" void tempTC_Handler(void);
|
||||||
extern "C" void stepTC_Handler(void);
|
extern "C" void stepTC_Handler(void);
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
* This has many limitations and is not fit for the purpose
|
* This has many limitations and is not fit for the purpose
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HAL_STEP_TIMER_ISR;
|
HAL_STEP_TIMER_ISR();
|
||||||
HAL_TEMP_TIMER_ISR;
|
HAL_TEMP_TIMER_ISR();
|
||||||
|
|
||||||
Timer timers[2];
|
Timer timers[2];
|
||||||
|
|
||||||
|
@ -63,12 +63,12 @@ typedef uint32_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||||
|
|
||||||
#define HAL_STEP_TIMER_ISR extern "C" void TIMER0_IRQHandler(void)
|
#define HAL_STEP_TIMER_ISR() extern "C" void TIMER0_IRQHandler(void)
|
||||||
#define HAL_TEMP_TIMER_ISR extern "C" void TIMER1_IRQHandler(void)
|
#define HAL_TEMP_TIMER_ISR() extern "C" void TIMER1_IRQHandler(void)
|
||||||
|
|
||||||
// PWM timer
|
// PWM timer
|
||||||
#define HAL_PWM_TIMER
|
#define HAL_PWM_TIMER
|
||||||
#define HAL_PWM_TIMER_ISR extern "C" void TIMER3_IRQHandler(void)
|
#define HAL_PWM_TIMER_ISR() extern "C" void TIMER3_IRQHandler(void)
|
||||||
#define HAL_PWM_TIMER_IRQn
|
#define HAL_PWM_TIMER_IRQn
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,8 +88,8 @@ typedef uint32_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_interrupt(TEMP_TIMER_NUM)
|
||||||
|
|
||||||
#define HAL_STEP_TIMER_ISR _HAL_TIMER_ISR(STEP_TIMER_NUM)
|
#define HAL_STEP_TIMER_ISR() _HAL_TIMER_ISR(STEP_TIMER_NUM)
|
||||||
#define HAL_TEMP_TIMER_ISR _HAL_TIMER_ISR(TEMP_TIMER_NUM)
|
#define HAL_TEMP_TIMER_ISR() _HAL_TIMER_ISR(TEMP_TIMER_NUM)
|
||||||
|
|
||||||
// Timer references by index
|
// Timer references by index
|
||||||
#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM)
|
#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM)
|
||||||
|
@ -137,8 +137,8 @@
|
|||||||
|
|
||||||
extern void Step_Handler(stimer_t *htim);
|
extern void Step_Handler(stimer_t *htim);
|
||||||
extern void Temp_Handler(stimer_t *htim);
|
extern void Temp_Handler(stimer_t *htim);
|
||||||
#define HAL_STEP_TIMER_ISR void Step_Handler(stimer_t *htim)
|
#define HAL_STEP_TIMER_ISR() void Step_Handler(stimer_t *htim)
|
||||||
#define HAL_TEMP_TIMER_ISR void Temp_Handler(stimer_t *htim)
|
#define HAL_TEMP_TIMER_ISR() void Temp_Handler(stimer_t *htim)
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Types
|
// Types
|
||||||
|
@ -85,9 +85,8 @@ timer_dev* get_timer_dev(int number);
|
|||||||
|
|
||||||
// TODO change this
|
// TODO change this
|
||||||
|
|
||||||
|
#define HAL_TEMP_TIMER_ISR() extern "C" void tempTC_Handler(void)
|
||||||
#define HAL_TEMP_TIMER_ISR extern "C" void tempTC_Handler(void)
|
#define HAL_STEP_TIMER_ISR() extern "C" void stepTC_Handler(void)
|
||||||
#define HAL_STEP_TIMER_ISR extern "C" void stepTC_Handler(void)
|
|
||||||
|
|
||||||
extern "C" void tempTC_Handler(void);
|
extern "C" void tempTC_Handler(void);
|
||||||
extern "C" void stepTC_Handler(void);
|
extern "C" void stepTC_Handler(void);
|
||||||
|
@ -65,13 +65,13 @@
|
|||||||
#ifdef STM32GENERIC
|
#ifdef STM32GENERIC
|
||||||
extern void TC5_Handler();
|
extern void TC5_Handler();
|
||||||
extern void TC7_Handler();
|
extern void TC7_Handler();
|
||||||
#define HAL_STEP_TIMER_ISR void TC5_Handler()
|
#define HAL_STEP_TIMER_ISR() void TC5_Handler()
|
||||||
#define HAL_TEMP_TIMER_ISR void TC7_Handler()
|
#define HAL_TEMP_TIMER_ISR() void TC7_Handler()
|
||||||
#else
|
#else
|
||||||
extern void TC5_Handler(stimer_t *htim);
|
extern void TC5_Handler(stimer_t *htim);
|
||||||
extern void TC7_Handler(stimer_t *htim);
|
extern void TC7_Handler(stimer_t *htim);
|
||||||
#define HAL_STEP_TIMER_ISR void TC5_Handler(stimer_t *htim)
|
#define HAL_STEP_TIMER_ISR() void TC5_Handler(stimer_t *htim)
|
||||||
#define HAL_TEMP_TIMER_ISR void TC7_Handler(stimer_t *htim)
|
#define HAL_TEMP_TIMER_ISR() void TC7_Handler(stimer_t *htim)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@
|
|||||||
|
|
||||||
extern void TC5_Handler();
|
extern void TC5_Handler();
|
||||||
extern void TC7_Handler();
|
extern void TC7_Handler();
|
||||||
#define HAL_STEP_TIMER_ISR void TC5_Handler()
|
#define HAL_STEP_TIMER_ISR() void TC5_Handler()
|
||||||
#define HAL_TEMP_TIMER_ISR void TC7_Handler()
|
#define HAL_TEMP_TIMER_ISR() void TC7_Handler()
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Types
|
// Types
|
||||||
|
@ -72,8 +72,8 @@ typedef uint32_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_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) //void TC3_Handler()
|
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler()
|
||||||
#define HAL_TEMP_TIMER_ISR extern "C" void ftm1_isr(void) //void TC4_Handler()
|
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler()
|
||||||
|
|
||||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ typedef uint32_t hal_timer_t;
|
|||||||
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
#define ENABLE_TEMPERATURE_INTERRUPT() HAL_timer_enable_interrupt(TEMP_TIMER_NUM)
|
||||||
#define DISABLE_TEMPERATURE_INTERRUPT() HAL_timer_disable_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) //void TC3_Handler()
|
#define HAL_STEP_TIMER_ISR() extern "C" void ftm0_isr(void) //void TC3_Handler()
|
||||||
#define HAL_TEMP_TIMER_ISR extern "C" void ftm1_isr(void) //void TC4_Handler()
|
#define HAL_TEMP_TIMER_ISR() extern "C" void ftm1_isr(void) //void TC4_Handler()
|
||||||
|
|
||||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||||
|
|
||||||
|
@ -1246,7 +1246,7 @@ void Stepper::set_directions() {
|
|||||||
* Directly pulses the stepper motors at high frequency.
|
* Directly pulses the stepper motors at high frequency.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
HAL_STEP_TIMER_ISR {
|
HAL_STEP_TIMER_ISR() {
|
||||||
HAL_timer_isr_prologue(STEP_TIMER_NUM);
|
HAL_timer_isr_prologue(STEP_TIMER_NUM);
|
||||||
|
|
||||||
Stepper::isr();
|
Stepper::isr();
|
||||||
|
@ -2295,7 +2295,7 @@ void Temperature::readings_ready() {
|
|||||||
* - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
|
* - For ENDSTOP_INTERRUPTS_FEATURE check endstops if flagged
|
||||||
* - Call planner.tick to count down its "ignore" time
|
* - Call planner.tick to count down its "ignore" time
|
||||||
*/
|
*/
|
||||||
HAL_TEMP_TIMER_ISR {
|
HAL_TEMP_TIMER_ISR() {
|
||||||
HAL_timer_isr_prologue(TEMP_TIMER_NUM);
|
HAL_timer_isr_prologue(TEMP_TIMER_NUM);
|
||||||
|
|
||||||
Temperature::isr();
|
Temperature::isr();
|
||||||
|
Loading…
Reference in New Issue
Block a user