kopia lustrzana https://github.com/espressif/esp-idf
rtc: fix typo in RTC_CNTL_SLOWCLK_FREQ macro name
rodzic
a64181f14f
commit
dbf60eb922
|
@ -240,7 +240,7 @@
|
||||||
#define RTC_CNTL_TIME_VALID_S 30
|
#define RTC_CNTL_TIME_VALID_S 30
|
||||||
|
|
||||||
/* frequency of RTC slow clock, Hz */
|
/* frequency of RTC slow clock, Hz */
|
||||||
#define RTC_CTNL_SLOWCLK_FREQ 150000
|
#define RTC_CNTL_SLOWCLK_FREQ 150000
|
||||||
|
|
||||||
#define RTC_CNTL_TIME0_REG (DR_REG_RTCCNTL_BASE + 0x10)
|
#define RTC_CNTL_TIME0_REG (DR_REG_RTCCNTL_BASE + 0x10)
|
||||||
/* RTC_CNTL_TIME_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
/* RTC_CNTL_TIME_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||||
|
|
|
@ -52,7 +52,7 @@ static uint64_t get_rtc_time_us()
|
||||||
uint64_t low = READ_PERI_REG(RTC_CNTL_TIME0_REG);
|
uint64_t low = READ_PERI_REG(RTC_CNTL_TIME0_REG);
|
||||||
uint64_t high = READ_PERI_REG(RTC_CNTL_TIME1_REG);
|
uint64_t high = READ_PERI_REG(RTC_CNTL_TIME1_REG);
|
||||||
uint64_t ticks = (high << 32) | low;
|
uint64_t ticks = (high << 32) | low;
|
||||||
return ticks * 100 / (RTC_CTNL_SLOWCLK_FREQ / 10000); // scale RTC_CTNL_SLOWCLK_FREQ to avoid overflow
|
return ticks * 100 / (RTC_CNTL_SLOWCLK_FREQ / 10000); // scale RTC_CNTL_SLOWCLK_FREQ to avoid overflow
|
||||||
}
|
}
|
||||||
#endif // WITH_RTC
|
#endif // WITH_RTC
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue