Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DODO�
arduino-esp32
提交
fa74767b
A
arduino-esp32
项目概览
DODO�
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fa74767b
编写于
4月 13, 2019
作者:
M
me-no-dev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow selecting in IDF the running core for Arduino's core tasks
上级
d922557e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
95 addition
and
15 deletion
+95
-15
Kconfig.projbuild
Kconfig.projbuild
+64
-0
cores/esp32/esp32-hal-misc.c
cores/esp32/esp32-hal-misc.c
+18
-0
cores/esp32/esp32-hal.h
cores/esp32/esp32-hal.h
+10
-0
cores/esp32/main.cpp
cores/esp32/main.cpp
+1
-7
libraries/AsyncUDP/src/AsyncUDP.cpp
libraries/AsyncUDP/src/AsyncUDP.cpp
+1
-1
libraries/WiFi/src/WiFiGeneric.cpp
libraries/WiFi/src/WiFiGeneric.cpp
+1
-7
未找到文件。
Kconfig.projbuild
浏览文件 @
fa74767b
...
...
@@ -19,6 +19,70 @@ config AUTOSTART_ARDUINO
If disabled, you can call initArduino() to run any preparations
required by the framework
choice ARDUINO_RUNNING_CORE
bool "Core on which Arduino's setup() and loop() are running"
default ARDUINO_RUN_CORE1
help
Select on which core Arduino's setup() and loop() functions run
config ARDUINO_RUN_CORE0
bool "CORE 0"
config ARDUINO_RUN_CORE1
bool "CORE 1"
config ARDUINO_RUN_NO_AFFINITY
bool "BOTH"
endchoice
config ARDUINO_RUNNING_CORE
int
default 0 if ARDUINO_RUN_CORE0
default 1 if ARDUINO_RUN_CORE1
default -1 if ARDUINO_RUN_NO_AFFINITY
choice ARDUINO_EVENT_RUNNING_CORE
bool "Core on which Arduino's event handler is running"
default ARDUINO_EVENT_RUN_CORE1
help
Select on which core Arduino's WiFi.onEvent() run
config ARDUINO_EVENT_RUN_CORE0
bool "CORE 0"
config ARDUINO_EVENT_RUN_CORE1
bool "CORE 1"
config ARDUINO_EVENT_RUN_NO_AFFINITY
bool "BOTH"
endchoice
config ARDUINO_EVENT_RUNNING_CORE
int
default 0 if ARDUINO_EVENT_RUN_CORE0
default 1 if ARDUINO_EVENT_RUN_CORE1
default -1 if ARDUINO_EVENT_RUN_NO_AFFINITY
choice ARDUINO_UDP_RUNNING_CORE
bool "Core on which Arduino's UDP is running"
default ARDUINO_UDP_RUN_CORE1
help
Select on which core Arduino's UDP run
config ARDUINO_UDP_RUN_CORE0
bool "CORE 0"
config ARDUINO_UDP_RUN_CORE1
bool "CORE 1"
config ARDUINO_UDP_RUN_NO_AFFINITY
bool "BOTH"
endchoice
config ARDUINO_UDP_RUNNING_CORE
int
default 0 if ARDUINO_UDP_RUN_CORE0
default 1 if ARDUINO_UDP_RUN_CORE1
default -1 if ARDUINO_UDP_RUN_NO_AFFINITY
config DISABLE_HAL_LOCKS
bool "Disable mutex locks for HAL"
default "n"
...
...
cores/esp32/esp32-hal-misc.c
浏览文件 @
fa74767b
...
...
@@ -111,6 +111,24 @@ void disableCore1WDT(){
}
#endif
BaseType_t
xTaskCreateUniversal
(
TaskFunction_t
pxTaskCode
,
const
char
*
const
pcName
,
const
uint32_t
usStackDepth
,
void
*
const
pvParameters
,
UBaseType_t
uxPriority
,
TaskHandle_t
*
const
pxCreatedTask
,
const
BaseType_t
xCoreID
){
#ifndef CONFIG_FREERTOS_UNICORE
if
(
xCoreID
>=
0
&&
xCoreID
<
2
)
{
return
xTaskCreatePinnedToCore
(
pxTaskCode
,
pcName
,
usStackDepth
,
pvParameters
,
uxPriority
,
pxCreatedTask
,
xCoreID
);
}
else
{
#endif
return
xTaskCreate
(
pxTaskCode
,
pcName
,
usStackDepth
,
pvParameters
,
uxPriority
,
pxCreatedTask
);
#ifndef CONFIG_FREERTOS_UNICORE
}
#endif
}
unsigned
long
IRAM_ATTR
micros
()
{
return
(
unsigned
long
)
(
esp_timer_get_time
());
...
...
cores/esp32/esp32-hal.h
浏览文件 @
fa74767b
...
...
@@ -90,6 +90,16 @@ void enableCore1WDT();
void
disableCore1WDT
();
#endif
//if xCoreID < 0 or CPU is unicore, it will use xTaskCreate, else xTaskCreatePinnedToCore
//allows to easily handle all possible situations without repetitive code
BaseType_t
xTaskCreateUniversal
(
TaskFunction_t
pxTaskCode
,
const
char
*
const
pcName
,
const
uint32_t
usStackDepth
,
void
*
const
pvParameters
,
UBaseType_t
uxPriority
,
TaskHandle_t
*
const
pxCreatedTask
,
const
BaseType_t
xCoreID
);
unsigned
long
micros
();
unsigned
long
millis
();
void
delay
(
uint32_t
);
...
...
cores/esp32/main.cpp
浏览文件 @
fa74767b
...
...
@@ -7,12 +7,6 @@ TaskHandle_t loopTaskHandle = NULL;
#if CONFIG_AUTOSTART_ARDUINO
#if CONFIG_FREERTOS_UNICORE
#define ARDUINO_RUNNING_CORE 0
#else
#define ARDUINO_RUNNING_CORE 1
#endif
bool
loopTaskWDTEnabled
;
void
loopTask
(
void
*
pvParameters
)
...
...
@@ -30,7 +24,7 @@ extern "C" void app_main()
{
loopTaskWDTEnabled
=
false
;
initArduino
();
xTaskCreate
PinnedToCore
(
loopTask
,
"loopTask"
,
8192
,
NULL
,
1
,
&
loopTaskHandle
,
ARDUINO_RUNNING_CORE
);
xTaskCreate
Universal
(
loopTask
,
"loopTask"
,
8192
,
NULL
,
1
,
&
loopTaskHandle
,
CONFIG_
ARDUINO_RUNNING_CORE
);
}
#endif
libraries/AsyncUDP/src/AsyncUDP.cpp
浏览文件 @
fa74767b
...
...
@@ -150,7 +150,7 @@ static bool _udp_task_start(){
}
}
if
(
!
_udp_task_handle
){
xTaskCreate
(
_udp_task
,
"async_udp"
,
4096
,
NULL
,
3
,
(
TaskHandle_t
*
)
&
_udp_task_handle
);
xTaskCreate
Universal
(
_udp_task
,
"async_udp"
,
4096
,
NULL
,
3
,
(
TaskHandle_t
*
)
&
_udp_task_handle
,
CONFIG_ARDUINO_UDP_RUNNING_CORE
);
if
(
!
_udp_task_handle
){
return
false
;
}
...
...
libraries/WiFi/src/WiFiGeneric.cpp
浏览文件 @
fa74767b
...
...
@@ -50,12 +50,6 @@ extern "C" {
#include "sdkconfig.h"
#if CONFIG_FREERTOS_UNICORE
#define ARDUINO_RUNNING_CORE 0
#else
#define ARDUINO_RUNNING_CORE 1
#endif
static
xQueueHandle
_network_event_queue
;
static
TaskHandle_t
_network_event_task_handle
=
NULL
;
static
EventGroupHandle_t
_network_event_group
=
NULL
;
...
...
@@ -96,7 +90,7 @@ static bool _start_network_event_task(){
}
}
if
(
!
_network_event_task_handle
){
xTaskCreate
PinnedToCore
(
_network_event_task
,
"network_event"
,
4096
,
NULL
,
ESP_TASKD_EVENT_PRIO
-
1
,
&
_network_event_task_handle
,
ARDUINO
_RUNNING_CORE
);
xTaskCreate
Universal
(
_network_event_task
,
"network_event"
,
4096
,
NULL
,
ESP_TASKD_EVENT_PRIO
-
1
,
&
_network_event_task_handle
,
CONFIG_ARDUINO_EVENT
_RUNNING_CORE
);
if
(
!
_network_event_task_handle
){
log_e
(
"Network Event Task Start Failed!"
);
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录