add bool type print (#2136)

This commit is contained in:
summermorningdream 2024-05-08 14:23:47 +08:00 committed by GitHub
parent 3628576d60
commit 075b23b291
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,3 +132,13 @@ void UsbSerialAsyncmsg::asyncmsg(const char* data) {
}
chprintf((BaseSequentialStream*)&SUSBD1, "%s\r\n", data);
}
/// bool
template <>
// usage: UsbSerialAsyncmsg::asyncmsg(true);
void UsbSerialAsyncmsg::asyncmsg<bool>(const bool& data) {
if (!portapack::async_tx_enabled) {
return;
}
chprintf((BaseSequentialStream*)&SUSBD1, "%s\r\n", data ? "true" : "false");
}