@@ -25,21 +25,21 @@ static struct wdt_esp32_data shared_data;
25
25
*/
26
26
static inline void wdt_esp32_seal (void )
27
27
{
28
- volatile u32_t * reg = (u32_t * )TIMG_WDTWPROTECT_REG (0 );
28
+ volatile u32_t * reg = (u32_t * )TIMG_WDTWPROTECT_REG (1 );
29
29
30
30
* reg = 0 ;
31
31
}
32
32
33
33
static inline void wdt_esp32_unseal (void )
34
34
{
35
- volatile u32_t * reg = (u32_t * )TIMG_WDTWPROTECT_REG (0 );
35
+ volatile u32_t * reg = (u32_t * )TIMG_WDTWPROTECT_REG (1 );
36
36
37
37
* reg = TIMG_WDT_WKEY_VALUE ;
38
38
}
39
39
40
40
static void wdt_esp32_enable (struct device * dev )
41
41
{
42
- volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (0 );
42
+ volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (1 );
43
43
44
44
ARG_UNUSED (dev );
45
45
@@ -50,7 +50,7 @@ static void wdt_esp32_enable(struct device *dev)
50
50
51
51
static void wdt_esp32_disable (struct device * dev )
52
52
{
53
- volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (0 );
53
+ volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (1 );
54
54
55
55
ARG_UNUSED (dev );
56
56
@@ -88,7 +88,7 @@ static void adjust_timeout(u32_t timeout)
88
88
/* MWDT ticks every 12.5ns. Set the prescaler to 40000, so the
89
89
* counter for each watchdog stage is decremented every 0.5ms.
90
90
*/
91
- reg = (u32_t * )TIMG_WDTCONFIG1_REG (0 );
91
+ reg = (u32_t * )TIMG_WDTCONFIG1_REG (1 );
92
92
* reg = 40000 ;
93
93
94
94
ticks = 1 <<(cycles + 2 );
@@ -100,18 +100,18 @@ static void adjust_timeout(u32_t timeout)
100
100
*/
101
101
ticks += (1 <<cycles ) / 10 ;
102
102
103
- reg = (u32_t * )TIMG_WDTCONFIG2_REG (0 );
103
+ reg = (u32_t * )TIMG_WDTCONFIG2_REG (1 );
104
104
* reg = ticks ;
105
105
106
- reg = (u32_t * )TIMG_WDTCONFIG3_REG (0 );
106
+ reg = (u32_t * )TIMG_WDTCONFIG3_REG (1 );
107
107
* reg = ticks ;
108
108
}
109
109
110
110
static void wdt_esp32_isr (void * param );
111
111
112
112
static void wdt_esp32_reload (struct device * dev )
113
113
{
114
- volatile u32_t * reg = (u32_t * )TIMG_WDTFEED_REG (0 );
114
+ volatile u32_t * reg = (u32_t * )TIMG_WDTFEED_REG (1 );
115
115
116
116
ARG_UNUSED (dev );
117
117
@@ -122,7 +122,7 @@ static void wdt_esp32_reload(struct device *dev)
122
122
123
123
static void set_interrupt_enabled (bool setting )
124
124
{
125
- volatile u32_t * intr_enable_reg = (u32_t * )TIMG_INT_ENA_TIMERS_REG (0 );
125
+ volatile u32_t * intr_enable_reg = (u32_t * )TIMG_INT_ENA_TIMERS_REG (1 );
126
126
127
127
wdt_esp32_unseal ();
128
128
if (setting ) {
@@ -141,7 +141,7 @@ static void set_interrupt_enabled(bool setting)
141
141
static int wdt_esp32_set_config (struct device * dev , struct wdt_config * config )
142
142
{
143
143
struct wdt_esp32_data * data = dev -> driver_data ;
144
- volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (0 );
144
+ volatile u32_t * reg = (u32_t * )TIMG_WDTCONFIG0_REG (1 );
145
145
u32_t v ;
146
146
147
147
if (!config ) {
0 commit comments