protect serial asyncmsg with indicate to prevent halt (#2272)

This commit is contained in:
zxkmm 2024-09-29 16:19:29 +08:00 committed by GitHub
parent b19ed5fec5
commit b43eaa8786
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 17 deletions

View file

@ -61,7 +61,7 @@ class UsbSerialAsyncmsg {
// ussgae: UsbSerialAsyncmsg::asyncmsg(vec);
template <typename VECTORCOVER>
void UsbSerialAsyncmsg::asyncmsg(const std::vector<VECTORCOVER>& data) {
if (!portapack::async_tx_enabled) {
if (!portapack::async_tx_enabled || !portapack::usb_serial.serial_connected()) {
return;
}
for (const auto& item : data) {