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
28ea39cf
Commit
28ea39cf
authored
Dec 28, 2018
by
me-no-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add WDT API for Core 0 and disable it while SPIFFS is formatting
parent
f49c854f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
5 deletions
+29
-5
cores/esp32/esp32-hal-misc.c
cores/esp32/esp32-hal-misc.c
+15
-1
cores/esp32/esp32-hal.h
cores/esp32/esp32-hal.h
+5
-2
libraries/SPIFFS/src/SPIFFS.cpp
libraries/SPIFFS/src/SPIFFS.cpp
+9
-2
No files found.
cores/esp32/esp32-hal-misc.c
View file @
28ea39cf
...
...
@@ -70,7 +70,21 @@ void disableLoopWDT(){
}
#endif
#ifndef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1
void
enableCore0WDT
(){
TaskHandle_t
idle_0
=
xTaskGetIdleTaskHandleForCPU
(
0
);
if
(
idle_0
==
NULL
||
esp_task_wdt_add
(
idle_0
)
!=
ESP_OK
){
log_e
(
"Failed to add Core 0 IDLE task to WDT"
);
}
}
void
disableCore0WDT
(){
TaskHandle_t
idle_0
=
xTaskGetIdleTaskHandleForCPU
(
0
);
if
(
idle_0
==
NULL
||
esp_task_wdt_delete
(
idle_0
)
!=
ESP_OK
){
log_e
(
"Failed to remove Core 0 IDLE task from WDT"
);
}
}
#ifndef CONFIG_FREERTOS_UNICORE
void
enableCore1WDT
(){
TaskHandle_t
idle_1
=
xTaskGetIdleTaskHandleForCPU
(
1
);
if
(
idle_1
==
NULL
||
esp_task_wdt_add
(
idle_1
)
!=
ESP_OK
){
...
...
cores/esp32/esp32-hal.h
View file @
28ea39cf
...
...
@@ -78,8 +78,11 @@ void enableLoopWDT();
void
disableLoopWDT
();
#endif
#ifndef CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1
//enable/disable WDT for the IDLE task on Core 1
//enable/disable WDT for the IDLE task on Core 0 (SYSTEM)
void
enableCore0WDT
();
void
disableCore0WDT
();
#ifndef CONFIG_FREERTOS_UNICORE
//enable/disable WDT for the IDLE task on Core 1 (Arduino)
void
enableCore1WDT
();
void
disableCore1WDT
();
#endif
...
...
libraries/SPIFFS/src/SPIFFS.cpp
View file @
28ea39cf
...
...
@@ -39,11 +39,16 @@ bool SPIFFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFi
.
base_path
=
basePath
,
.
partition_label
=
NULL
,
.
max_files
=
maxOpenFiles
,
.
format_if_mount_failed
=
f
ormatOnFail
.
format_if_mount_failed
=
f
alse
};
esp_err_t
err
=
esp_vfs_spiffs_register
(
&
conf
);
if
(
err
){
if
(
err
==
ESP_FAIL
&&
formatOnFail
){
if
(
format
()){
err
=
esp_vfs_spiffs_register
(
&
conf
);
}
}
if
(
err
!=
ESP_OK
){
log_e
(
"Mounting SPIFFS failed! Error: %d"
,
err
);
return
false
;
}
...
...
@@ -65,7 +70,9 @@ void SPIFFSFS::end()
bool
SPIFFSFS
::
format
()
{
disableCore0WDT
();
esp_err_t
err
=
esp_spiffs_format
(
NULL
);
enableCore0WDT
();
if
(
err
){
log_e
(
"Formatting SPIFFS failed! Error: %d"
,
err
);
return
false
;
...
...
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