Ver Fonte

Address two comments from PR

tuzzmaniandevil há 3 meses atrás
pai
commit
ffa76016ff
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 3 2
      examples/kiss_modem/KissModem.cpp
  2. 1 0
      examples/kiss_modem/KissModem.h

+ 3 - 2
examples/kiss_modem/KissModem.cpp

@@ -130,8 +130,7 @@ void KissModem::processFrame() {
         _pending_tx_len = data_len;
         _pending_tx_len = data_len;
         _has_pending_tx = true;
         _has_pending_tx = true;
       } else if (_has_pending_tx) {
       } else if (_has_pending_tx) {
-        uint8_t result = 0x00;
-        writeHardwareFrame(HW_RESP_TX_DONE, &result, 1);
+        writeHardwareError(HW_ERR_TX_BUSY);
       }
       }
       break;
       break;
 
 
@@ -296,6 +295,8 @@ void KissModem::processTx() {
           _tx_timer = millis();
           _tx_timer = millis();
           _tx_state = TX_SENDING;
           _tx_state = TX_SENDING;
         } else {
         } else {
+          uint8_t result = 0x00;
+          writeHardwareFrame(HW_RESP_TX_DONE, &result, 1);
           _has_pending_tx = false;
           _has_pending_tx = false;
           _tx_state = TX_IDLE;
           _tx_state = TX_IDLE;
         }
         }

+ 1 - 0
examples/kiss_modem/KissModem.h

@@ -72,6 +72,7 @@
 #define HW_ERR_MAC_FAILED        0x04
 #define HW_ERR_MAC_FAILED        0x04
 #define HW_ERR_UNKNOWN_CMD       0x05
 #define HW_ERR_UNKNOWN_CMD       0x05
 #define HW_ERR_ENCRYPT_FAILED    0x06
 #define HW_ERR_ENCRYPT_FAILED    0x06
+#define HW_ERR_TX_BUSY           0x07
 
 
 #define KISS_FIRMWARE_VERSION 1
 #define KISS_FIRMWARE_VERSION 1