Wait after setting the RTC time, to allow registers to update (fix #438, fix #441)

This commit is contained in:
Gordon Williams 2014-11-10 16:53:58 +00:00
parent dba2eb8fbb
commit 67d3e69cce
3 changed files with 9 additions and 5 deletions

View File

@ -11,6 +11,7 @@
Fix network de-initialisation on Linux
Fix reference count issue caused by removing a timer that had already been removed
Power up SYSCFG on F2/3/4 parts, allowing watch to work on ports other than A
Wait after setting the RTC time, to allow registers to update (fix #438, fix #441)
1v70 : Make pipe remove its drain/close listeners. Stops out of memory for repeated piping.
Fix parseInt for values too large to go in an int (#406)

View File

@ -130,7 +130,7 @@ SECTIONS
if "place_text_section" in board.chip:
codeOut(""" /* In the .py file we were told to place text here (to skip out what was before) */
. = ALIGN("""+hex(board.chip["place_text_section"]-FLASH_BASE)+"""); /* hacky! really want it absolute */
. = ALIGN("""+hex(board.chip["place_text_section"] & 0x00FFFFFF)+"""); /* hacky! really want it absolute */
""");
codeOut("""

View File

@ -1453,7 +1453,8 @@ void jshSetSystemTime(JsSysTime newTime) {
#ifdef STM32F1
RTC_SetCounter((uint32_t)(newTime>>JSSYSTIME_SECOND_SHIFT));
#else
RTC_WaitForLastTask();
#else // !STM32F1
RTC_TimeTypeDef time;
RTC_DateTypeDef date;
@ -1473,12 +1474,14 @@ void jshSetSystemTime(JsSysTime newTime) {
RTC_SetTime(RTC_Format_BIN, &time);
RTC_SetDate(RTC_Format_BIN, &date);
#endif
RTC_WaitForSynchro();
#endif // !STM32F1
hasSystemSlept = true;
#else
#else // !USE_RTC
SysTickMajor = newTime;
#endif
#endif // !USE_RTC
jshInterruptOn();
jshGetSystemTime(); // force update of the time
}