mirror of
https://github.com/WeActStudio/ArduinoCore-AT32F4.git
synced 2026-05-21 09:22:01 +00:00
fix compile printf bug
This commit is contained in:
@@ -274,6 +274,24 @@ size_t Print::printFloat(double number, uint8_t digits)
|
||||
return n;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
__attribute__((weak))
|
||||
int _write(int file, char *ptr, int len)
|
||||
{
|
||||
switch (file) {
|
||||
case STDOUT_FILENO:
|
||||
case STDERR_FILENO:
|
||||
break;
|
||||
case STDIN_FILENO:
|
||||
break;
|
||||
default:
|
||||
((class Print *)file)->write((uint8_t *)ptr, len);
|
||||
break;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
}
|
||||
|
||||
int Print::printf (const char *__restrict __format, ...)
|
||||
{
|
||||
char printf_buff[PRINT_PRINTF_BUFFER_LENGTH];
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#undef errno
|
||||
extern int errno;
|
||||
|
||||
extern size_t uart_debug_write(uint8_t *data, uint32_t size);
|
||||
|
||||
// Helper macro to mark unused parameters and prevent compiler warnings.
|
||||
// Appends _UNUSED to the variable name to prevent accidentally using them.
|
||||
Reference in New Issue
Block a user