summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-05-31 11:11:00 +0700
committerhathach <[email protected]>2021-05-31 11:11:00 +0700
commit5cf930d78a9e31924008ac6bd145ddf2af76b42f (patch)
tree7457f18090f16ed511ccf33c9208f2b855cb55f9 /src
parentc2a0c1507b0db15a06773e321bd5c782bac54d39 (diff)
fix cast-align warning in msc host
Diffstat (limited to 'src')
-rw-r--r--src/class/msc/msc_host.c7
-rw-r--r--src/host/hcd.h2
-rw-r--r--src/portable/ehci/ehci.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/src/class/msc/msc_host.c b/src/class/msc/msc_host.c
index 5a4ffff48..205f0fd2d 100644
--- a/src/class/msc/msc_host.c
+++ b/src/class/msc/msc_host.c
@@ -71,7 +71,8 @@ CFG_TUSB_MEM_SECTION static msch_interface_t _msch_itf[CFG_TUSB_HOST_DEVICE_MAX]
// buffer used to read scsi information when mounted
// largest response data currently is inquiry TODO Inquiry is not part of enum anymore
-CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4) static uint8_t _msch_buffer[sizeof(scsi_inquiry_resp_t)];
+CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4)
+static uint8_t _msch_buffer[sizeof(scsi_inquiry_resp_t)];
static inline msch_interface_t* get_itf(uint8_t dev_addr)
{
@@ -438,7 +439,7 @@ static bool config_test_unit_ready_complete(uint8_t dev_addr, msc_cbw_t const* c
{
// Unit is ready, read its capacity
TU_LOG2("SCSI Read Capacity\r\n");
- tuh_msc_read_capacity(dev_addr, cbw->lun, (scsi_read_capacity10_resp_t*) _msch_buffer, config_read_capacity_complete);
+ tuh_msc_read_capacity(dev_addr, cbw->lun, (scsi_read_capacity10_resp_t*) ((void*) _msch_buffer), config_read_capacity_complete);
}else
{
// Note: During enumeration, some device fails Test Unit Ready and require a few retries
@@ -465,7 +466,7 @@ static bool config_read_capacity_complete(uint8_t dev_addr, msc_cbw_t const* cbw
msch_interface_t* p_msc = get_itf(dev_addr);
// Capacity response field: Block size and Last LBA are both Big-Endian
- scsi_read_capacity10_resp_t* resp = (scsi_read_capacity10_resp_t*) _msch_buffer;
+ scsi_read_capacity10_resp_t* resp = (scsi_read_capacity10_resp_t*) ((void*) _msch_buffer);
p_msc->capacity[cbw->lun].block_count = tu_ntohl(resp->last_lba) + 1;
p_msc->capacity[cbw->lun].block_size = tu_ntohl(resp->block_size);
diff --git a/src/host/hcd.h b/src/host/hcd.h
index ba6a9c5ca..df19f3e22 100644
--- a/src/host/hcd.h
+++ b/src/host/hcd.h
@@ -28,6 +28,8 @@
#define _TUSB_HCD_H_
#include "common/tusb_common.h"
+#include "osal/osal.h"
+#include "common/tusb_fifo.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index eab1f8928..a1c12e70d 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -302,7 +302,6 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const dir = tu_edpt_dir(ep_addr);
- // FIXME control only for now
if ( epnum == 0 )
{
ehci_qhd_t* qhd = qhd_control(dev_addr);