Skip to content

Commit f7b9367

Browse files
committed
Correct hw_timer_get_clkdiv() returns.
1 parent aa60164 commit f7b9367

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/esp8266/driver/hw_timer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ esp_err_t hw_timer_set_clkdiv(hw_timer_clkdiv_t clkdiv)
6868

6969
uint32_t hw_timer_get_clkdiv()
7070
{
71-
return frc1.ctrl.div;
71+
switch (frc1.ctrl.div) {
72+
case 0: return 0;
73+
case 1: return 4;
74+
default: return 8;
75+
}
7276
}
7377

7478
esp_err_t hw_timer_set_intr_type(hw_timer_intr_type_t intr_type)

0 commit comments

Comments
 (0)