fix(linux): prevent build error on MacOS and optimize buffer usage on Linux

This commit is contained in:
Jakob Hasse
2024-02-22 11:49:47 +08:00
parent 293f529cd7
commit f9c9e18bca
2 changed files with 13 additions and 4 deletions

View File

@@ -50,9 +50,9 @@ static void main_task(void* args)
int main(int argc, const char **argv)
{
// This makes sure that stdio is flushed after each '\n' so that idf.py monitor
// reads the program output on time.
setvbuf(stdout, NULL, _IOLBF, 0);
// This makes sure that stdio is always syncronized so that idf.py monitor
// and other tools read text output on time.
setvbuf(stdout, NULL, _IONBF, 0);
usleep(1000);
BaseType_t res = xTaskCreatePinnedToCore(&main_task, "main",