mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
example: auto restart int the linux hello world example
This commit is contained in:
parent
ba0481aabd
commit
811ed96042
@ -369,4 +369,5 @@ test_linux_example:
|
||||
script:
|
||||
- cd ${IDF_PATH}/examples/build_system/cmake/linux_host_app
|
||||
- idf.py build
|
||||
- build/linux_host_app.elf
|
||||
- timeout 5 ./build/linux_host_app.elf >test.log || true
|
||||
- grep "Restarting" test.log
|
||||
|
@ -8,13 +8,23 @@
|
||||
*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include <unistd.h>
|
||||
|
||||
void app_main() {
|
||||
printf("Hello, Host!\n");
|
||||
while(1) {
|
||||
printf("Hello, Host!\n");
|
||||
|
||||
for (int i = 10; i >= 0; i--) {
|
||||
printf("Restarting in %d seconds...\n", i);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
setbuf(stdout, NULL);
|
||||
app_main();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user