File tree 2 files changed +24
-0
lines changed
libraries/Arduino_FreeRTOS/src/portable/FSP
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ void unsecure_registers() {
64
64
#define str (s ) #s
65
65
66
66
extern " C" void Stacktrace_Handler (void );
67
+ extern " C" __attribute__((weak)) void start_freertos_on_header_inclusion () {}
67
68
68
69
void arduino_main (void )
69
70
{
@@ -111,6 +112,7 @@ void arduino_main(void)
111
112
Serial.begin (115200 );
112
113
#endif
113
114
startAgt ();
115
+ start_freertos_on_header_inclusion ();
114
116
setup ();
115
117
while (1 )
116
118
{
Original file line number Diff line number Diff line change @@ -225,6 +225,28 @@ static void prvTaskExitError(void);
225
225
226
226
#endif
227
227
228
+ void loop_thread_func (void * arg ) {
229
+ setup ();
230
+ while (1 )
231
+ {
232
+ loop ();
233
+ }
234
+ }
235
+
236
+ static TaskHandle_t loop_task ;
237
+ void start_freertos_on_header_inclusion () {
238
+ xTaskCreate (
239
+ (TaskFunction_t )loop_thread_func ,
240
+ "Loop Thread" ,
241
+ 4096 / 4 , /* usStackDepth in words */
242
+ NULL , /* pvParameters */
243
+ 4 , /* uxPriority */
244
+ & loop_task /* pxCreatedTask */
245
+ );
246
+
247
+ vTaskStartScheduler ();
248
+ }
249
+
228
250
/* Arduino specific overrides */
229
251
void delay (uint32_t ms ) {
230
252
if (xTaskGetSchedulerState () == taskSCHEDULER_RUNNING ) {
You can’t perform that action at this time.
0 commit comments