Fix STM32 + SoftwareSerial compile (#17831)
This commit is contained in:
@ -27,10 +27,6 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../shared/Delay.h"
|
||||
|
||||
#if HAS_TMC_SW_SERIAL
|
||||
#include "SoftwareSerial.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(SRAM_EEPROM_EMULATION)
|
||||
#if STM32F7xx
|
||||
#include <stm32f7xx_ll_pwr.h>
|
||||
@ -82,11 +78,7 @@ void HAL_init() {
|
||||
while (!LL_PWR_IsActiveFlag_BRR()); // Wait until backup regulator is initialized
|
||||
#endif
|
||||
|
||||
#if HAS_TMC_SW_SERIAL
|
||||
SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
|
||||
#endif
|
||||
|
||||
TERN_(HAS_TMC_SW_SERIAL, SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0));
|
||||
SetSoftwareSerialTimerInterruptPriority();
|
||||
}
|
||||
|
||||
void HAL_clear_reset_source() { __HAL_RCC_CLEAR_RESET_FLAGS(); }
|
||||
|
@ -31,9 +31,6 @@
|
||||
|
||||
#define NUM_HARDWARE_TIMERS 2
|
||||
|
||||
#ifndef SWSERIAL_TIMER_IRQ_PRIO
|
||||
#define SWSERIAL_TIMER_IRQ_PRIO 1
|
||||
#endif
|
||||
#ifndef STEP_TIMER_IRQ_PRIO
|
||||
#define STEP_TIMER_IRQ_PRIO 2
|
||||
#endif
|
||||
@ -41,6 +38,13 @@
|
||||
#define TEMP_TIMER_IRQ_PRIO 14 // 14 = after hardware ISRs
|
||||
#endif
|
||||
|
||||
#if HAS_TMC_SW_SERIAL
|
||||
#include <SoftwareSerial.h>
|
||||
#ifndef SWSERIAL_TIMER_IRQ_PRIO
|
||||
#define SWSERIAL_TIMER_IRQ_PRIO 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef STM32F0xx
|
||||
#define HAL_TIMER_RATE (F_CPU) // Frequency of timer peripherals
|
||||
#define MCU_STEP_TIMER 16
|
||||
@ -175,4 +179,8 @@ TIM_TypeDef * HAL_timer_device(const uint8_t timer_num) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SetSoftwareSerialTimerInterruptPriority() {
|
||||
TERN_(HAS_TMC_SW_SERIAL, SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0));
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ARCH_STM32 && !STM32GENERIC
|
||||
|
@ -75,6 +75,9 @@ void HAL_timer_enable_interrupt(const uint8_t timer_num);
|
||||
void HAL_timer_disable_interrupt(const uint8_t timer_num);
|
||||
bool HAL_timer_interrupt_enabled(const uint8_t timer_num);
|
||||
|
||||
// Exposed here to allow all timer priority information to reside in timers.cpp
|
||||
void SetSoftwareSerialTimerInterruptPriority();
|
||||
|
||||
//TIM_TypeDef* HAL_timer_device(const uint8_t timer_num); no need to be public for now. not public = not used externally
|
||||
|
||||
// FORCE_INLINE because these are used in performance-critical situations
|
||||
|
Reference in New Issue
Block a user