File tree Expand file tree Collapse file tree 4 files changed +7
-13
lines changed
Expand file tree Collapse file tree 4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 77using namespace std ::chrono_literals;
88
99extern " 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}
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments