Skip to content

Commit

Permalink
add bool type print (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkmm committed May 8, 2024
1 parent 3628576 commit 075b23b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions firmware/application/usb_serial_asyncmsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 075b23b

Please sign in to comment.