瀏覽代碼

Update usbtmc_device.c

Fix buffer alignment in TMC device class
Michael Bruno 5 年之前
父節點
當前提交
62d4652f86
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/class/usbtmc/usbtmc_device.c

+ 2 - 2
src/class/usbtmc/usbtmc_device.c

@@ -131,9 +131,9 @@ typedef struct
   uint8_t ep_int_in;
   uint8_t ep_int_in;
   // IN buffer is only used for first packet, not the remainder
   // IN buffer is only used for first packet, not the remainder
   // in order to deal with prepending header
   // in order to deal with prepending header
-  uint8_t ep_bulk_in_buf[USBTMCD_MAX_PACKET_SIZE];
+  CFG_TUSB_MEM_ALIGN uint8_t ep_bulk_in_buf[USBTMCD_MAX_PACKET_SIZE];
   // OUT buffer receives one packet at a time
   // OUT buffer receives one packet at a time
-  uint8_t ep_bulk_out_buf[USBTMCD_MAX_PACKET_SIZE];
+  CFG_TUSB_MEM_ALIGN uint8_t ep_bulk_out_buf[USBTMCD_MAX_PACKET_SIZE];
   uint32_t transfer_size_remaining; // also used for requested length for bulk IN.
   uint32_t transfer_size_remaining; // also used for requested length for bulk IN.
   uint32_t transfer_size_sent;      // To keep track of data bytes that have been queued in FIFO (not header bytes)
   uint32_t transfer_size_sent;      // To keep track of data bytes that have been queued in FIFO (not header bytes)