From 39612230fde07dccfe70579b1acee873b2d8a44a Mon Sep 17 00:00:00 2001 From: Raphael Hunziker Date: Thu, 10 Sep 2026 20:00:14 +0200 Subject: [PATCH 1/2] Use SD card as default blackbox device on SD-only targets BEEROTORF4, GEPRCF722_BT_HD and SPRACINGF7DUAL define USE_SDCARD but not ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT, so the blackbox device defaulted to BLACKBOX_DEVICE_SERIAL even though the SD card slot is the only onboard logging device on these boards. Fixes #9871 --- src/main/target/BEEROTORF4/target.h | 1 + src/main/target/GEPRCF722_BT_HD/target.h | 1 + src/main/target/SPRACINGF7DUAL/target.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/target/BEEROTORF4/target.h b/src/main/target/BEEROTORF4/target.h index 1ff901b870a..73f9e029116 100644 --- a/src/main/target/BEEROTORF4/target.h +++ b/src/main/target/BEEROTORF4/target.h @@ -51,6 +51,7 @@ #define SDCARD_DETECT_PIN PC3 #define SDCARD_SPI_BUS BUS_SPI2 #define SDCARD_CS_PIN SPI2_NSS_PIN +#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT #define USE_VCP #define VBUS_SENSING_ENABLED diff --git a/src/main/target/GEPRCF722_BT_HD/target.h b/src/main/target/GEPRCF722_BT_HD/target.h index 5494ed83009..e388203c6aa 100644 --- a/src/main/target/GEPRCF722_BT_HD/target.h +++ b/src/main/target/GEPRCF722_BT_HD/target.h @@ -80,6 +80,7 @@ #define USE_SDCARD_SPI #define SDCARD_SPI_BUS BUS_SPI3 #define SDCARD_CS_PIN PB9 +#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT #define USE_SPI_DEVICE_3 diff --git a/src/main/target/SPRACINGF7DUAL/target.h b/src/main/target/SPRACINGF7DUAL/target.h index 11e1bc934d8..bafaf8fd508 100644 --- a/src/main/target/SPRACINGF7DUAL/target.h +++ b/src/main/target/SPRACINGF7DUAL/target.h @@ -125,6 +125,7 @@ #define SPI3_MOSI_PIN PB5 #define SDCARD_SPI_BUS BUS_SPI3 #define SDCARD_CS_PIN PC3 +#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT #define GYRO_1_CS_PIN SPI1_NSS_PIN #define GYRO_1_SPI_INSTANCE BUS_SPI1 From 03c0f30b607874ad43c0ebc42a0182e0095acb55 Mon Sep 17 00:00:00 2001 From: Raphael Hunziker Date: Thu, 10 Sep 2026 20:00:14 +0200 Subject: [PATCH 2/2] Log amperage for every configured current meter type The amperage field was gated on current_meter_type being ADC, a leftover from when the condition was still named FLIGHT_LOG_FIELD_CONDITION_AMPERAGE_ADC. The logged value comes from getAmperage(), which is maintained for every current meter type, so ESC, CRSF, SmartPort, CAN, INA226 and virtual meters produced no amperage field at all. Use isAmperageConfigured(), the same predicate taskUpdateBattery() uses to decide whether an amperage value is updated, so no field is written when there is no current source. Fixes #8966 --- src/main/blackbox/blackbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index 6c32d4e36eb..53c27aa11ac 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -805,7 +805,7 @@ static bool testBlackboxConditionUncached(FlightLogFieldCondition condition) return feature(FEATURE_VBAT); case FLIGHT_LOG_FIELD_CONDITION_AMPERAGE: - return feature(FEATURE_CURRENT_METER) && batteryMetersConfig()->current.type == CURRENT_SENSOR_ADC; + return isAmperageConfigured(); case FLIGHT_LOG_FIELD_CONDITION_SURFACE: #ifdef USE_RANGEFINDER