Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build_platformio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,33 @@ jobs:
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}

build-for-esp32-singlecore:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
container: ghcr.io/bertmelis/pio-test-container
strategy:
matrix:
example: [
examples/notask-esp32/notask-esp32.ino,
examples/simple-esp32/simple-esp32.ino,
examples/simpleAsync-esp32/simpleAsync-esp32.ino,
examples/tls-esp32/tls-esp32.ino
]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Download external libraries
run: pio pkg install --global --library ESP32Async/AsyncTCP
- name: Build PlatformIO examples
run: pio ci --lib="." --board=lolin_c3_mini
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}

build-for-linux:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
Expand Down
11 changes: 10 additions & 1 deletion src/MqttClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ MqttClient::MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint
_xSemaphore = xSemaphoreCreateMutex();
EMC_SEMAPHORE_GIVE(); // release before first use
if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) {
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
#ifdef CONFIG_FREERTOS_UNICORE
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
(void) core;
#else
if (core >= 0 && core < 2) {
xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core);
} else {
xTaskCreate((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle);
}
#endif
}
#else
(void) useInternalTask;
Expand Down