From 53991492a7f29dc8bad2b57fb349283db384cde4 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:09:15 -0500 Subject: [PATCH] [target] update NERO --- src/main/target/NERO/target.c | 18 +++++++++--------- src/main/target/NERO/target.h | 28 ++++++++++++++++++++++++---- src/main/target/NERO/target.mk | 10 +++++++--- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/main/target/NERO/target.c b/src/main/target/NERO/target.c index 32b61c4a52..ca539b0c66 100644 --- a/src/main/target/NERO/target.c +++ b/src/main/target/NERO/target.c @@ -28,13 +28,13 @@ #include "drivers/timer_def.h" const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { - DEF_TIM(TIM3, CH2, PC7, TIM_USE_PPM, 0, 0 ), - DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 1 ), - DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR | TIM_USE_LED, 0, 0 ), - DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0 ), - DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0 ), + DEF_TIM(TIM3, CH2, PC7, TIM_USE_PPM, 0, 0), + DEF_TIM(TIM5, CH1, PA0, TIM_USE_MOTOR, 0, 0), // motor 1 + DEF_TIM(TIM5, CH2, PA1, TIM_USE_MOTOR, 0, 0), // motor 2 + DEF_TIM(TIM5, CH3, PA2, TIM_USE_MOTOR, 0, 0), // motor 3 + DEF_TIM(TIM5, CH4, PA3, TIM_USE_MOTOR, 0, 0), // motor 4 + DEF_TIM(TIM3, CH3, PB0, TIM_USE_MOTOR | TIM_USE_LED, 0, 0), // motor 5 and LED_STRIP + DEF_TIM(TIM3, CH4, PB1, TIM_USE_MOTOR, 0, 0), // motor 6 + DEF_TIM(TIM8, CH3, PC8, TIM_USE_MOTOR, 0, 0), // motor 7 + DEF_TIM(TIM8, CH4, PC9, TIM_USE_MOTOR, 0, 0), // motor 8 }; diff --git a/src/main/target/NERO/target.h b/src/main/target/NERO/target.h index 3c11c6dac5..2f6db626aa 100644 --- a/src/main/target/NERO/target.h +++ b/src/main/target/NERO/target.h @@ -19,17 +19,30 @@ */ #pragma once -#define TARGET_BOARD_IDENTIFIER "NERO" +#define TARGET_MANUFACTURER_IDENTIFIER "BKMN" +#define USBD_PRODUCT_STRING "NERO" -#define USBD_PRODUCT_STRING "NERO" +#define FC_TARGET_MCU STM32F7X2 // not used in EmuF +#define TARGET_BOARD_IDENTIFIER "S7X2" // generic ID + +#define USE_ACC +#define USE_ACC_SPI_MPU6500 +#define USE_ACC_SPI_ICM20602 // detected by MPU6500 code +#define USE_GYRO +#define USE_GYRO_SPI_MPU6500 +#define USE_GYRO_SPI_ICM20602 // detected by MPU6500 code +#define USE_SDCARD #define HW_PIN PB2 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define USE_LED #define LED0_PIN PB6 #define LED1_PIN PB5 #define LED2_PIN PB4 +#define LED_STRIP_PIN PB0 // Shared with MOTOR5_PIN +#define MOTOR5_PIN PB0 // Shared with LED_STRIP_PIN #define USE_BEEPER #define BEEPER_PIN PC1 @@ -55,7 +68,7 @@ #define GYRO_MPU6500_ALIGN CW0_DEG #define USE_SDCARD - +#define USE_SDCARD_SDIO #define SDCARD_DETECT_INVERTED #define SDCARD_DETECT_PIN PD2 #define SDCARD_SPI_INSTANCE SPI3 @@ -96,6 +109,7 @@ #define SERIAL_PORT_COUNT 6 +#define ENABLE_DSHOT_DMAR true #define USE_ESCSERIAL #define ESCSERIAL_TIMER_TX_PIN PC7 // (Hardware=0, PPM) @@ -121,10 +135,16 @@ #define USE_ADC #define VBAT_ADC_PIN PC3 +#define CURRENT_METER_ADC_PIN PC2 +#define RSSI_ADC_PIN PA4 +#define ADC1_DMA_OPT 1 +#define ADC1_DMA_STREAM DMA2_Stream4 //# ADC 1: DMA2 Stream 4 Channel 0 +#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC +#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT -#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL +#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_AIRMODE | FEATURE_RX_SERIAL) #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART6 diff --git a/src/main/target/NERO/target.mk b/src/main/target/NERO/target.mk index e2e1a265d5..c648832f84 100644 --- a/src/main/target/NERO/target.mk +++ b/src/main/target/NERO/target.mk @@ -1,6 +1,10 @@ F7X2RE_TARGETS += $(TARGET) -FEATURES += SDCARD VCP +FEATURES += VCP SDCARD TARGET_SRC = \ - drivers/accgyro/accgyro_spi_mpu6500.c \ - drivers/accgyro/accgyro_mpu6500.c +drivers/accgyro/accgyro_mpu.c \ +drivers/accgyro/accgyro_mpu6500.c \ +drivers/accgyro/accgyro_spi_mpu6500.c \ +drivers/light_led.h \ +drivers/light_ws2811strip.c \ +drivers/max7456.c \