Skip to content

Commit daa0a9f

Browse files
committed
ESP32 S3 and C3 fix
1 parent 3acc334 commit daa0a9f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

uCNC/src/hal/mcus/esp32c3/mcu_esp32c3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ void mcu_config_timeout(mcu_timeout_delgate fp, uint32_t timeout)
453453
{
454454
mcu_timeout_cb = fp;
455455
#if defined(MCU_HAS_ONESHOT_TIMER) && defined(ENABLE_RT_SYNC_MOTIONS)
456-
esp32_oneshot_reload = ((ITP_SAMPLE_RATE >> 1) / timeout);
456+
esp32_oneshot_reload = (timeout / signal_timer.us_step);
457457
#elif defined(MCU_HAS_ONESHOT_TIMER)
458458
timer_config_t config = {0};
459459
config.divider = getApbFrequency() / 1000000UL; // 1us per count

uCNC/src/hal/mcus/esp32s3/mcu_esp32s3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ bool mcu_get_global_isr(void)
291291
{
292292
return false;
293293
}
294-
294+
295295
uint32_t ps;
296296
__asm__ volatile("rsr.ps %0" : "=a"(ps));
297297
// INTLEVEL is bits [3:0] of PS
@@ -436,7 +436,7 @@ void mcu_config_timeout(mcu_timeout_delgate fp, uint32_t timeout)
436436
{
437437
mcu_timeout_cb = fp;
438438
#if defined(MCU_HAS_ONESHOT_TIMER) && defined(ENABLE_RT_SYNC_MOTIONS)
439-
esp32_oneshot_reload = ((ITP_SAMPLE_RATE >> 1) / timeout);
439+
esp32_oneshot_reload = (timeout / signal_timer.us_step);
440440
#elif defined(MCU_HAS_ONESHOT_TIMER)
441441
timer_config_t config = {0};
442442
config.divider = getApbFrequency() / 1000000UL; // 1us per count

0 commit comments

Comments
 (0)