Created
September 14, 2019 15:32
-
-
Save MabezDev/122254f1a8f9097b00e107e3729c53a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Feed the WDT watchdog | |
pub fn feed_wdt() { | |
const RTC_WDT_BASE: u32 = 0x3ff48000; | |
const RTC_WDT_WPROTECT: u32 = RTC_WDT_BASE + 0xa4; | |
const RTC_WDT_FEED: u32 = RTC_WDT_BASE + 0xa0; | |
unsafe { | |
core::ptr::write_volatile(RTC_WDT_WPROTECT as *mut _, 0); // disable write protection | |
{ | |
core::ptr::write_volatile(RTC_WDT_FEED as *mut _, 0x1); // feed the watch dog | |
} | |
core::ptr::write_volatile(RTC_WDT_WPROTECT as *mut _, 1); // enable write protection | |
} | |
} |
The reference manual. This was just used for demo purposes a full implementation for all drivers, including TIMG0, can be found in esp-hal.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How did you get the values for the address?