Skip to content

Commit

Permalink
Merge pull request #414 from facchinm/freertos_hook_move
Browse files Browse the repository at this point in the history
Allow FreeRTOS hook for C33 only and improve its reliability
  • Loading branch information
facchinm authored Dec 12, 2024
2 parents 95113d2 + b83fd20 commit 51b909d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ portenta_c33.build.fpu=-mfpu=fpv5-sp-d16
portenta_c33.build.float-abi=-mfloat-abi=hard

portenta_c33.build.board=PORTENTA_C33
portenta_c33.build.defines=-DF_CPU=200000000
portenta_c33.build.defines=-DF_CPU=200000000 -DPROVIDE_FREERTOS_HOOK
portenta_c33.vid.0=0x2341
portenta_c33.pid.0=0x0068
portenta_c33.vid.1=0x2341
Expand Down
4 changes: 3 additions & 1 deletion cores/arduino/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ void arduino_main(void)
Serial.begin(115200);
#endif
startAgt();
start_freertos_on_header_inclusion();
setup();
#ifdef PROVIDE_FREERTOS_HOOK
start_freertos_on_header_inclusion();
#endif
while (1)
{
loop();
Expand Down
3 changes: 2 additions & 1 deletion libraries/Arduino_FreeRTOS/src/portable/FSP/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ static void prvTaskExitError(void);

#endif

#ifdef PROVIDE_FREERTOS_HOOK
void loop_thread_func(void* arg) {
setup();
while (1)
{
loop();
Expand All @@ -246,6 +246,7 @@ void start_freertos_on_header_inclusion() {

vTaskStartScheduler();
}
#endif

/* Arduino specific overrides */
void delay(uint32_t ms) {
Expand Down

0 comments on commit 51b909d

Please sign in to comment.