diff --git a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c index c3ee209cc0..05d33296ce 100644 --- a/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c +++ b/lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c @@ -817,7 +817,7 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin count32b = (len + 3) / 4; for (i = 0; i < count32b; i++, src += 4) { - USBx_DFIFO(ch_ep_num) = *((__packed uint32_t *)src); + USBx_DFIFO((uint32_t)ch_ep_num) = *((uint32_t *)src); } } return HAL_OK; @@ -843,7 +843,7 @@ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len) for ( i = 0; i < count32b; i++, dest += 4 ) { - *(__packed uint32_t *)dest = USBx_DFIFO(0); + *(uint32_t *)dest = USBx_DFIFO(0); } return ((void *)dest); diff --git a/src/main/cms/cms.c b/src/main/cms/cms.c index c775c222e4..3a4730f66f 100644 --- a/src/main/cms/cms.c +++ b/src/main/cms/cms.c @@ -329,7 +329,7 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, OSD_Entry *p, uint8_t row) buff[0] = 0x0; if ((p->type == OME_Submenu) && p->func && (p->flags & OPTSTRING)) { // Special case of sub menu entry with optional value display. - char *str = ((CMSMenuOptFuncPtr)p->func)(); + char *str = ((CMSMenuOptFuncPtr)(long)p->func)(); strncpy( buff, str, CMS_DRAW_BUFFER_LEN); } strncat(buff, ">", CMS_DRAW_BUFFER_LEN); diff --git a/src/main/cms/cms_menu_vtx_smartaudio.c b/src/main/cms/cms_menu_vtx_smartaudio.c index 77622df9e7..319da7d40e 100644 --- a/src/main/cms/cms_menu_vtx_smartaudio.c +++ b/src/main/cms/cms_menu_vtx_smartaudio.c @@ -492,7 +492,7 @@ static OSD_Entry saCmsMenuConfigEntries[] = { { "OP MODEL", OME_TAB, saCmsConfigOpmodelByGvar, &(OSD_TAB_t){ &saCmsOpmodel, 2, saCmsOpmodelNames }, DYNAMIC }, { "FSEL MODE", OME_TAB, saCmsConfigFreqModeByGvar, &saCmsEntFselMode, DYNAMIC }, { "PIT FMODE", OME_TAB, saCmsConfigPitFModeByGvar, &saCmsEntPitFMode, 0 }, - { "POR FREQ", OME_Submenu, (CMSEntryFuncPtr)saCmsORFreqGetString, &saCmsMenuPORFreq, OPTSTRING }, + { "POR FREQ", OME_Submenu, (CMSEntryFuncPtr)(long)saCmsORFreqGetString, &saCmsMenuPORFreq, OPTSTRING }, #ifdef USE_EXTENDED_CMS_MENUS { "STATX", OME_Submenu, cmsMenuChange, &saCmsMenuStats, 0 }, #endif /* USE_EXTENDED_CMS_MENUS */ @@ -534,7 +534,7 @@ static OSD_Entry saCmsMenuFreqModeEntries[] = { { "- SMARTAUDIO -", OME_Label, NULL, NULL, 0 }, { "", OME_Label, NULL, saCmsStatusString, DYNAMIC }, - { "FREQ", OME_Submenu, (CMSEntryFuncPtr)saCmsUserFreqGetString, &saCmsMenuUserFreq, OPTSTRING }, + { "FREQ", OME_Submenu, (CMSEntryFuncPtr)(long)saCmsUserFreqGetString, &saCmsMenuUserFreq, OPTSTRING }, { "POWER", OME_TAB, saCmsConfigPowerByGvar, &saCmsEntPower, 0 }, { "SET", OME_Submenu, cmsMenuChange, &saCmsMenuCommence, 0 }, { "CONFIG", OME_Submenu, cmsMenuChange, &saCmsMenuConfig, 0 }, diff --git a/src/main/drivers/beesign.c b/src/main/drivers/beesign.c index ea6bfeee53..aa26debe57 100644 --- a/src/main/drivers/beesign.c +++ b/src/main/drivers/beesign.c @@ -101,10 +101,11 @@ static uint8_t beesignCRC(const beesign_frame_t *pPackage) { return crc; } -static uint8_t beesignChkID(uint8_t id) { - UNUSED(id); - return BEESIGN_OK; -} +// compiler reports unused +//static uint8_t beesignChkID(uint8_t id) { +// UNUSED(id); +// return BEESIGN_OK; +//} uint8_t beesignReceive(uint8_t **pRcvFrame) { if (!receiveFrameValid) { @@ -608,7 +609,7 @@ bool checkBeesignSerialPort(void) { void beesignUpdate(timeUs_t currentTimeUs) { UNUSED(currentTimeUs); - if (checkBeesignSerialPort) { + if (checkBeesignSerialPort()) { #ifdef USE_OSD_BEESIGN static uint32_t beesignTaskCounter = 0; static uint32_t beesignSendNextCounterPoint = 0; diff --git a/src/main/io/spektrum_vtx_control.c b/src/main/io/spektrum_vtx_control.c index 61161a30e8..d591359078 100644 --- a/src/main/io/spektrum_vtx_control.c +++ b/src/main/io/spektrum_vtx_control.c @@ -113,6 +113,9 @@ const uint8_t vtxBsPi[SPEKTRUM_VTX_POWER_COUNT] = { #endif // USE_VTX_BEESIGN uint8_t convertSpektrumVtxPowerIndex(uint8_t sPower) { +#if !(defined(USE_VTX_RTC6705) || defined(USE_VTX_SMARTAUDIO) || defined(USE_VTX_TRAMP)) + UNUSED(sPower); +#endif uint8_t devicePower = 0; const vtxDevice_t *vtxDevice = vtxCommonDevice(); switch (vtxCommonGetDeviceType(vtxDevice)) { diff --git a/src/main/msc/usbd_msc_desc.c b/src/main/msc/usbd_msc_desc.c index 2ebe7622fc..061c14563b 100644 --- a/src/main/msc/usbd_msc_desc.c +++ b/src/main/msc/usbd_msc_desc.c @@ -67,8 +67,10 @@ #define USBD_MANUFACTURER_STRING "STMicroelectronics" #define USBD_PRODUCT_HS_STRING "Mass Storage in HS Mode" #define USBD_PRODUCT_FS_STRING "Mass Storage in FS Mode" -#define USBD_CONFIGURATION_HS_STRING "MSC Config" -#define USBD_INTERFACE_HS_STRING "MSC Interface" +#define USBD_CONFIGURATION_HS_STRING "MSC Config in HS Mode" +#define USBD_INTERFACE_HS_STRING "MSC Interface in HS Mode" +#define USBD_CONFIGURATION_FS_STRING "MSC Config in FS Mode" +#define USBD_INTERFACE_FS_STRING "MSC Interface in FS Mode" /** * @} */ diff --git a/src/main/pg/board.c b/src/main/pg/board.c index a3d17831ea..28f692c867 100644 --- a/src/main/pg/board.c +++ b/src/main/pg/board.c @@ -37,14 +37,14 @@ PG_REGISTER_WITH_RESET_FN(boardConfig_t, boardConfig, PG_BOARD_CONFIG, 0); void pgResetFn_boardConfig(boardConfig_t *boardConfig) { if (boardInformationIsSet()) { - strncpy(boardConfig->manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH); - strncpy(boardConfig->boardName, getBoardName(), MAX_BOARD_NAME_LENGTH); + strncpy(boardConfig->manufacturerId, getManufacturerId(), MAX_MANUFACTURER_ID_LENGTH + 1); + strncpy(boardConfig->boardName, getBoardName(), MAX_BOARD_NAME_LENGTH + 1); boardConfig->boardInformationSet = true; } else { #if !defined(GENERIC_TARGET) - strncpy(boardConfig->boardName, targetName, MAX_BOARD_NAME_LENGTH); + strncpy(boardConfig->boardName, targetName, MAX_BOARD_NAME_LENGTH + 1); #if defined(TARGET_MANUFACTURER_IDENTIFIER) - strncpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH); + strncpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH + 1); #endif boardConfig->boardInformationSet = true; #else diff --git a/src/main/rx/crsf.c b/src/main/rx/crsf.c index 649712c084..f9dedb68ba 100644 --- a/src/main/rx/crsf.c +++ b/src/main/rx/crsf.c @@ -130,6 +130,7 @@ typedef struct crsfPayloadLinkstatistics_s { } crsfLinkStatistics_t; static void handleCrsfLinkStatisticsFrame(const crsfLinkStatistics_t* statsPtr, timeUs_t currentTimeUs) { + UNUSED(currentTimeUs); const crsfLinkStatistics_t stats = *statsPtr; CRSFsetLQ(stats.uplink_Link_quality); CRSFsetRFMode(stats.rf_Mode); diff --git a/src/main/telemetry/ghst.c b/src/main/telemetry/ghst.c index b8dad14b4a..fdee7df26b 100644 --- a/src/main/telemetry/ghst.c +++ b/src/main/telemetry/ghst.c @@ -82,9 +82,10 @@ static void ghstInitializeFrame(sbuf_t *dst) sbufWriteU8(dst, GHST_ADDR_RX); } -STATIC_UNIT_TESTED uint8_t *getGhstFrame(){ - return ghstFrame; -} +//compiler reports unused +//STATIC_UNIT_TESTED uint8_t *getGhstFrame(){ +// return ghstFrame; +//} static void ghstFinalize(sbuf_t *dst) { diff --git a/src/main/vcp_hal/usbd_desc.c b/src/main/vcp_hal/usbd_desc.c index ab850449dc..42a38d7b80 100644 --- a/src/main/vcp_hal/usbd_desc.c +++ b/src/main/vcp_hal/usbd_desc.c @@ -66,10 +66,10 @@ #define USBD_MANUFACTURER_STRING FC_FIRMWARE_NAME #define USBD_PRODUCT_HS_STRING "STM32 Virtual ComPort in HS Mode" #define USBD_PRODUCT_FS_STRING "STM32 Virtual ComPort in FS Mode" -#define USBD_CONFIGURATION_HS_STRING "VCP Config" -#define USBD_INTERFACE_HS_STRING "VCP Interface" -#define USBD_CONFIGURATION_FS_STRING "VCP Config" -#define USBD_INTERFACE_FS_STRING "VCP Interface" +#define USBD_CONFIGURATION_HS_STRING "VCP Config in HS Mode" +#define USBD_INTERFACE_HS_STRING "VCP Interface in HS Mode" +#define USBD_CONFIGURATION_FS_STRING "VCP Config in FS Mode" +#define USBD_INTERFACE_FS_STRING "VCP Interface in FS Mode" /* Private macro -------------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/