diff --git a/CHANGELOG.md b/CHANGELOG.md index 1db164c14..e7e2cf0e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `PLATFORM_EXTRAS=BWM` - a command started over the Proxmark5 wireless module can be aborted again, `data_available()` only polled USB so CMD_BREAK_LOOP was never seen on the BLE or WiFi link (@tweathers-sec) - Fixed `lf search` - a leftover debug print no longer reports `DEBUG: detectindala | ` on every failed Indala demodulation (@tweathers-sec) - Changed `memcpy` - the device's own implementation now copies a word at a time when source and destination allow it (@iceman1001) - Changed NG replies - the outgoing frame is offset so its payload lands word aligned, taking USB transfer speed from 630 to 789 kB/s on RDV4 (@iceman1001) diff --git a/armsrc/util.c b/armsrc/util.c index 72333dd5b..d163f47b3 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -25,6 +25,9 @@ #include "string.h" #include "usb_cdc_apis.h" #include "usart.h" +#ifdef WITH_BWM_FORWARD +#include "bwm_forward.h" +#endif #include "BigBuf.h" // trace_restart_timeline #ifdef WITH_SMARTCARD #include "i2c.h" // sc_log_trace_reset @@ -327,7 +330,11 @@ int BUTTON_HELD(int ms) { // This function returns false if no data is available or // the USB connection is invalid. bool data_available(void) { -#ifdef WITH_FPC_USART_HOST +#if defined(WITH_BWM_FORWARD) + // The BWM (BLE / WiFi) link is the host connection on a Proxmark5, so it + // has to be polled here too or CMD_BREAK_LOOP is never seen over it. + return usb_poll_validate_length() || (bwm_fwd_rxdata_available() > 0); +#elif defined(WITH_FPC_USART_HOST) return usb_poll_validate_length() || (usart_rxdata_available() > 0); #else return usb_poll_validate_length(); @@ -338,7 +345,9 @@ bool data_available(void) { // In most of the cases, you should use data_available() unless // the timing is critical. bool data_available_fast(void) { -#ifdef WITH_FPC_USART_HOST +#if defined(WITH_BWM_FORWARD) + return usb_available_length() || (bwm_fwd_rxdata_available() > 0); +#elif defined(WITH_FPC_USART_HOST) return usb_available_length() || (usart_rxdata_available() > 0); #else return usb_available_length();