summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-10-17 16:26:27 +0700
committerhathach <[email protected]>2021-10-17 16:36:53 +0700
commita5f516893bbd539f11fb8d1cbb5b6db5a50fc632 (patch)
tree1d9f344ae3b7ed1a56b27bcbb11c4ff9d1ae07de /hw
parent0b249618b0469529da748e3e5478751cd56acd31 (diff)
more with -Wcast-qual
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/fomu/fomu.c9
-rw-r--r--hw/bsp/gd32vf103/family.c2
-rw-r--r--hw/bsp/imxrt/family.c2
-rw-r--r--hw/bsp/lpc15/family.mk2
-rw-r--r--hw/bsp/lpc18/family.mk2
-rw-r--r--hw/bsp/lpc54/family.c2
-rw-r--r--hw/bsp/lpc55/family.c2
-rw-r--r--hw/bsp/mm32/family.mk2
-rw-r--r--hw/bsp/rx/boards/gr_citrus/gr_citrus.c2
-rw-r--r--hw/bsp/rx/boards/rx65n_target/rx65n_target.c2
-rw-r--r--hw/bsp/samd11/family.mk3
-rw-r--r--hw/bsp/samd21/family.mk3
-rw-r--r--hw/bsp/samd51/family.mk3
-rw-r--r--hw/bsp/saml2x/family.mk3
-rw-r--r--hw/bsp/stm32f0/family.c2
-rw-r--r--hw/bsp/stm32f0/family.mk2
-rw-r--r--hw/bsp/stm32f4/family.c2
-rw-r--r--hw/bsp/stm32f7/family.c2
-rw-r--r--hw/bsp/stm32h7/family.c2
19 files changed, 32 insertions, 17 deletions
diff --git a/hw/bsp/fomu/fomu.c b/hw/bsp/fomu/fomu.c
index 25e5e9613..12b7bfd18 100644
--- a/hw/bsp/fomu/fomu.c
+++ b/hw/bsp/fomu/fomu.c
@@ -101,9 +101,14 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
int32_t offset = 0;
+ uint8_t const* buf8 = (uint8_t const*) buf;
for (offset = 0; offset < len; offset++)
- if (! (messible_status_read() & CSR_MESSIBLE_STATUS_FULL_OFFSET))
- messible_in_write(((uint8_t *)buf)[offset]);
+ {
+ if (!(messible_status_read() & CSR_MESSIBLE_STATUS_FULL_OFFSET))
+ {
+ messible_in_write(buf8[offset]);
+ }
+ }
return len;
}
diff --git a/hw/bsp/gd32vf103/family.c b/hw/bsp/gd32vf103/family.c
index d76fb9a2a..c20732302 100644
--- a/hw/bsp/gd32vf103/family.c
+++ b/hw/bsp/gd32vf103/family.c
@@ -158,7 +158,7 @@ int board_uart_write(void const* buf, int len) {
#if defined(UART_DEV)
int txsize = len;
while (txsize--) {
- usart_write(UART_DEV, *(uint8_t*)buf);
+ usart_write(UART_DEV, *(uint8_t const*)buf);
buf++;
}
return len;
diff --git a/hw/bsp/imxrt/family.c b/hw/bsp/imxrt/family.c
index 77a224a5e..716681ca9 100644
--- a/hw/bsp/imxrt/family.c
+++ b/hw/bsp/imxrt/family.c
@@ -172,7 +172,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- LPUART_WriteBlocking(UART_PORT, (uint8_t*)buf, len);
+ LPUART_WriteBlocking(UART_PORT, (uint8_t const*)buf, len);
return len;
}
diff --git a/hw/bsp/lpc15/family.mk b/hw/bsp/lpc15/family.mk
index e80a3bc51..c7dd3f8be 100644
--- a/hw/bsp/lpc15/family.mk
+++ b/hw/bsp/lpc15/family.mk
@@ -15,7 +15,7 @@ CFLAGS += \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
# mcu driver cause following warnings
-CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable
+CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=cast-qual
MCU_DIR = hw/mcu/nxp/lpcopen/lpc15xx/lpc_chip_15xx
diff --git a/hw/bsp/lpc18/family.mk b/hw/bsp/lpc18/family.mk
index 3fed0b45a..79a00cb2d 100644
--- a/hw/bsp/lpc18/family.mk
+++ b/hw/bsp/lpc18/family.mk
@@ -13,7 +13,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_LPC18XX
# mcu driver cause following warnings
-CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes
+CFLAGS += -Wno-error=unused-parameter -Wno-error=strict-prototypes -Wno-error=cast-qual
MCU_DIR = hw/mcu/nxp/lpcopen/lpc18xx/lpc_chip_18xx
diff --git a/hw/bsp/lpc54/family.c b/hw/bsp/lpc54/family.c
index 4789425a3..4f1199c3a 100644
--- a/hw/bsp/lpc54/family.c
+++ b/hw/bsp/lpc54/family.c
@@ -210,7 +210,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
+ USART_WriteBlocking(UART_DEV, (uint8_t const *) buf, len);
return 0;
}
diff --git a/hw/bsp/lpc55/family.c b/hw/bsp/lpc55/family.c
index 4fc1f6222..f037a9f5b 100644
--- a/hw/bsp/lpc55/family.c
+++ b/hw/bsp/lpc55/family.c
@@ -265,7 +265,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- USART_WriteBlocking(UART_DEV, (uint8_t *)buf, len);
+ USART_WriteBlocking(UART_DEV, (uint8_t const *) buf, len);
return len;
}
diff --git a/hw/bsp/mm32/family.mk b/hw/bsp/mm32/family.mk
index 3273ff870..1a9f51191 100644
--- a/hw/bsp/mm32/family.mk
+++ b/hw/bsp/mm32/family.mk
@@ -14,7 +14,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_MM32F327X
# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
+CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized -Wno-error=cast-qual
SRC_C += \
src/portable/mindmotion/mm32/dcd_mm32f327x_otg.c \
diff --git a/hw/bsp/rx/boards/gr_citrus/gr_citrus.c b/hw/bsp/rx/boards/gr_citrus/gr_citrus.c
index caf5fd6fa..633ddad16 100644
--- a/hw/bsp/rx/boards/gr_citrus/gr_citrus.c
+++ b/hw/bsp/rx/boards/gr_citrus/gr_citrus.c
@@ -228,7 +228,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const *buf, int len)
{
- sci0_buf[0].buf = (uint8_t*)buf;
+ sci0_buf[0].buf = (uint8_t*)(uintptr_t) buf;
sci0_buf[0].cnt = len;
SCI0.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
while (SCI0.SCR.BIT.TE) ;
diff --git a/hw/bsp/rx/boards/rx65n_target/rx65n_target.c b/hw/bsp/rx/boards/rx65n_target/rx65n_target.c
index 20867455e..ab86bc419 100644
--- a/hw/bsp/rx/boards/rx65n_target/rx65n_target.c
+++ b/hw/bsp/rx/boards/rx65n_target/rx65n_target.c
@@ -273,7 +273,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const *buf, int len)
{
- sci_buf[0].buf = (uint8_t*)buf;
+ sci_buf[0].buf = (uint8_t*)(uintptr_t) buf;
sci_buf[0].cnt = len;
SCI5.SCR.BYTE |= SCI_SCR_TE | SCI_SCR_TIE;
while (SCI5.SCR.BIT.TE) ;
diff --git a/hw/bsp/samd11/family.mk b/hw/bsp/samd11/family.mk
index 032d11b98..ae55be75b 100644
--- a/hw/bsp/samd11/family.mk
+++ b/hw/bsp/samd11/family.mk
@@ -11,6 +11,9 @@ CFLAGS += \
-DOSC32K_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD11
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-qual
+
SRC_C += \
src/portable/microchip/samd/dcd_samd.c \
hw/mcu/microchip/samd11/gcc/gcc/startup_samd11.c \
diff --git a/hw/bsp/samd21/family.mk b/hw/bsp/samd21/family.mk
index f1b063f2c..208f23789 100644
--- a/hw/bsp/samd21/family.mk
+++ b/hw/bsp/samd21/family.mk
@@ -12,6 +12,9 @@ CFLAGS += \
-DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAMD21
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-qual
+
SRC_C += \
src/portable/microchip/samd/dcd_samd.c \
hw/mcu/microchip/samd21/gcc/gcc/startup_samd21.c \
diff --git a/hw/bsp/samd51/family.mk b/hw/bsp/samd51/family.mk
index f4e260fb1..783bed82a 100644
--- a/hw/bsp/samd51/family.mk
+++ b/hw/bsp/samd51/family.mk
@@ -13,7 +13,8 @@ CFLAGS += \
-nostdlib -nostartfiles \
-DCFG_TUSB_MCU=OPT_MCU_SAMD51
-CFLAGS += -Wno-error=undef
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-qual
SRC_C += \
src/portable/microchip/samd/dcd_samd.c \
diff --git a/hw/bsp/saml2x/family.mk b/hw/bsp/saml2x/family.mk
index e0f6b2f77..bb1faeb7f 100644
--- a/hw/bsp/saml2x/family.mk
+++ b/hw/bsp/saml2x/family.mk
@@ -13,6 +13,9 @@ CFLAGS += \
-DCONF_OSC32K_CALIB_ENABLE=0 \
-DCFG_TUSB_MCU=OPT_MCU_SAML22
+# suppress warning caused by vendor mcu driver
+CFLAGS += -Wno-error=cast-qual
+
SRC_C += \
src/portable/microchip/samd/dcd_samd.c \
$(MCU_DIR)/gcc/gcc/startup_$(SAML_VARIANT).c \
diff --git a/hw/bsp/stm32f0/family.c b/hw/bsp/stm32f0/family.c
index 68b924432..8de3147e2 100644
--- a/hw/bsp/stm32f0/family.c
+++ b/hw/bsp/stm32f0/family.c
@@ -134,7 +134,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
+ HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
return len;
}
diff --git a/hw/bsp/stm32f0/family.mk b/hw/bsp/stm32f0/family.mk
index 08cbf5626..39831e154 100644
--- a/hw/bsp/stm32f0/family.mk
+++ b/hw/bsp/stm32f0/family.mk
@@ -18,7 +18,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_STM32F0
# suppress warning caused by vendor mcu driver
-CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align
+CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual
SRC_C += \
src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c \
diff --git a/hw/bsp/stm32f4/family.c b/hw/bsp/stm32f4/family.c
index cf0cb2b08..31f27fa3f 100644
--- a/hw/bsp/stm32f4/family.c
+++ b/hw/bsp/stm32f4/family.c
@@ -160,7 +160,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
#ifdef UART_DEV
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
+ HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
return len;
#else
(void) buf; (void) len; (void) UartHandle;
diff --git a/hw/bsp/stm32f7/family.c b/hw/bsp/stm32f7/family.c
index 2eb737ee3..14e3b2fd9 100644
--- a/hw/bsp/stm32f7/family.c
+++ b/hw/bsp/stm32f7/family.c
@@ -284,7 +284,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
+ HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
return len;
}
diff --git a/hw/bsp/stm32h7/family.c b/hw/bsp/stm32h7/family.c
index a2116d0bd..84976b4e4 100644
--- a/hw/bsp/stm32h7/family.c
+++ b/hw/bsp/stm32h7/family.c
@@ -237,7 +237,7 @@ int board_uart_read(uint8_t* buf, int len)
int board_uart_write(void const * buf, int len)
{
- HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff);
+ HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
return len;
}