瀏覽代碼

Better STM32 Tone timer int priority (#18385)

Jason Smith 5 年之前
父節點
當前提交
e52afa8b19
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 10 行新增0 行删除
  1. 9
    0
      Marlin/src/HAL/STM32/timers.cpp
  2. 1
    0
      platformio.ini

+ 9
- 0
Marlin/src/HAL/STM32/timers.cpp 查看文件

36
   #define TEMP_TIMER_IRQ_PRIO 14   // 14 = after hardware ISRs
36
   #define TEMP_TIMER_IRQ_PRIO 14   // 14 = after hardware ISRs
37
 #endif
37
 #endif
38
 
38
 
39
+// Ensure the default timer priority is somewhere between the STEP and TEMP priorities.
40
+// The STM32 framework defaults to interrupt 14 for all timers. This should be increased so that
41
+// timing-sensitive operations such as speaker output are note impacted by the long-running
42
+// temperature ISR. This must be defined in the platformio.ini file or the board's variant.h,
43
+// so that it will be consumed by framework code.
44
+#if !(TIM_IRQ_PRIO > STEP_TIMER_IRQ_PRIO && TIM_IRQ_PRIO < TEMP_TIMER_IRQ_PRIO)
45
+  #error "Default timer interrupt priority is unspecified or set to a value which may degrade performance."
46
+#endif
47
+
39
 #if HAS_TMC_SW_SERIAL
48
 #if HAS_TMC_SW_SERIAL
40
   #include <SoftwareSerial.h>
49
   #include <SoftwareSerial.h>
41
   #ifndef SWSERIAL_TIMER_IRQ_PRIO
50
   #ifndef SWSERIAL_TIMER_IRQ_PRIO

+ 1
- 0
platformio.ini 查看文件

329
   -IMarlin/src/HAL/STM32 -std=gnu++14
329
   -IMarlin/src/HAL/STM32 -std=gnu++14
330
   -DUSBCON -DUSBD_USE_CDC
330
   -DUSBCON -DUSBD_USE_CDC
331
   -DUSBD_VID=0x0483
331
   -DUSBD_VID=0x0483
332
+  -DTIM_IRQ_PRIO=13
332
 build_unflags = -std=gnu++11
333
 build_unflags = -std=gnu++11
333
 src_filter    = ${common.default_src_filter} +<src/HAL/STM32>
334
 src_filter    = ${common.default_src_filter} +<src/HAL/STM32>
334
 
335
 

Loading…
取消
儲存