Merge pull request #5549 from jepler/samd-watchdog-rounding

atmel-samd: Fix converting watchdog seconds to cycles
This commit is contained in:
Dan Halbert 2021-11-05 14:39:59 -04:00 committed by GitHub
commit 49207fba2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,7 @@ void setup_wdt(watchdog_watchdogtimer_obj_t *self, int setting) {
}
void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t new_timeout) {
int wdt_cycles = (int)(new_timeout * 1000);
int wdt_cycles = (int)(new_timeout * 1024);
if (wdt_cycles < 8) {
wdt_cycles = 8;
}