RTC Library bug???
Posted: Sun Jun 14, 2015 4:37 am
Hello,
I was reading up on how to use the RTC inside the ESP8266 and looking into the eagle_soc.h file, it seems like there is a "bug" where the RTC values are in fact read from Timer2.
On line 67:
On Line 150:
On line 169:
Anyone else tried using the RTC successfully?
I suppose the system calls (system_get_rtc_time) are compiled based on this, so it's really not the RTC working and without more information about the registers of the RTC there isn't much else we can do I guess.
Anyone else noticed this before??
I was reading up on how to use the RTC inside the ESP8266 and looking into the eagle_soc.h file, it seems like there is a "bug" where the RTC values are in fact read from Timer2.
On line 67:
Code: Select all
#define PERIPHS_TIMER_BASEDDR 0x60000600
#define PERIPHS_RTC_BASEADDR 0x60000700
On Line 150:
Code: Select all
// TIMER reg {{
#define RTC_REG_READ(addr) READ_PERI_REG(PERIPHS_TIMER_BASEDDR + addr)
#define RTC_REG_WRITE(addr, val) WRITE_PERI_REG(PERIPHS_TIMER_BASEDDR + addr, val)
#define RTC_CLR_REG_MASK(reg, mask) CLEAR_PERI_REG_MASK(PERIPHS_TIMER_BASEDDR +reg, mask)
/* Returns the current time according to the timer timer. */
#define NOW() RTC_REG_READ(FRC2_COUNT_ADDRESS)
On line 169:
Code: Select all
//timer2's counter value(count from initial_value to 0)
#define FRC2_COUNT_ADDRESS 0x24
// }}
Anyone else tried using the RTC successfully?
I suppose the system calls (system_get_rtc_time) are compiled based on this, so it's really not the RTC working and without more information about the registers of the RTC there isn't much else we can do I guess.
Anyone else noticed this before??