Skip to content

Commit

Permalink
Fixes an issue where characters are not output using continuous print…
Browse files Browse the repository at this point in the history
…f on UNO R4 WiFi.
  • Loading branch information
embedded-kiddie committed May 25, 2024
1 parent f7ad8a0 commit 6595efb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@

# Others
._*

.vscode
8 changes: 8 additions & 0 deletions Printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ int printf(const char* fmt, ...) {
va_end(arg_ptr);

// output to the serial console through the 'Serial'
#if 1
len = Serial.write((uint8_t*)buf, (size_t)len);
#else
len = Serial.print(buf);
#endif

#if defined(ARDUINO_UNOWIFIR4) && 1
delay(len / 10); // UNO R4 WiFi needs some delay to fix buffer overrun
#endif

return len;
}

0 comments on commit 6595efb

Please sign in to comment.