Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix esp32 timer issues #2697

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Sming/Arch/Esp32/Components/driver/hw_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class TimerConfig
#else
int source = timer_group_periph_signals.groups[group].timer_irq_id[index];
#endif
esp_intr_alloc_intrstatus(source, ESP_INTR_FLAG_IRAM, status_reg, mask, timerIsr, this, &isr_handle);
esp_intr_alloc_intrstatus(source, ESP_INTR_FLAG_IRAM | ESP_INTR_FLAG_INTRDISABLED, status_reg, mask, timerIsr,
this, &isr_handle);
clear_intr_status();
enable_intr(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ uint32_t hw_timer1_read(void);
__forceinline static uint32_t hw_timer2_read(void)
{
#if CONFIG_ESP_TIMER_IMPL_TG0_LAC
REG_WRITE(TIMG_LACTUPDATE_REG(0), 1);
return REG_READ(TIMG_LACTLO_REG(0));
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
systimer_ll_counter_snapshot(&SYSTIMER, 0);
Expand Down
7 changes: 6 additions & 1 deletion Sming/Core/CallbackTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ template <typename ApiDef> struct CallbackTimerApi {
return ApiDef::typeName();
}

CallbackTimerApi()
{
}

CallbackTimerApi(const CallbackTimerApi&) = delete;

String name() const
{
String s;
Expand All @@ -50,7 +56,6 @@ template <typename ApiDef> struct CallbackTimerApi {
s += static_cast<const ApiDef*>(this)->getInterval();
s += ", ticks = ";
s += static_cast<const ApiDef*>(this)->ticks();
// s += ApiDef::Clock::ticks();
return s;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/HostTests/host-tests-esp32.hw
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"base_config": "host-tests",
"partitions": {
"factory": {
"size": "1M"
"size": "1600K"
}
}
}
2 changes: 1 addition & 1 deletion tests/HostTests/modules/Timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CallbackTimerTest : public TestGroup
String s;
s += system_get_time();
s += " ";
s += statusTimer;
s += String(statusTimer);
s += " fired, timercount = ";
s += activeTimerCount;
s += ", mem = ";
Expand Down
Loading