diff options
-rw-r--r-- | apps/screens.c | 23 | ||||
-rw-r--r-- | firmware/export/config-fmrecorder.h | 3 | ||||
-rw-r--r-- | firmware/export/config-recorderv2.h | 3 |
3 files changed, 21 insertions, 8 deletions
diff --git a/apps/screens.c b/apps/screens.c index 7f637b1558..32e6936d7b 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -140,17 +140,24 @@ void charging_display_info(bool animate) | |||
140 | const int pox_y = 32; | 140 | const int pox_y = 32; |
141 | static unsigned phase = 3; | 141 | static unsigned phase = 3; |
142 | unsigned i; | 142 | unsigned i; |
143 | int battery_voltage; | ||
144 | int batt_int, batt_frac; | ||
145 | char buf[32]; | 143 | char buf[32]; |
144 | (void)buf; | ||
146 | 145 | ||
147 | battery_voltage = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000; | 146 | #ifdef NEED_ATA_POWER_BATT_MEASURE |
148 | batt_int = battery_voltage / 100; | 147 | if (ide_powered()) /* FM and V2 can only measure when ATA power is on */ |
149 | batt_frac = battery_voltage % 100; | 148 | #endif |
149 | { | ||
150 | int battery_voltage; | ||
151 | int batt_int, batt_frac; | ||
150 | 152 | ||
151 | snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac, | 153 | battery_voltage = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000; |
152 | battery_level()); | 154 | batt_int = battery_voltage / 100; |
153 | lcd_puts(0, 7, buf); | 155 | batt_frac = battery_voltage % 100; |
156 | |||
157 | snprintf(buf, 32, " Batt: %d.%02dV %d%% ", batt_int, batt_frac, | ||
158 | battery_level()); | ||
159 | lcd_puts(0, 7, buf); | ||
160 | } | ||
154 | 161 | ||
155 | #ifdef HAVE_CHARGE_CTRL | 162 | #ifdef HAVE_CHARGE_CTRL |
156 | 163 | ||
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 264f9984aa..d7e6c8f8f7 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h | |||
@@ -22,6 +22,9 @@ | |||
22 | /* Define this if you need to power on ATA */ | 22 | /* Define this if you need to power on ATA */ |
23 | #define NEEDS_ATA_POWER_ON | 23 | #define NEEDS_ATA_POWER_ON |
24 | 24 | ||
25 | /* Define this if battery voltage can only be measured with ATA powered */ | ||
26 | #define NEED_ATA_POWER_BATT_MEASURE | ||
27 | |||
25 | /* Define this to the CPU frequency */ | 28 | /* Define this to the CPU frequency */ |
26 | #define CPU_FREQ 11059200 | 29 | #define CPU_FREQ 11059200 |
27 | 30 | ||
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 264f9984aa..d7e6c8f8f7 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h | |||
@@ -22,6 +22,9 @@ | |||
22 | /* Define this if you need to power on ATA */ | 22 | /* Define this if you need to power on ATA */ |
23 | #define NEEDS_ATA_POWER_ON | 23 | #define NEEDS_ATA_POWER_ON |
24 | 24 | ||
25 | /* Define this if battery voltage can only be measured with ATA powered */ | ||
26 | #define NEED_ATA_POWER_BATT_MEASURE | ||
27 | |||
25 | /* Define this to the CPU frequency */ | 28 | /* Define this to the CPU frequency */ |
26 | #define CPU_FREQ 11059200 | 29 | #define CPU_FREQ 11059200 |
27 | 30 | ||