sam3x8e: Fix watchdog timeout calculation

Fix error causing the watchdog to be set to an ~4ms timeout instead of
500ms.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-08-07 23:47:34 -04:00
parent e12527b895
commit 88a10fb31c
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ DECL_TASK(watchdog_reset);
void
watchdog_init(void)
{
uint32_t timeout = 32768 / 2; // 500ms timeout
uint32_t timeout = 500 * 32768 / 128 / 1000; // 500ms timeout
WDT->WDT_MR = WDT_MR_WDRSTEN | WDT_MR_WDV(timeout) | WDT_MR_WDD(timeout);
}
DECL_INIT(watchdog_init);