Skip to content

Commit 1ac66ba

Browse files
committed
chore: Update CI to target esp-idf 5.5 and simplify main code
1 parent 16bda39 commit 1ac66ba

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Build main
1515
uses: espressif/esp-idf-ci-action@v1
1616
with:
17-
esp_idf_version: release-v5.4
17+
esp_idf_version: release-v5.5
1818
path: '.'
1919
# TODO: set the target here to be the chip you are building for
2020
# target: esp32s3

.github/workflows/package_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Build Main Code
2424
uses: espressif/esp-idf-ci-action@v1
2525
with:
26-
esp_idf_version: release-v5.4
26+
esp_idf_version: release-v5.5
2727
path: '.'
2828
command: 'idf.py build'
2929
# TODO: set the target here to be the chip you are building for

main/main.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,17 @@
77
using namespace std::chrono_literals;
88

99
extern "C" void app_main(void) {
10-
static auto start = std::chrono::high_resolution_clock::now();
11-
static auto elapsed = [&]() {
12-
auto now = std::chrono::high_resolution_clock::now();
13-
return std::chrono::duration<float>(now - start).count();
14-
};
15-
1610
espp::Logger logger({.tag = "Template", .level = espp::Logger::Verbosity::DEBUG});
1711

1812
logger.info("Bootup");
1913

14+
// counter to show the number of prints, shared between main and task
15+
std::atomic<int> counter = 0;
16+
2017
// make a simple task that prints "Hello World!" every second
2118
espp::Task task({
2219
.callback = [&](auto &m, auto &cv) -> bool {
23-
logger.debug("[{:.3f}] Hello from the task!", elapsed());
20+
logger.debug("[{}] Hello from the task!", counter++);
2421
std::unique_lock<std::mutex> lock(m);
2522
cv.wait_for(lock, 1s);
2623
// we don't want to stop the task, so return false
@@ -35,7 +32,7 @@ extern "C" void app_main(void) {
3532

3633
// also print in the main thread
3734
while (true) {
38-
logger.debug("[{:.3f}] Hello World!", elapsed());
35+
logger.debug("[{}] Hello World!", counter++);
3936
std::this_thread::sleep_for(1s);
4037
}
4138
}

sdkconfig.defaults

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@
1818
#
1919
# CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
2020
# CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
21-
22-
# TODO: uncomment if you want to enable exceptions (which may be needed by certain components such as cli)
23-
# CONFIG_COMPILER_CXX_EXCEPTIONS=y

0 commit comments

Comments
 (0)