File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 10871087 <ClCompile Include =" target\micros\am335x\startup\crt1.cpp" />
10881088 <ClCompile Include =" target\micros\am335x\startup\int_vect.cpp" />
10891089 <ClCompile Include =" target\micros\am6254_soc\Code\Appli\Core\a53\main.c" />
1090- <ClCompile Include =" target\micros\am6254_soc\Code\Appli\Core\a53\main_core0 .cpp" />
1090+ <ClCompile Include =" target\micros\am6254_soc\Code\Appli\Core\a53\main_cores .cpp" />
10911091 <ClCompile Include =" target\micros\am6254_soc\Code\Mcal\SysTickTimer\SysTickTimer.c" />
10921092 <ClCompile Include =" target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c" />
10931093 <ClCompile Include =" target\micros\am6254_soc\Code\Std\StdLib.c" />
Original file line number Diff line number Diff line change 10851085 <ClCompile Include =" target\micros\am6254_soc\Code\Startup\Core\a53\Startup.c" >
10861086 <Filter >micros\am6254_soc\Code\Startup\Core\a53</Filter >
10871087 </ClCompile >
1088- <ClCompile Include =" target\micros\am6254_soc\Code\Appli\Core\a53\main_core0 .cpp" >
1088+ <ClCompile Include =" target\micros\am6254_soc\Code\Appli\Core\a53\main_cores .cpp" >
10891089 <Filter >micros\am6254_soc\Code\Appli\Core\a53</Filter >
10901090 </ClCompile >
10911091 </ItemGroup >
Original file line number Diff line number Diff line change 1414void timer_isr (void );
1515
1616extern uint32_t GetActiveCoreId (void );
17+
1718extern void main_core0 (void );
19+ extern void main_core1 (void );
20+ extern void main_core2 (void );
21+ extern void main_core3 (void );
1822
1923#if defined(__GNUC__ )
2024__attribute__((used ,noinline ))
@@ -88,16 +92,10 @@ void main(void)
8892 // Move the core initialization functions into main_init().
8993 main_init (ActiveCore );
9094
91- if (ActiveCore == UINT32_C (0 ))
92- {
93- // TBD: Run my cooperative scheduler, and replace the while-loop.
94- main_core0 ();
95- //while(1) { (void) mcal_gpt_get_time_elapsed(); }
96- }
97- else
98- {
99- while (1 ) { ; }
100- }
95+ if (ActiveCore == UINT32_C (0 )) { main_core0 (); } // TBD: Run the normal ref_app coop-scheduler in core0.
96+ else if (ActiveCore == UINT32_C (1 )) { main_core1 (); }
97+ else if (ActiveCore == UINT32_C (2 )) { main_core2 (); }
98+ else if (ActiveCore == UINT32_C (3 )) { main_core3 (); }
10199}
102100
103101//----------------------------------------------------------------------------------------
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // /////////////////////////////////////////////////////////////////////////////
2+ // Copyright Christopher Kormanyos 2025.
3+ // Distributed under the Boost Software License,
4+ // Version 1.0. (See accompanying file LICENSE_1_0.txt
5+ // or copy at http://www.boost.org/LICENSE_1_0.txt)
6+ //
7+
8+ #include < core_macros.h>
9+ #include < my_led.h>
10+
11+ #include < util/utility/util_time.h>
12+
13+ #include < cstdint>
14+
15+ extern " C" void main_core0 (void );
16+ extern " C" void main_core1 (void );
17+ extern " C" void main_core2 (void );
18+ extern " C" void main_core3 (void );
19+
20+ template <const int LED_ID>
21+ void main_core_worker (void )
22+ {
23+ using timer_type = util::timer<std::uint64_t >;
24+
25+ using led_type = my_led<LED_ID>;
26+
27+ led_type led;
28+
29+ timer_type led_timer (timer_type::seconds (1U ));
30+
31+ led.toggle ();
32+
33+ for (;;)
34+ {
35+ while (!led_timer.timeout ()) { asm volatile (" nop" ); }
36+
37+ led.toggle ();
38+
39+ led_timer.start_interval (timer_type::seconds (1U ));
40+ }
41+ }
42+
43+ extern " C" void main_core0 (void ) { main_core_worker<LED_1>(); }
44+ extern " C" void main_core1 (void ) { main_core_worker<LED_2>(); }
45+ extern " C" void main_core2 (void ) { main_core_worker<LED_3>(); }
46+ extern " C" void main_core3 (void ) { main_core_worker<LED_4>(); }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ FILES_CPP :=
1414FILES_TGT = $(PATH_APP)/mcal/mcal_gcc_cxx_completion \
1515 $(PATH_APP)/mcal/$(TGT)/mcal_gpt \
1616 $(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY)/main \
17- $(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY)/main_core0 \
17+ $(PATH_TGT)/Code/Appli/Core/$(CORE_FAMILY)/main_cores \
1818 $(PATH_TGT)/Code/Startup/Core/$(CORE_FAMILY)/Startup \
1919 $(PATH_TGT)/Code/Std/StdLib
2020
You can’t perform that action at this time.
0 commit comments