Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of GA-Test_copy by
Watchdog/Watchdog.cpp
- Committer:
- aungriah
- Date:
- 2017-12-06
- Revision:
- 0:a3b83d366423
File content as of revision 0:a3b83d366423:
#include "Watchdog.h" Watchdog::Watchdog() { } // Load timeout value in watchdog timer and enable void Watchdog::kick(float s) { uint32_t clk = SystemCoreClock / 3; // found by trying. TODO: exakt values hiwdg.Instance = IWDG; hiwdg.Init.Prescaler = IWDG_PRESCALER_16; hiwdg.Init.Reload = s * (float)clk; if (HAL_IWDG_Init(&hiwdg) != HAL_OK) { // Error Handler } } // "kick" or "feed" the dog - reset the watchdog timer // by writing this required bit pattern void Watchdog::kick() { HAL_IWDG_Refresh(&hiwdg); }