Skip to content

Commit 504c51f

Browse files
committed
Fix STM32 benchmark endless loop after 1 hour
If the STM32 has an RTC, this is used to time the execution of each benchmark item. It was only multiplying hours by 24 to get seconds, so after one hour the amount of seconds went to less than 3600. Therefore the benchmark thought negative time elapsed and would never end.
1 parent 4ca5c31 commit 504c51f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

IDE/STM32Cube/wolfssl_example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ double current_time(void)
18301830
(void) date;
18311831

18321832
/* return seconds.milliseconds */
1833-
return ((double) time.Hours * 24) + ((double) time.Minutes * 60)
1833+
return ((double) time.Hours * 3600) + ((double) time.Minutes * 60)
18341834
+ (double) time.Seconds + ((double) subsec / 1000);
18351835
}
18361836
#endif /* HAL_RTC_MODULE_ENABLED */

0 commit comments

Comments
 (0)