File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed
components/freertos/port/esp8266 Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -125,17 +125,35 @@ static void panic_frame(panic_frame_t *frame)
125
125
#endif /* ESP_PANIC_PRINT */
126
126
127
127
#ifdef ESP_PANIC_REBOOT
128
+ static void hardware_restart (void )
129
+ {
130
+ CLEAR_WDT_REG_MASK (WDT_CTL_ADDRESS , BIT0 );
131
+ WDT_REG_WRITE (WDT_OP_ADDRESS , 1 );
132
+ WDT_REG_WRITE (WDT_OP_ND_ADDRESS , 1 );
133
+ SET_PERI_REG_BITS (PERIPHS_WDT_BASEADDR + WDT_CTL_ADDRESS ,
134
+ WDT_CTL_RSTLEN_MASK ,
135
+ 7 << WDT_CTL_RSTLEN_LSB ,
136
+ 0 );
137
+ SET_PERI_REG_BITS (PERIPHS_WDT_BASEADDR + WDT_CTL_ADDRESS ,
138
+ WDT_CTL_RSPMOD_MASK ,
139
+ 0 << WDT_CTL_RSPMOD_LSB ,
140
+ 0 );
141
+ SET_PERI_REG_BITS (PERIPHS_WDT_BASEADDR + WDT_CTL_ADDRESS ,
142
+ WDT_CTL_EN_MASK ,
143
+ 1 << WDT_CTL_EN_LSB ,
144
+ 0 );
145
+ }
146
+
128
147
static void esp_panic_reset (void )
129
148
{
130
149
uart_tx_wait_idle (0 );
131
- uart_tx_wait_idle (1 );
132
-
133
- rom_i2c_writeReg (0x67 , 4 , 1 , 0x08 );
134
- rom_i2c_writeReg (0x67 , 4 , 2 , 0x81 );
150
+ uart_tx_wait_idle (1 );
135
151
136
152
esp_reset_reason_set_hint (ESP_RST_PANIC );
137
153
138
- rom_software_reboot ();
154
+ hardware_restart ();
155
+
156
+ while (1 );
139
157
}
140
158
#endif
141
159
You can’t perform that action at this time.
0 commit comments