Skip to content

Commit 51b909d

Browse files
authored
Merge pull request #414 from facchinm/freertos_hook_move
Allow FreeRTOS hook for C33 only and improve its reliability
2 parents 95113d2 + b83fd20 commit 51b909d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: boards.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ portenta_c33.build.fpu=-mfpu=fpv5-sp-d16
1212
portenta_c33.build.float-abi=-mfloat-abi=hard
1313

1414
portenta_c33.build.board=PORTENTA_C33
15-
portenta_c33.build.defines=-DF_CPU=200000000
15+
portenta_c33.build.defines=-DF_CPU=200000000 -DPROVIDE_FREERTOS_HOOK
1616
portenta_c33.vid.0=0x2341
1717
portenta_c33.pid.0=0x0068
1818
portenta_c33.vid.1=0x2341

Diff for: cores/arduino/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ void arduino_main(void)
112112
Serial.begin(115200);
113113
#endif
114114
startAgt();
115-
start_freertos_on_header_inclusion();
116115
setup();
116+
#ifdef PROVIDE_FREERTOS_HOOK
117+
start_freertos_on_header_inclusion();
118+
#endif
117119
while (1)
118120
{
119121
loop();

Diff for: libraries/Arduino_FreeRTOS/src/portable/FSP/port.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ static void prvTaskExitError(void);
225225

226226
#endif
227227

228+
#ifdef PROVIDE_FREERTOS_HOOK
228229
void loop_thread_func(void* arg) {
229-
setup();
230230
while (1)
231231
{
232232
loop();
@@ -246,6 +246,7 @@ void start_freertos_on_header_inclusion() {
246246

247247
vTaskStartScheduler();
248248
}
249+
#endif
249250

250251
/* Arduino specific overrides */
251252
void delay(uint32_t ms) {

0 commit comments

Comments
 (0)