Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
81844f53
Commit
81844f53
authored
Jan 12, 2019
by
me-no-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API to feed the loop WDT (call from loop only)
parent
f7cf583b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
cores/esp32/esp32-hal-cpu.c
cores/esp32/esp32-hal-cpu.c
+0
-2
cores/esp32/esp32-hal-misc.c
cores/esp32/esp32-hal-misc.c
+7
-0
cores/esp32/esp32-hal.h
cores/esp32/esp32-hal.h
+2
-0
No files found.
cores/esp32/esp32-hal-cpu.c
View file @
81844f53
...
...
@@ -131,10 +131,8 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){
uint32_t
capb
,
apb
;
//Get XTAL Frequency and calculate min CPU MHz
rtc_xtal_freq_t
xtal
=
rtc_clk_xtal_freq_get
();
uint32_t
min_cpu_mhz
=
10
;
if
(
xtal
>
RTC_XTAL_FREQ_AUTO
){
if
(
xtal
<
RTC_XTAL_FREQ_40M
)
{
min_cpu_mhz
=
xtal
/
2
;
//13Mhz for 26Mhz XTAL
if
(
cpu_freq_mhz
<=
xtal
&&
cpu_freq_mhz
!=
xtal
&&
cpu_freq_mhz
!=
(
xtal
/
2
)){
log_e
(
"Bad frequency: %u MHz! Options are: 240, 160, 80, %u and %u MHz"
,
cpu_freq_mhz
,
xtal
,
xtal
/
2
);
return
false
;
...
...
cores/esp32/esp32-hal-misc.c
View file @
81844f53
...
...
@@ -69,6 +69,13 @@ void disableLoopWDT(){
}
}
}
void
feedLoopWDT
(){
esp_err_t
err
=
esp_task_wdt_reset
();
if
(
err
!=
ESP_OK
){
log_e
(
"Failed to feed WDT! Error: %d"
,
err
);
}
}
#endif
void
enableCore0WDT
(){
...
...
cores/esp32/esp32-hal.h
View file @
81844f53
...
...
@@ -77,6 +77,8 @@ float temperatureRead();
//enable/disable WDT for Arduino's setup and loop functions
void
enableLoopWDT
();
void
disableLoopWDT
();
//feed WDT for the loop task
void
feedLoopWDT
();
#endif
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment