From 3f32fb48af497226d3e18476e495196ebfa47e0d Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Wed, 15 Nov 2023 07:26:34 +1100 Subject: [PATCH] Correct idle frequency check for Teensy41 --- speeduino/idle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speeduino/idle.cpp b/speeduino/idle.cpp index 3b90240a..437baadb 100644 --- a/speeduino/idle.cpp +++ b/speeduino/idle.cpp @@ -134,7 +134,7 @@ void initialiseIdle(bool forcehoming) #if defined(CORE_AVR) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (16U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 16uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz - #elif defined(CORE_TEENSY) + #elif defined(CORE_TEENSY35) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (32U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 32uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz #elif defined(CORE_TEENSY41) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (2U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 2uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz @@ -158,7 +158,7 @@ void initialiseIdle(bool forcehoming) #if defined(CORE_AVR) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (16U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 16uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz - #elif defined(CORE_TEENSY) + #elif defined(CORE_TEENSY35) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (32U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 32uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz #elif defined(CORE_TEENSY41) idle_pwm_max_count = (uint16_t)(MICROS_PER_SEC / (2U * configPage6.idleFreq * 2U)); //Converts the frequency in Hz to the number of ticks (at 2uS) it takes to complete 1 cycle. Note that the frequency is divided by 2 coming from TS to allow for up to 512hz