I think loop() never reaches in this example. Maybe some other task named "background" should be introduces.
void setup() {
// initialize the digital pin as an output:
pinMode(BOARD_LED_PIN, OUTPUT);
xTaskCreate(vLEDFlashTask,
(signed portCHAR *)"Task1",
configMINIMAL_STACK_SIZE,
NULL,
tskIDLE_PRIORITY + 2,
NULL);
vTaskStartScheduler();
// Will not get here unless a task calls vTaskEndScheduler ()
}
void loop() {
//wrong! never reached
// Insert background code here
}
// Force init to be called *first*, i.e. before static object allocation.
// Otherwise, statically allocated objects that need libmaple may fail.
__attribute__((constructor)) void premain() {
init();
}
int main(void) {
setup();
while (true) {
loop();
}
return 0;
}
I think loop() never reaches in this example. Maybe some other task named "background" should be introduces.