1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

FIX CONFIG: MATEKF405TEMINI SPI3 + CONFIG DEFAULT_VOLTAGE_METER_SCALE + SYSTEM_HSE_MHZ (#12468)

* Fix MATEKF405TEMINI

* Add VBAT_SCALE

* Fix SYSTEM_HSE_MHZ
This commit is contained in:
Mark Haslinghuis 2023-03-07 04:49:23 +01:00 committed by GitHub
parent b2b134b2c1
commit f41b3e911d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 66 additions and 58 deletions

View file

@ -104,7 +104,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define DEFAULT_CURRENT_METER_SCALE 166
#define BEEPER_INVERTED
#define MAX7456_SPI_INSTANCE SPI2

View file

@ -99,7 +99,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 111
#define DEFAULT_VOLTAGE_METER_SCALE 111
#define DEFAULT_CURRENT_METER_SCALE 182
#define BEEPER_INVERTED
//TODO #define OSD_DISPLAYPORT_DEVICE MAX7456

View file

@ -111,7 +111,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ESC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 100
#define BEEPER_INVERTED
#define USE_SDCARD_SPI

View file

@ -111,7 +111,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 100
#define BEEPER_INVERTED
#define USE_SDCARD_SPI

View file

@ -110,7 +110,7 @@
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_SDCARD
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 109
#define DEFAULT_VOLTAGE_METER_SCALE 109
#define DEFAULT_CURRENT_METER_SCALE 168
#define BEEPER_INVERTED
//TODO #define SDCARD_DETECT_INVERTED ON

View file

@ -111,7 +111,7 @@
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 168
#define BEEPER_INVERTED
//TODO #define SDCARD_MODE OFF

View file

@ -110,7 +110,7 @@
//TODO #define SDCARD_MODE OFF
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 109
#define DEFAULT_VOLTAGE_METER_SCALE 109
#define DEFAULT_CURRENT_METER_SCALE 168
#define BEEPER_INVERTED
#define FLASH_SPI_INSTANCE SPI1

View file

@ -128,7 +128,7 @@
#define BEEPER_INVERTED
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 400
//TODO #define PINIO_CONFIG 129,1,1,1
//TODO #define PINIO_BOX 0,255,255,255

View file

@ -109,7 +109,7 @@
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 210
#define DEFAULT_VOLTAGE_METER_SCALE 210
#define DEFAULT_CURRENT_METER_SCALE 150
#define BEEPER_INVERTED
#define SYSTEM_HSE_MHZ 8

View file

@ -66,10 +66,13 @@
#define LED1_PIN PA13
#define SPI1_SCK_PIN PA5
#define SPI2_SCK_PIN PB13
#define SPI3_SCK_PIN NONE
#define SPI1_MISO_PIN PB4
#define SPI2_MISO_PIN PC2
#define SPI3_MISO_PIN NONE
#define SPI1_MOSI_PIN PA7
#define SPI2_MOSI_PIN PC3
#define SPI3_MOSI_PIN NONE
#define ADC_VBAT_PIN PC4
#define ADC_RSSI_PIN PB0
#define ADC_CURR_PIN PC5
@ -83,43 +86,45 @@
#define GYRO_1_CS_PIN PC14
#define TIMER_PIN_MAPPING \
TIMER_PIN_MAP( 0, PC9 , 2, 0) \
TIMER_PIN_MAP( 1, PC8 , 2, 0) \
TIMER_PIN_MAP( 2, PB15, 1, 1) \
TIMER_PIN_MAP( 3, PA8 , 1, 1) \
TIMER_PIN_MAP( 4, PB11, 1, 0) \
TIMER_PIN_MAP( 5, PB10, 1, 0) \
TIMER_PIN_MAP( 6, PB3 , 1, 0) \
TIMER_PIN_MAP( 7, PA15, 1, 0) \
TIMER_PIN_MAP( 8, PB14, 3, -1) \
TIMER_PIN_MAP( 9, PA6 , 2, -1) \
TIMER_PIN_MAP(10, PB6 , 1, 0) \
TIMER_PIN_MAP(11, PB1 , 2, 0) \
TIMER_PIN_MAP(12, PB9 , 2, -1) \
TIMER_PIN_MAP(13, PA3 , 3, -1) \
TIMER_PIN_MAP(14, PA2 , 2, 0)
TIMER_PIN_MAP( 0, MOTOR1_PIN, 2, 0) \
TIMER_PIN_MAP( 1, MOTOR2_PIN, 2, 0) \
TIMER_PIN_MAP( 2, MOTOR3_PIN, 1, 1) \
TIMER_PIN_MAP( 3, MOTOR4_PIN, 1, 1) \
TIMER_PIN_MAP( 4, MOTOR5_PIN, 1, 0) \
TIMER_PIN_MAP( 5, MOTOR6_PIN, 1, 0) \
TIMER_PIN_MAP( 6, MOTOR7_PIN, 1, 0) \
TIMER_PIN_MAP( 7, MOTOR8_PIN, 1, 0) \
TIMER_PIN_MAP( 8, SERVO1_PIN, 3, -1) \
TIMER_PIN_MAP( 9, SERVO2_PIN, 2, -1) \
TIMER_PIN_MAP(10, SERVO3_PIN, 1, 0) \
TIMER_PIN_MAP(11, LED_STRIP_PIN, 2, 0) \
TIMER_PIN_MAP(12, BEEPER_PIN, 2, -1) \
TIMER_PIN_MAP(13, RX_PPM_PIN, 3, -1) \
TIMER_PIN_MAP(14, UART2_TX_PIN, 2, 0)
#define ADC1_DMA_OPT 1
#define ADC1_DMA_OPT 1
//TODO #define MAG_BUSTYPE I2C
#define MAG_I2C_INSTANCE (I2CDEV_1)
#define MAG_I2C_INSTANCE (I2CDEV_1)
//TODO #define MAG_HARDWARE AUTO
#define USE_BARO
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 210
#define DEFAULT_CURRENT_METER_SCALE 150
#define BARO_I2C_INSTANCE (I2CDEV_1)
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_VOLTAGE_METER_SCALE 210
#define DEFAULT_CURRENT_METER_SCALE 150
#define BEEPER_INVERTED
#define SYSTEM_HSE_MHZ 8
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
#define MAX7456_SPI_INSTANCE SPI1
#define SYSTEM_HSE_MHZ 8
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
#define MAX7456_SPI_INSTANCE SPI1
//TODO #define PINIO_BOX 40,41,255,255
#define FLASH_SPI_INSTANCE SPI2
#define FLASH_SPI_INSTANCE SPI2
#define USE_SPI_GYRO
#define GYRO_1_SPI_INSTANCE SPI1
#define GYRO_1_ALIGN CW270_DEG_FLIP
#define GYRO_1_ALIGN_PITCH 1800
#define GYRO_1_ALIGN_YAW 2700
//TODO #define SERIALRX_PROVIDER CRSF
#define GYRO_1_SPI_INSTANCE SPI1
#define GYRO_1_ALIGN CW270_DEG_FLIP
#define GYRO_1_ALIGN_PITCH 1800
#define GYRO_1_ALIGN_YAW 2700
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_CRSF

View file

@ -157,7 +157,7 @@
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define VBAT_SCALE_DEFAULT 110
#define DEFAULT_VOLTAGE_METER_SCALE_DEFAULT 110
#define DEFAULT_CURRENT_METER_SCALE 250
#define BEEPER_INVERTED
#define BEEPER_PWM_HZ 2500

View file

@ -106,7 +106,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 210
#define DEFAULT_VOLTAGE_METER_SCALE 210
#define DEFAULT_CURRENT_METER_SCALE 100
#define BEEPER_INVERTED
#define MAX7456_SPI_INSTANCE SPI4

View file

@ -81,7 +81,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define DEFAULT_CURRENT_METER_SCALE 150
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -92,7 +92,7 @@
#define MAX7456_SPI_INSTANCE SPI2
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define DEFAULT_CURRENT_METER_SCALE 250
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -105,7 +105,7 @@
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SCALE 250
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1
#define MAX7456_SPI_INSTANCE SPI3

View file

@ -90,7 +90,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 80
#define DEFAULT_VOLTAGE_METER_SCALE 80
#define DEFAULT_CURRENT_METER_SCALE 210
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -106,7 +106,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 490
#define BEEPER_INVERTED
#define USE_SDCARD_SPI

View file

@ -106,7 +106,7 @@
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_ON
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 250
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -100,7 +100,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define DEFAULT_CURRENT_METER_SCALE 150
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -95,7 +95,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 160
#define DEFAULT_VOLTAGE_METER_SCALE 160
#define DEFAULT_CURRENT_METER_SCALE 150
#define BEEPER_INVERTED
//TODO #define PID_PROCESS_DENOM 1

View file

@ -112,7 +112,7 @@
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
#define DEFAULT_CURRENT_METER_SCALE 68
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define BEEPER_INVERTED
#define FLASH_SPI_INSTANCE SPI3
#define MAX7456_SPI_INSTANCE SPI2

View file

@ -93,7 +93,7 @@
//TODO #define MOTOR_PWM_PROTOCOL DSHOT600
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
//TODO #define VBAT_SCALE 110
#define DEFAULT_VOLTAGE_METER_SCALE 110
#define DEFAULT_CURRENT_METER_SCALE 350
#define BEEPER_INVERTED
#define MAX7456_SPI_INSTANCE SPI3

View file

@ -124,7 +124,7 @@ PG_RESET_TEMPLATE(systemConfig_t, systemConfig,
.cpu_overclock = DEFAULT_CPU_OVERCLOCK,
.powerOnArmingGraceTime = 5,
.boardIdentifier = TARGET_BOARD_IDENTIFIER,
.hseMhz = SYSTEM_HSE_VALUE, // Only used for F4 and G4 targets
.hseMhz = SYSTEM_HSE_MHZ, // Only used for F4 and G4 targets
.configurationState = CONFIGURATION_STATE_DEFAULTS_BARE,
.enableStickArming = false,
);

View file

@ -97,8 +97,8 @@ void voltageMeterReset(voltageMeter_t *meter)
// ADC
//
#ifndef VBAT_SCALE_DEFAULT
#define VBAT_SCALE_DEFAULT 110
#ifndef DEFAULT_VOLTAGE_METER_SCALE
#define DEFAULT_VOLTAGE_METER_SCALE 110
#endif
#ifndef VBAT_RESDIVVAL_DEFAULT
@ -134,7 +134,7 @@ void pgResetFn_voltageSensorADCConfig(voltageSensorADCConfig_t *instance)
{
for (int i = 0; i < MAX_VOLTAGE_SENSOR_ADC; i++) {
RESET_CONFIG(voltageSensorADCConfig_t, &instance[i],
.vbatscale = VBAT_SCALE_DEFAULT,
.vbatscale = DEFAULT_VOLTAGE_METER_SCALE,
.vbatresdivval = VBAT_RESDIVVAL_DEFAULT,
.vbatresdivmultiplier = VBAT_RESDIVMULTIPLIER_DEFAULT,
);

View file

@ -31,6 +31,7 @@
#define SIMULATOR_MULTITHREAD
#define SYSTEM_HSE_MHZ 0
#define DEFAULT_CPU_OVERCLOCK 1
#define DMA_RAM
#define DMA_RW_AXI

View file

@ -386,8 +386,10 @@
// Setup crystal frequency on F4 for backward compatibility
// Should be set to zero for generic targets to ensure USB is working
// when unconfigured for targets with non-standard crystal.
// Can be set at runtime with with CLI parameter 'system_hse_value'.
#define SYSTEM_HSE_VALUE 0
// Can be set at runtime with with CLI parameter 'system_hse_mhz'.
#ifndef SYSTEM_HSE_MHZ
#define SYSTEM_HSE_MHZ 0
#endif
// Number of pins that needs pre-init
#ifdef USE_SPI