drivers: counter: rtc: esp32: Limit minimum time for set_alarm

Include value of 30 us as not valid to set alarm for RTC counter.
Change included to allow RTC timer to be properly set to use
RC_FAST_D256 as clock source.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
This commit is contained in:
Raffael Rostagno 2024-10-14 15:47:02 -03:00 committed by David Leach
parent 7d696f5b69
commit d33b8f6314

View File

@ -116,8 +116,8 @@ static int counter_esp32_set_alarm(const struct device *dev, uint8_t chan_id,
#if defined(CONFIG_SOC_SERIES_ESP32) || defined(CONFIG_SOC_SERIES_ESP32C2) || \
defined(CONFIG_SOC_SERIES_ESP32C3)
/* In ESP32/C3 Series the min possible value is 30 us*/
if (counter_ticks_to_us(dev, alarm_cfg->ticks) < 30) {
/* In ESP32/C3 Series the min possible value is 30+ us*/
if (counter_ticks_to_us(dev, alarm_cfg->ticks) <= 30) {
return -EINVAL;
}
#endif