Skip to content

Commit 5f49e3c

Browse files
committed
1 parent f10f928 commit 5f49e3c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/eez/modules/psu/datetime.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,15 @@ bool test() {
186186
g_testResult = TEST_FAILED;
187187
DebugTrace("RTC test failed, invalid time format detected (%02d:%02d:%02d)\n",
188188
(int)rtc_hour, (int)rtc_minute, (int)rtc_second);
189-
} else if (cmp_datetime(year, month, day, hour, minute, second,
190-
rtc_year, rtc_month, rtc_day, rtc_hour, rtc_minute, rtc_second) < 0) {
189+
} else if (cmp_datetime(year, month, day, hour, minute, second, rtc_year, rtc_month, rtc_day, rtc_hour, rtc_minute, rtc_second) <= 0) {
191190
g_testResult = TEST_OK;
192191
if (!dstCheck()) {
193192
persist_conf::writeSystemDateTime(rtc_year, rtc_month, rtc_day, rtc_hour,
194193
rtc_minute, rtc_second, 2);
195194
}
196195
} else {
197196
g_testResult = TEST_FAILED;
198-
DebugTrace("RTC test failed, RTC time (%d-%02d-%02d %02d:%02d:%02d) older then or "
199-
"equal to EEPROM time (%d-%02d-%02d %02d:%02d:%02d)\n",
197+
DebugTrace("RTC test failed, RTC time (%d-%02d-%02d %02d:%02d:%02d) older then EEPROM time (%d-%02d-%02d %02d:%02d:%02d)\n",
200198
(int)(2000 + rtc_year), (int)rtc_month, (int)rtc_day, (int)rtc_hour, (int)rtc_minute, (int)rtc_second,
201199
(int)(2000 + year), (int)month, (int)day, (int)hour, (int)minute, (int)second);
202200
}

src/eez/modules/psu/io_pins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void updatePwmFrequency(int pin) {
236236

237237
updatePwmDuty(pin);
238238

239-
if (frequency > 0) {
239+
if (isPowerUp() && frequency > 0) {
240240
if (!m_gPwmStarted) {
241241
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2);
242242
m_gPwmStarted = true;

src/eez/modules/psu/psu.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ bool powerUp() {
531531

532532
g_bootTestSuccess &= testSuccess;
533533

534+
io_pins::refresh();
535+
534536
return true;
535537
}
536538

@@ -572,6 +574,7 @@ void powerDown() {
572574
event_queue::pushEvent(event_queue::EVENT_INFO_POWER_DOWN);
573575

574576
io_pins::tick(micros());
577+
io_pins::refresh();
575578

576579
sound::playPowerDown();
577580
}

0 commit comments

Comments
 (0)