6 #define GETCHAR pgm_read_byte(fmt)
11 void debugPrintf(const char* fmt
, ...)
28 v
= va_arg(vlist
, const char *);
31 itoa(va_arg(vlist
, int32_t), buf
, DEC
);
34 utoa(va_arg(vlist
, uint32_t), buf
, DEC
);
37 utoa(va_arg(vlist
, uint32_t), buf
, HEX
);
39 #if !defined(PLATFORM_STM32)
42 float val
= va_arg(vlist
, double);
43 itoa((int32_t)val
, buf
, DEC
);
45 int32_t decimals
= abs((int32_t)(val
* 1000)) % 1000;
46 itoa(decimals
, buf
+ strlen(buf
), DEC
);
53 LOGGING_UART
.write((uint8_t*)v
, strlen(v
));
55 LOGGING_UART
.write(c
);
63 #if defined(DEBUG_INIT)
64 // Create a UART to send DBGLN to during preinit
65 void debugCreateInitLogger()
67 #if defined(PLATFORM_ESP32)
68 TxBackpack
= new HardwareSerial(1);
69 ((HardwareSerial
*)TxBackpack
)->begin(460800, SERIAL_8N1
, 3, 1);
71 TxBackpack
= new HardwareSerial(0);
72 ((HardwareSerial
*)TxBackpack
)->begin(460800, SERIAL_8N1
);
76 void debugFreeInitLogger()
78 ((HardwareSerial
*)TxBackpack
)->end();
79 delete (HardwareSerial
*)TxBackpack
;