Beispiel #1
0
void ICACHE_FLASH_ATTR system_soft_wdt_restart(void)
{
	wDev_MacTim1SetFunc(pp_soft_wdt_feed_local);
	wDev_MacTim1Arm(soft_wdt_interval);
	wdt_flg = false;
	WDT_FEED = WDT_FEED_MAGIC;
}
Beispiel #2
0
void pp_soft_wdt_feed_local()
{
	struct rst_info rst_info;
	rst_info.exccause = RSR(EXCCAUSE);
	rst_info.epc1 = RSR(EPC1);
	rst_info.epc2 = RSR(EPC2);
	rst_info.epc3 = RSR(EPC3);
	rst_info.excvaddr = RSR(EXCVADDR);
	rst_info.depc = RSR(DEPC);
	if(wdt_flg == true) {
		rst_info.reason = REASON_SOFT_WDT_RST; // =3
		system_rtc_mem_write(0, &rst_info, sizeof(rst_info));
		ets_intr_lock();
		Wait_SPI_Idle(flashchip);
		Cache_Read_Enable_New();
		system_restart_local();
	}
	else {
		rst_info.reason = REASON_WDT_RST; // =1
		system_rtc_mem_write(0, &rst_info, sizeof(rst_info));
#if DEF_SDK_VERSION >= 1119
		wDev_MacTim1Arm(soft_wdt_interval);
#else
		ets_timer_disarm(SoftWdtTimer);
		ets_timer_arm_new(SoftWdtTimer, soft_wdt_interval, 0, 1);
#endif
		wdt_flg = true;
		pp_post(12);
	}
}
Beispiel #3
0
void pp_soft_wdt_feed()
{
	struct rst_info rst_info;
	rst_info.exccause = RSR(EXCCAUSE);
	rst_info.epc1 = RSR(EPC1);
	rst_info.epc2 = RSR(EPC2);
	rst_info.epc3 = RSR(EPC3);
	rst_info.excvaddr = RSR(EXCVADDR);
	rst_info.depc = RSR(DEPC);
	rst_info.reason = WDT_RST_FLAG;
	system_rtc_mem_write(0, &rst_info, sizeof(rst_info));
	if(wdt_flg == true) {
		Cache_Read_Disable();
		Cache_Read_Enable_New();
		system_restart_local();
	}
	else {
#if SDK_VERSION >= 1119
		wDev_MacTim1Arm(soft_wdt_interval);
#else
		ets_timer_disarm(SoftWdtTimer);
		ets_timer_arm_new(SoftWdtTimer, soft_wdt_interval, 0, 1);
#endif
		wdt_flg = true;
		pp_post(12);
	}
}
Beispiel #4
0
void pp_soft_wdt_restart(void)
{
#if DEF_SDK_VERSION >= 1119
	wDev_MacTim1SetFunc(pp_soft_wdt_feed);
	wDev_MacTim1Arm(soft_wdt_interval);
	WDT_FEED = WDT_FEED_MAGIC;
#else
	// ret.n
#endif
}
Beispiel #5
0
void pp_soft_wdt_stop(void)
{
#if DEF_SDK_VERSION >= 1119
	WDT_FEED = WDT_FEED_MAGIC;
	wdt_flg = false;
	wDev_MacTim1Arm(70000000);
#else
	// ret.n
#endif
}
Beispiel #6
0
void ICACHE_FLASH_ATTR pp_soft_wdt_init(void)
{
#if DEF_SDK_VERSION < 1109 // (SDK 1.1.0 no patch)
	ets_timer_setfn(SoftWdtTimer, (ETSTimerFunc *)pp_soft_wdt_feed, NULL);
	ets_timer_arm_new(SoftWdtTimer, soft_wdt_interval, 0, 1);
#elif DEF_SDK_VERSION >= 1119
	wDev_MacTim1SetFunc(pp_soft_wdt_feed_local);
	wDev_MacTim1Arm(soft_wdt_interval);
#endif
}
Beispiel #7
0
void ICACHE_FLASH_ATTR system_soft_wdt_stop(void)
{
	WDT_FEED = WDT_FEED_MAGIC;
	wdt_flg = false;
	wDev_MacTim1Arm(70000000);
}
Beispiel #8
0
void ICACHE_FLASH_ATTR PPWdtReset(void)
{
	WDT_FEED = WDT_FEED_MAGIC;
	wDev_MacTim1Arm(soft_wdt_interval);
}
Beispiel #9
0
void PPWdtReset(void)
{
	WDT_FEED = WDT_FEED_MAGIC;
	wDev_MacTim1Arm(soft_wdt_interval);
}