summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-03-18 11:43:47 +0700
committerhathach <[email protected]>2023-03-18 11:43:47 +0700
commit9f54cc1eb725e7d77a5b275b209d8257b180d7ed (patch)
tree7ed7c12f7b0f493a887b76ffce348856426eaa1e /src
parentd919f107c71021b2dfa20cd9bfe252c4f544422f (diff)
more clean up
Diffstat (limited to 'src')
-rw-r--r--src/class/usbtmc/usbtmc_device.c7
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.h4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/class/usbtmc/usbtmc_device.c b/src/class/usbtmc/usbtmc_device.c
index 8dbda14c5..4e320a778 100644
--- a/src/class/usbtmc/usbtmc_device.c
+++ b/src/class/usbtmc/usbtmc_device.c
@@ -154,7 +154,10 @@ TU_VERIFY_STATIC(USBTMCD_BUFFER_SIZE >= 32u,"USBTMC dev buffer size too small");
static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len);
static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen);
+#ifndef NDEBUG
tu_static uint8_t termChar;
+#endif
+
tu_static uint8_t termCharRequested = false;
#if OSAL_MUTEX_REQUIRED
@@ -442,7 +445,10 @@ static bool handle_devMsgIn(void *data, size_t len)
usbtmc_state.transfer_size_sent = 0u;
termCharRequested = msg->bmTransferAttributes.TermCharEnabled;
+
+#ifndef NDEBUG
termChar = msg->TermChar;
+#endif
if(termCharRequested)
TU_VERIFY(usbtmc_state.capabilities->bmDevCapabilities.canEndBulkInOnTermChar);
@@ -511,6 +517,7 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
return true;
case STATE_ABORTING_BULK_OUT:
+ // Should be stalled by now, shouldn't have received a packet.
return false;
case STATE_TX_REQUESTED:
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.h b/src/portable/raspberrypi/rp2040/rp2040_usb.h
index 79af0204b..5d3d792cb 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.h
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.h
@@ -36,8 +36,8 @@
#define __tusb_irq_path_func(x) x
#endif
-#define usb_hw_set hw_set_alias(usb_hw)
-#define usb_hw_clear hw_clear_alias(usb_hw)
+#define usb_hw_set ((usb_hw_t *) hw_set_alias(usb_hw))
+#define usb_hw_clear ((usb_hw_t *) hw_clear_alias(usb_hw))
#define pico_info(...) TU_LOG(2, __VA_ARGS__)
#define pico_trace(...) TU_LOG(3, __VA_ARGS__)