test systemOff without freeRTOS
This commit is contained in:
1 parent
a8d83b6c0d
commit
b80c5a89bf
2 files changed
+15
-7
No files matched your search
+5
-1
@@ -70,7 +70,7 @@ static void loop_task(void* arg)
|
||||
#endif
|
||||
|
||||
// To compatible with most code where loop is not rtos-aware
|
||||
taskYIELD(); // vTaskDelay(1);
|
||||
// taskYIELD(); // vTaskDelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,9 @@ int main( void )
|
||||
SEGGER_SYSVIEW_Conf();
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
loop_task(NULL);
|
||||
#else
|
||||
// Create a task for loop()
|
||||
TaskHandle_t _loopHandle;
|
||||
xTaskCreate( loop_task, "loop", _loopStacksize, NULL, TASK_PRIO_NORMAL, &_loopHandle);
|
||||
@@ -99,6 +102,7 @@ int main( void )
|
||||
vTaskStartScheduler();
|
||||
|
||||
NVIC_SystemReset();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -20,13 +20,17 @@
|
||||
// the setup function runs once when you press reset or power the board
|
||||
void setup() {
|
||||
// initialize digital pin LED_BUILTIN as an output.
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
// the loop function runs over and over again forever
|
||||
void loop() {
|
||||
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
|
||||
delay(1000); // wait for a second
|
||||
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
|
||||
delay(1000); // wait for a second
|
||||
#if 0
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
digitalToggle(LED_BLUE); // turn the LED on (HIGH is the voltage level)
|
||||
delay(1000); // wait for a second
|
||||
}
|
||||
#endif
|
||||
|
||||
systemOff(A0, HIGH);
|
||||
}
|
||||
Reference in new issue
Block a user