From 1841255bfa0753bd37070679e6e03b29c82cccb9 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 10 Jan 2024 15:37:42 -0600 Subject: [PATCH 01/12] fix strncpy/truncate warning; fix unused CRSF timing stats --- src/main/pg/board.c | 2 +- src/main/rx/crsf.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/pg/board.c b/src/main/pg/board.c index a3d17831ea..7f197f110c 100644 --- a/src/main/pg/board.c +++ b/src/main/pg/board.c @@ -44,7 +44,7 @@ void pgResetFn_boardConfig(boardConfig_t *boardConfig) { #if !defined(GENERIC_TARGET) strncpy(boardConfig->boardName, targetName, MAX_BOARD_NAME_LENGTH); #if defined(TARGET_MANUFACTURER_IDENTIFIER) - strncpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH); + memcpy(boardConfig->manufacturerId, TARGET_MANUFACTURER_IDENTIFIER, MAX_MANUFACTURER_ID_LENGTH); #endif boardConfig->boardInformationSet = true; #else diff --git a/src/main/rx/crsf.c b/src/main/rx/crsf.c index 649712c084..cf2213395b 100644 --- a/src/main/rx/crsf.c +++ b/src/main/rx/crsf.c @@ -129,7 +129,7 @@ typedef struct crsfPayloadLinkstatistics_s { int8_t downlink_SNR; } crsfLinkStatistics_t; -static void handleCrsfLinkStatisticsFrame(const crsfLinkStatistics_t* statsPtr, timeUs_t currentTimeUs) { +static void handleCrsfLinkStatisticsFrame(const crsfLinkStatistics_t* statsPtr) { const crsfLinkStatistics_t stats = *statsPtr; CRSFsetLQ(stats.uplink_Link_quality); CRSFsetRFMode(stats.rf_Mode); @@ -213,7 +213,7 @@ STATIC_UNIT_TESTED void crsfDataReceive(uint16_t c, void *data) { if ((crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) && (crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE)) { const crsfLinkStatistics_t* statsFrame = (const crsfLinkStatistics_t*)&crsfFrame.frame.payload; - handleCrsfLinkStatisticsFrame(statsFrame, currentTimeUs); + handleCrsfLinkStatisticsFrame(statsFrame); } break; } From ceeea8034721d41d1b98c3212b7585dbab2714e5 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:10:28 -0600 Subject: [PATCH 02/12] comment out getGhstFrame (defined but not used) --- src/main/telemetry/ghst.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) { From 828e2fa5d383968cfd6b93c4a7b584327eccc52a Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:05:51 -0600 Subject: [PATCH 03/12] fix USBD VCP strings resulting in 'condition has identical branches' --- src/main/msc/usbd_msc_desc.c | 6 ++++-- src/main/vcp_hal/usbd_desc.c | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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/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 -----------------------------------------------*/ From 049cf0f6b37ab87d9887c845909ef1337dd358ba Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:42:40 -0600 Subject: [PATCH 04/12] fix 'warning: 'packed' attribute ignored' --- .../Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From 42c113c5e8c77dcfa526fb812a6bed56687c2daa Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:58:48 -0600 Subject: [PATCH 05/12] fix compiler warnings - SmartAudio CMS menu FREQ, FREQ POR ; NEEDS TESTING --- src/main/cms/cms.c | 2 +- src/main/cms/cms_menu_vtx_smartaudio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 }, From edd3d8b715311ca4afad5dfec969c92ad9e27dcd Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:40:49 -0600 Subject: [PATCH 06/12] beesign comment out unused code; beesign fix function call parenthasis; unused sPower; NEEDS TESTING --- src/main/drivers/beesign.c | 11 ++++++----- src/main/io/spektrum_vtx_control.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) 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..b0154d1d25 100644 --- a/src/main/io/spektrum_vtx_control.c +++ b/src/main/io/spektrum_vtx_control.c @@ -113,6 +113,7 @@ const uint8_t vtxBsPi[SPEKTRUM_VTX_POWER_COUNT] = { #endif // USE_VTX_BEESIGN uint8_t convertSpektrumVtxPowerIndex(uint8_t sPower) { + UNUSED(sPower); uint8_t devicePower = 0; const vtxDevice_t *vtxDevice = vtxCommonDevice(); switch (vtxCommonGetDeviceType(vtxDevice)) { From 46520d76fdb37f69f07981b0cd8c0065f84467ce Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:30:56 -0600 Subject: [PATCH 07/12] retain strncpy, but allow trailing null; i think this is more proper based on board.h, but memcpy and removal of +1 from .h could work as well --- src/main/pg/board.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/pg/board.c b/src/main/pg/board.c index 7f197f110c..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) - memcpy(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 From b781135493fc80b98a8f5860093df7358816e8c1 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:42:18 -0600 Subject: [PATCH 08/12] retain currentTimeUs, but mark as UNUSED; i think this is more proper based on other code. --- src/main/rx/crsf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/rx/crsf.c b/src/main/rx/crsf.c index cf2213395b..f9dedb68ba 100644 --- a/src/main/rx/crsf.c +++ b/src/main/rx/crsf.c @@ -129,7 +129,8 @@ typedef struct crsfPayloadLinkstatistics_s { int8_t downlink_SNR; } crsfLinkStatistics_t; -static void handleCrsfLinkStatisticsFrame(const crsfLinkStatistics_t* statsPtr) { +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); @@ -213,7 +214,7 @@ STATIC_UNIT_TESTED void crsfDataReceive(uint16_t c, void *data) { if ((crsfFrame.frame.deviceAddress == CRSF_ADDRESS_FLIGHT_CONTROLLER) && (crsfFrame.frame.frameLength == CRSF_FRAME_ORIGIN_DEST_SIZE + CRSF_FRAME_LINK_STATISTICS_PAYLOAD_SIZE)) { const crsfLinkStatistics_t* statsFrame = (const crsfLinkStatistics_t*)&crsfFrame.frame.payload; - handleCrsfLinkStatisticsFrame(statsFrame); + handleCrsfLinkStatisticsFrame(statsFrame, currentTimeUs); } break; } From 1f45dd52d62b8774f0d2cb7f8fe88f7be443f638 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Tue, 20 Feb 2024 08:30:40 -0600 Subject: [PATCH 09/12] fix compiler warning FLWO_FLYWOOF411FR 10 timers --- src/main/target/FLWO_FLYWOOF411FR/target.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/target/FLWO_FLYWOOF411FR/target.h b/src/main/target/FLWO_FLYWOOF411FR/target.h index 42724e2881..3e95bdc8cf 100644 --- a/src/main/target/FLWO_FLYWOOF411FR/target.h +++ b/src/main/target/FLWO_FLYWOOF411FR/target.h @@ -169,5 +169,5 @@ #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) -#define USABLE_TIMER_CHANNEL_COUNT 7 +#define USABLE_TIMER_CHANNEL_COUNT 10 #define USED_TIMERS ( TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4) ) From c1b6b212355a9ecd47ae49651a127f22f0e72160 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Tue, 20 Feb 2024 08:43:15 -0600 Subject: [PATCH 10/12] CRASHTESTF7 was a fake target (template); no longer needed --- src/main/target/CRASHTESTF7/TALONF7V2.md | 12 -- src/main/target/CRASHTESTF7/config.c | 36 ------ src/main/target/CRASHTESTF7/target.c | 44 ------- src/main/target/CRASHTESTF7/target.h | 153 ----------------------- src/main/target/CRASHTESTF7/target.mk | 8 -- 5 files changed, 253 deletions(-) delete mode 100644 src/main/target/CRASHTESTF7/TALONF7V2.md delete mode 100644 src/main/target/CRASHTESTF7/config.c delete mode 100644 src/main/target/CRASHTESTF7/target.c delete mode 100644 src/main/target/CRASHTESTF7/target.h delete mode 100644 src/main/target/CRASHTESTF7/target.mk diff --git a/src/main/target/CRASHTESTF7/TALONF7V2.md b/src/main/target/CRASHTESTF7/TALONF7V2.md deleted file mode 100644 index 8624f95d55..0000000000 --- a/src/main/target/CRASHTESTF7/TALONF7V2.md +++ /dev/null @@ -1,12 +0,0 @@ -MCU: STM32F722RE -IMU: ICM-20602 -IMU Interrupt: yes -BARO: NO -VCP: YES -Hardware UARTS: 6 uarts -OSD: uses a AB7456 chip -Blackbox: flash Chip -PPM/UART NOT Shared: YES -Battery Voltage Sensor: 10:1 -Current sensor: from 4 in 1 socket -Integrated Voltage Regulator: 1.5A 5v/v1 2A 5v/v2 diff --git a/src/main/target/CRASHTESTF7/config.c b/src/main/target/CRASHTESTF7/config.c deleted file mode 100644 index b9c6b5aea5..0000000000 --- a/src/main/target/CRASHTESTF7/config.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software under the terms of the - * GNU General Public License as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * Cleanflight and Betaflight are distributed in the hope that they - * will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software. - * - * If not, see . - */ - -#include -#include -#include - -#include "platform.h" - -#include "pg/pinio.h" -#include "pg/piniobox.h" - -#ifdef USE_TARGET_CONFIG - - -void targetConfiguration(void) { - pinioBoxConfigMutable()->permanentId[0] = 40; -} -#endif diff --git a/src/main/target/CRASHTESTF7/target.c b/src/main/target/CRASHTESTF7/target.c deleted file mode 100644 index c2489acc41..0000000000 --- a/src/main/target/CRASHTESTF7/target.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software under the terms of the - * GNU General Public License as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * Cleanflight and Betaflight are distributed in the hope that they - * will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software. - * - * If not, see . - */ -#include - -#include "platform.h" -#include "drivers/io.h" - -#include "drivers/dma.h" -#include "drivers/timer.h" -#include "drivers/timer_def.h" - -const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { -// FILO arrangement for motor assignments, Motor 1 starts at 2nd DECLARATION - DEF_TIM(TIM2, CH2, PB3, TIM_USE_ANY, 0, 0), // USE FOR CAMERA CONTROL - - DEF_TIM(TIM4, CH1, PB6, TIM_USE_MOTOR, 0, 0), // D1-ST0 MOTOR1 - DEF_TIM(TIM4, CH2, PB7, TIM_USE_MOTOR, 0, 0), // D1-ST3 MOTOR2 - DEF_TIM(TIM4, CH3, PB8, TIM_USE_MOTOR, 0, 0), // D1-ST7 MOTOR3 - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // D2-ST2/D2-ST4 MOTOR4 - DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0), // D1-ST4 MOTOR5 - DEF_TIM(TIM4, CH4, PB9, TIM_USE_MOTOR, 0, 0), // NONE TIM4_UP_D1-ST6 MOTOR6 - DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // D2-ST7 MOTOR7 - - DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR | TIM_USE_LED, 0, 0), // D1-ST2 LED/MOTOR5 - - -}; diff --git a/src/main/target/CRASHTESTF7/target.h b/src/main/target/CRASHTESTF7/target.h deleted file mode 100644 index 859462f588..0000000000 --- a/src/main/target/CRASHTESTF7/target.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * This file is part of Cleanflight and Betaflight. - * - * Cleanflight and Betaflight are free software. You can redistribute - * this software and/or modify this software under the terms of the - * GNU General Public License as published by the Free Software - * Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * Cleanflight and Betaflight are distributed in the hope that they - * will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software. - * - * If not, see . - */ - -#pragma once -#define TARGET_BOARD_IDENTIFIER "S7X2" //not sure if this even shows, but defaults on BF as STM used -#define USBD_PRODUCT_STRING "BotF7" //board name on configurator drop down menu, flasher tab -#define TARGET_MANUFACTURER_IDENTIFIER "BQEio" //Manufacturer abbreviation - -#define USE_TARGET_CONFIG - -#define ENABLE_DSHOT_DMAR true //Dshot default - -//Aux -#define LED0_PIN PB0 //resource led 1 - -#define USE_BEEPER -#define BEEPER_PIN PB4 //resource beeper 1 -#define BEEPER_INVERTED //set beeper_inversion = on - -#define USE_PINIO -#define PINIO1_PIN PA14 // VTX power switcher -#define USE_PINIOBOX - - -//define camera control -#define CAMERA_CONTROL_PIN PB3 // resource camera_control 1 - -//MPU-6000 -#define USE_GYRO //declaring usage of gyro accelerometer and Spi access -#define USE_ACC -#define USE_ACC_SPI_MPU6000 -#define USE_GYRO_SPI_MPU6000 -#define USE_EXTI -#define USE_MPU_DATA_READY_SIGNAL - -#define MPU_INT_EXTI PC4 //gyro_1_exti_pin for mpu6000 -#define MPU6000_CS_PIN PA4 //GYRO_1_CS_PIN -#define MPU6000_SPI_INSTANCE SPI1 //GYRO_1_SPI_INSTANCE -#define GYRO_MPU6000_ALIGN CW0_DEG //set gyro_1_align -#define ACC_MPU6000_ALIGN CW0_DEG //set accel_1_align (normally same as gyro 1) - -// OSD -#define USE_MAX7456 //osd driver -#define MAX7456_SPI_INSTANCE SPI3 // set max7456 -#define MAX7456_SPI_CS_PIN PA15 // resource osd_cs 1 -#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz -#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST) - -// Blackbox -#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT -#define USE_FLASHFS // enable flash blackbox -#define USE_FLASH_M25P16 //defines which driver type -#define FLASH_CS_PIN PB12 //resource flash_cs -#define FLASH_SPI_INSTANCE SPI2 //set flash spi bus - -// Uarts -#define USE_UART1 //enable corresponding UARTS -#define UART1_RX_PIN PA10 //resource serial_rx 1 -#define UART1_TX_PIN PA9 //resource serial_tx 1 - -#define USE_UART2 -#define UART2_RX_PIN PA3 -#define UART2_TX_PIN PA2 - -#define USE_UART3 -#define UART3_RX_PIN PB11 -#define UART3_TX_PIN PB10 - -#define USE_UART4 -#define UART4_RX_PIN PA1 -#define UART4_TX_PIN PA0 - -#define USE_UART5 -#define UART5_RX_PIN PD2 -#define UART5_TX_PIN PC12 - -#define USE_UART6 -#define UART6_RX_PIN PC7 -#define UART6_TX_PIN PC6 - -//#define USE_SOFTSERIAL1 -#define SERIAL_PORT_COUNT 7 //VCP, USART1, USART2,USART3,USART4,USART5,USART6 - -// ESC -#define USE_ADC // enable adc -#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC //define source.. same as battery tab in configurator -#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC -#define CURRENT_METER_ADC_PIN PC1 //resource adc_curr -#define VBAT_ADC_PIN PC2 //resource adc_batt -#define RSSI_ADC_PIN PC3 //resource adc_rssi -#define CURRENT_METER_SCALE_DEFAULT 150 // 3.3/120A = 25mv/A -#define VBAT_SCALE 160 //configurator tab voltage scale - - - - -// SPI devices -#define USE_SPI -#define USE_SPI_DEVICE_1 -#define USE_SPI_DEVICE_2 -#define USE_SPI_DEVICE_3 - -#define SPI1_NSS_PIN PA4 //resource usually matches cs pin of device that calls for it -#define SPI1_SCK_PIN PA5 // resource spi_sck 1 -#define SPI1_MISO_PIN PA6 //resource spi_miso 1 -#define SPI1_MOSI_PIN PA7 //resource spi_mosi - -#define SPI2_NSS_PIN PB12 -#define SPI2_SCK_PIN PB13 -#define SPI2_MISO_PIN PB14 -#define SPI2_MOSI_PIN PB15 - -#define SPI3_NSS_PIN PA15 -#define SPI3_SCK_PIN PC10 -#define SPI3_MISO_PIN PC11 -#define SPI3_MOSI_PIN PB5 - -// USB -#define USE_VCP -#define BINDPLUG_PIN PB2 -#define SERIALRX_PROVIDER SERIALRX_CRSF -#define SERIALRX_UART SERIAL_PORT_USART3 - -//FEATURE -#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_AIRMODE) -#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL - -// IO Ports -#define TARGET_IO_PORTA 0xffff -#define TARGET_IO_PORTB 0xffff -#define TARGET_IO_PORTC 0xffff -#define TARGET_IO_PORTD (BIT(2)) - -// timers -#define USABLE_TIMER_CHANNEL_COUNT 9 //updated timer count to compensate for Nf Motor 4, total timers defined in target.c -#define USED_TIMERS ( TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) ) //update based on update CLRACINGF7 Target BF4.1+ timers defined, enumerated as per use diff --git a/src/main/target/CRASHTESTF7/target.mk b/src/main/target/CRASHTESTF7/target.mk deleted file mode 100644 index 8626fa065d..0000000000 --- a/src/main/target/CRASHTESTF7/target.mk +++ /dev/null @@ -1,8 +0,0 @@ -F7X2RE_TARGETS += $(TARGET) -FEATURES += VCP ONBOARDFLASH -TARGET_SRC = \ - drivers/accgyro/accgyro_mpu.c \ - drivers/accgyro/accgyro_spi_mpu6000.c \ - drivers/compass/compass_hmc5883l.c \ - drivers/compass/compass_qmc5883l.c \ - drivers/max7456.c From 1c7dbddd06086ecc5abb950585c487627cc2f70d Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:15:47 -0600 Subject: [PATCH 11/12] remove extraneous files --- .../target/STM32F7X2/config/CLRACINGF7.config | 89 ------------------- src/main/target/STM32F7X2/config/NERO.config | 88 ------------------ 2 files changed, 177 deletions(-) delete mode 100644 src/main/target/STM32F7X2/config/CLRACINGF7.config delete mode 100644 src/main/target/STM32F7X2/config/NERO.config diff --git a/src/main/target/STM32F7X2/config/CLRACINGF7.config b/src/main/target/STM32F7X2/config/CLRACINGF7.config deleted file mode 100644 index 2675de0d93..0000000000 --- a/src/main/target/STM32F7X2/config/CLRACINGF7.config +++ /dev/null @@ -1,89 +0,0 @@ -# Betaflight / STM32F745 (S745) 4.0.0 Mar 10 2019 / 21:49:53 (d6138c41e) MSP API: 1.41 - -board_name CLRACINGF7 -manufacturer_id CLRC - -# BEEPER -resource BEEPER 1 PB4 -set beeper_inversion = ON -set beeper_od = OFF - -# INDICATOR LED -resource LED 1 B00 - -#MOTOR AND LED -resource MOTOR 1 B06 -resource MOTOR 2 B07 -resource MOTOR 3 B08 -resource MOTOR 4 B09 -resource MOTOR 5 B01 -resource LED_STRIP 1 B01 - -# UARTS -resource SERIAL_TX 1 A09 -resource SERIAL_TX 2 A02 -resource SERIAL_TX 3 B10 -resource SERIAL_TX 4 A00 -resource SERIAL_TX 5 C12 -resource SERIAL_TX 6 C06 -resource SERIAL_RX 1 A10 -resource SERIAL_RX 2 A03 -resource SERIAL_RX 3 B11 -resource SERIAL_RX 4 A01 -resource SERIAL_RX 5 D02 -resource SERIAL_RX 6 C07 - -#SPI BUS -resource SPI_SCK 1 A05 -resource SPI_SCK 2 B13 -resource SPI_SCK 3 C10 -resource SPI_MISO 1 A06 -resource SPI_MISO 2 B14 -resource SPI_MISO 3 C11 -resource SPI_MOSI 1 A07 -resource SPI_MOSI 2 B15 -resource SPI_MOSI 3 B05 - -#ADC -resource ADC_BATT 1 C02 -resource ADC_RSSI 1 C03 -resource ADC_CURR 1 C01 -set current_meter = ADC -set battery_meter = ADC - -#SPI FLASH -resource FLASH_CS 1 B03 -set flash_spi_bus = 2 - -#OSD -resource OSD_CS 1 A15 -set max7456_spi_bus = 3 - -#GYRO -resource GYRO_EXTI 1 C04 -resource GYRO_CS 1 A04 -set gyro_1_bustype = SPI -set gyro_1_spibus = 1 -set gyro_1_sensor_align = CW0 - -# timer -timer B03 0 -timer B06 0 -timer B07 0 -timer B08 0 -timer B09 0 -timer B01 1 - -# dma -dma ADC 1 1 # ADC 1: DMA2 Stream 4 Channel 0 -dma pin B03 0 # pin B03: DMA1 Stream 6 Channel 3 -dma pin B06 0 # pin B06: DMA1 Stream 0 Channel 2 -dma pin B07 0 # pin B07: DMA1 Stream 3 Channel 2 -dma pin B08 0 # pin B08: DMA1 Stream 7 Channel 2 -dma pin B01 0 # pin B01: DMA1 Stream 2 Channel 5 - -# master -set system_hse_mhz = 8 -set dashboard_i2c_bus = 1 -resource RX_BIND_PLUG 1 B02 -resource CAMERA_CONTROL 1 B03 diff --git a/src/main/target/STM32F7X2/config/NERO.config b/src/main/target/STM32F7X2/config/NERO.config deleted file mode 100644 index 48672e785d..0000000000 --- a/src/main/target/STM32F7X2/config/NERO.config +++ /dev/null @@ -1,88 +0,0 @@ -# Usual lawyer stuff here? - -# Name: NERO -# Description: NERO Standard target configuration -# XXX We need something that remembers which config was loaded - -defaults nosave - -# Basic I/O -resource LED 1 B06 -resource LED 2 B05 -resource LED 3 B04 -resource beeper C1 -set beeper_inversion = ON -set beeper_od = OFF - -# Buses -resource I2C_SCL 1 B08 -resource I2C_SDA 1 B09 - -resource SPI_SCK 1 A05 -resource SPI_MISO 1 A06 -resource SPI_MOSI 1 A07 - -resource SPI_SCK 2 B13 -resource SPI_MISO 2 B14 -resource SPI_MOSI 2 B15 - -resource SPI_SCK 3 C10 -resource SPI_MISO 3 C11 -resource SPI_MOSI 3 C12 - -# SPI CS pins to pre-initialize -resource SPI_PREINIT_IPU 1 C04 // MPU6500 -resource SPI_PREINIT_IPU 2 A15 // SDCARD - -# Timers -# First four timers -# timer is zero origin -timer A0 1 -timer A1 1 -timer A2 1 -timer A3 1 -resource MOTOR 1 A0 -resource MOTOR 2 A1 -resource MOTOR 3 A2 -resource MOTOR 4 A3 - -# DMA stream conflict if burst mode is not used -# XXX Need a mechanism to specify dmaopt -set dshot_burst = ON - -# Remaining timers -timer B0 1 -timer B1 1 -timer C7 1 -timer C8 1 -timer C9 1 -resource LED_STRIP B0 -resource PPM C7 - -# Serial ports - -resource SERIAL_TX 1 A9 -resource SERIAL_RX 1 A10 - -resource SERIAL_TX 3 B10 -resource SERIAL_RX 3 B11 - -resource SERIAL_TX 6 C6 -resource SERIAL_RX 6 C7 - -# ADC - -resource ADC_BATT 1 C03 - -# Remaining - -resource ESCSERIAL 1 C07 -resource SDCARD_CS 1 A15 -resource SDCARD_DETECT 1 D02 - -# Some configs - -FEATURE RX_SERIAL -set serialrx_provider = SBUS -serial 5 64 115200 57600 0 115200 -set battery_meter = ADC From cfcab4e48c5940a932620641116da7f0e07f2611 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Sun, 25 Feb 2024 09:28:54 -0600 Subject: [PATCH 12/12] fix commpile warnings - convertSpektrumVtxPowerIndex sPower; proper gating --- src/main/io/spektrum_vtx_control.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/io/spektrum_vtx_control.c b/src/main/io/spektrum_vtx_control.c index b0154d1d25..d591359078 100644 --- a/src/main/io/spektrum_vtx_control.c +++ b/src/main/io/spektrum_vtx_control.c @@ -113,7 +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)) {