From 932fcbb33f51b33b8820f9e2139bbd3348c2d35f Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sun, 15 May 2022 01:07:06 +0200 Subject: [PATCH] Simplify soft_pwm_isr even further Isolate the PWM management into soft_pwm_core --- Firmware/temperature.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 42518eaf..802a6899 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1426,10 +1426,8 @@ FORCE_INLINE static void applyBabysteps() { } #endif //BABYSTEPPING -FORCE_INLINE static void soft_pwm_isr() +FORCE_INLINE static void soft_pwm_core() { - lcd_buttons_update(); - static uint8_t pwm_count = (1 << SOFT_PWM_SCALE); static uint8_t soft_pwm_0; #ifdef SLOW_PWM_HEATERS @@ -1764,6 +1762,12 @@ FORCE_INLINE static void soft_pwm_isr() } //if ((pwm_count % 64) == 0) { #endif //ifndef SLOW_PWM_HEATERS +} + +FORCE_INLINE static void soft_pwm_isr() +{ + lcd_buttons_update(); + soft_pwm_core(); #ifdef BABYSTEPPING applyBabysteps();