printf() requires a \n for output?
Posted: Fri Oct 27, 2017 10:41 pm
Hello. This is my first post.
I am able to successfully build and run the hello_world application on a SparkFun ESP32 Thing module (26MHz main xtal).
However, I observer that whereas these lines in the example:
work correctly, these altered lines do not output the "." character:
but these do (but are not in the format that I want): IOW, it appears that a call to printf() does not result in output to the terminal until a \n is injected into printf()'s arguments.
Based on my previous experience with printf() on embedded systems, this is not normal behavior. Is this intentional? Is there some option I need to set to ensure that whatever I send via printf() is output to the terminal, without requiring a \n?
Thanks,
I am able to successfully build and run the hello_world application on a SparkFun ESP32 Thing module (26MHz main xtal).
However, I observer that whereas these lines in the example:
Code: Select all
for (int i = 10; i >= 0; i--) {
printf("Restarting in %d seconds...\n", i);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
Code: Select all
int i=10;
printf("Restarting in %d seconds \n", i);
for (; i >= 0; i--) {
printf(".");
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
Code: Select all
int i=10;
printf("Restarting in %d seconds \n", i);
for (; i >= 0; i--) {
printf(".\n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
Based on my previous experience with printf() on embedded systems, this is not normal behavior. Is this intentional? Is there some option I need to set to ensure that whatever I send via printf() is output to the terminal, without requiring a \n?
Thanks,