Skip to content

Instantly share code, notes, and snippets.

@boarchuz
boarchuz / esp_rtc_reset.c
Last active January 19, 2022 17:40
ESP32 RTC Reset
#include "soc/rtc_cntl_struct.h"
#include "hal/wdt_types.h"
#include "hal/rwdt_ll.h"
void __attribute__((noreturn)) esp_rtc_reset(void)
{
rwdt_ll_write_protect_disable(&RTCCNTL);
rwdt_ll_disable(&RTCCNTL);
rwdt_ll_config_stage(&RTCCNTL, WDT_STAGE0, 0, WDT_STAGE_ACTION_RESET_RTC);
rwdt_ll_disable_stage(&RTCCNTL, WDT_STAGE1);
@boarchuz
boarchuz / main.c
Created September 9, 2020 19:50
ESP32 Deep Sleep Interrupt Detect Without Wake
#include "esp_system.h"
#include "esp_sleep.h"
#include "esp_log.h"
#include "driver/rtc_io.h"
#include "soc/rtc_io_struct.h"
static const char *TAG = "INT_DETECT";
#define INT_PIN GPIO_NUM_0