diff --git a/examples/chapter11_07a/src/app/pi_calc_cfg.h b/examples/chapter11_07a/src/app/pi_calc_cfg.h index a9d2ed416..79e7faa44 100644 --- a/examples/chapter11_07a/src/app/pi_calc_cfg.h +++ b/examples/chapter11_07a/src/app/pi_calc_cfg.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Copyright Christopher Kormanyos 2023 - 2025. +// Copyright Christopher Kormanyos 2023 - 2026. // Distributed under the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/ref_app/target/micros/xtensa_esp32_p4/startup/Code/Appli/main_cores.cpp b/ref_app/target/micros/xtensa_esp32_p4/startup/Code/Appli/main_cores.cpp index 03e5dbafb..5b76879d9 100644 --- a/ref_app/target/micros/xtensa_esp32_p4/startup/Code/Appli/main_cores.cpp +++ b/ref_app/target/micros/xtensa_esp32_p4/startup/Code/Appli/main_cores.cpp @@ -22,8 +22,6 @@ extern "C" auto main_core1() -> void; } -auto main(void) -> int __attribute__((used,noinline)); - namespace local { struct timer_core1_backend @@ -32,16 +30,6 @@ namespace local static auto get_now() -> tick_type { return static_cast(mcal::gpt::secure::get_time_elapsed_core1()); } }; - - using timer_type = util::timer; - - constexpr typename timer_type::tick_type - led_timeout - { - static_cast(timer_type::seconds(UINT8_C(1))) - }; - - using timer_core1_type = util::timer; } // namespace local extern "C" @@ -63,20 +51,30 @@ auto main_core1() -> void mcal::gpt::init(nullptr); - local::timer_core1_type local_led_timer(local::led_timeout); + using timer_core1_type = util::timer; + + constexpr typename timer_core1_type::tick_type + led_core1_timeout + { + static_cast(timer_core1_type::seconds(UINT8_C(1))) + }; + + timer_core1_type led_core1_timer(led_core1_timeout); + + auto& my_led1_core1_ref { mcal::led::led1() }; - auto& my_led1_ref { mcal::led::led1() }; + my_led1_core1_ref.toggle(); - my_led1_ref.toggle(); + // Enter an endless LED1 toggle-loop. + // Never return or break. - // Endless LED1 togglee-loop: Never return or break. for(;;) { - if(local_led_timer.timeout()) + if(led_core1_timer.timeout()) { - my_led1_ref.toggle(); + my_led1_core1_ref.toggle(); - local_led_timer.start_interval(local::led_timeout); + led_core1_timer.start_interval(led_core1_timeout); } } }