diff --git a/openrtx/src/core/battery.c b/openrtx/src/core/battery.c index 88ba5b84..b3501def 100644 --- a/openrtx/src/core/battery.c +++ b/openrtx/src/core/battery.c @@ -26,16 +26,16 @@ * Obtained by multiplying the values in volt by 256. */ -#if defined BAT_LIPO_1S +#if defined CONFIG_BAT_LIPO_1S static const uint16_t bat_v_min = 0x039C; // 3.61V static const uint16_t bat_v_max = 0x0426; // 4.15V -#elif defined BAT_LIPO_2S +#elif defined CONFIG_BAT_LIPO_2S static const uint16_t bat_v_min = 0x071A; // 7.10V static const uint16_t bat_v_max = 0x0819; // 8.10V -#elif defined BAT_LIPO_3S +#elif defined CONFIG_BAT_LIPO_3S static const uint16_t bat_v_min = 0x0AD4; // 10.83V static const uint16_t bat_v_max = 0x0C73; // 12.45V -#elif defined BAT_NONE +#elif defined CONFIG_BAT_NONE // Nothing to do, just avoid arising the compiler error #else #error Please define a battery type into platform/targets/.../hwconfig.h @@ -43,7 +43,7 @@ static const uint16_t bat_v_max = 0x0C73; // 12.45V uint8_t battery_getCharge(uint16_t vbat) { - #ifdef BAT_NONE + #ifdef CONFIG_BAT_NONE /* Return full charge if no battery is present. */ (void) vbat; return 100; diff --git a/openrtx/src/ui/default/ui_main.c b/openrtx/src/ui/default/ui_main.c index 97812f8a..283a3043 100644 --- a/openrtx/src/ui/default/ui_main.c +++ b/openrtx/src/ui/default/ui_main.c @@ -45,7 +45,7 @@ void _ui_drawMainTop(ui_state_t * ui_state) local_time.minute, local_time.second); #endif // If the radio has no built-in battery, print input voltage -#ifdef BAT_NONE +#ifdef CONFIG_BAT_NONE gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT, color_white,"%.1fV", last_state.v_bat); #else diff --git a/platform/targets/DM-1801/hwconfig.h b/platform/targets/DM-1801/hwconfig.h index 36f8e4f9..b2d613d8 100644 --- a/platform/targets/DM-1801/hwconfig.h +++ b/platform/targets/DM-1801/hwconfig.h @@ -43,7 +43,7 @@ extern "C" { #define CONFIG_SCREEN_BRIGHTNESS /* Battery type */ -#define BAT_LIPO_2S +#define CONFIG_BAT_LIPO_2S #ifdef __cplusplus } diff --git a/platform/targets/GD-77/hwconfig.h b/platform/targets/GD-77/hwconfig.h index 36f8e4f9..b2d613d8 100644 --- a/platform/targets/GD-77/hwconfig.h +++ b/platform/targets/GD-77/hwconfig.h @@ -43,7 +43,7 @@ extern "C" { #define CONFIG_SCREEN_BRIGHTNESS /* Battery type */ -#define BAT_LIPO_2S +#define CONFIG_BAT_LIPO_2S #ifdef __cplusplus } diff --git a/platform/targets/MD-3x0/hwconfig.h b/platform/targets/MD-3x0/hwconfig.h index 0bc8f60a..3799538e 100644 --- a/platform/targets/MD-3x0/hwconfig.h +++ b/platform/targets/MD-3x0/hwconfig.h @@ -47,7 +47,7 @@ extern "C" { #define CONFIG_SCREEN_BRIGHTNESS /* Battery type */ -#define BAT_LIPO_2S +#define CONFIG_BAT_LIPO_2S #ifdef __cplusplus } diff --git a/platform/targets/MD-9600/hwconfig.h b/platform/targets/MD-9600/hwconfig.h index 6b90387c..070f8ae0 100644 --- a/platform/targets/MD-9600/hwconfig.h +++ b/platform/targets/MD-9600/hwconfig.h @@ -46,7 +46,7 @@ extern "C" { #define CONFIG_PIX_FMT_BW /* Battery type */ -#define BAT_NONE +#define CONFIG_BAT_NONE #ifdef __cplusplus } diff --git a/platform/targets/MD-UV3x0/hwconfig.h b/platform/targets/MD-UV3x0/hwconfig.h index 50de89c3..ea6bfdec 100644 --- a/platform/targets/MD-UV3x0/hwconfig.h +++ b/platform/targets/MD-UV3x0/hwconfig.h @@ -41,7 +41,7 @@ extern "C" { #define CONFIG_PIX_FMT_RGB565 /* Battery type */ -#define BAT_LIPO_2S +#define CONFIG_BAT_LIPO_2S /* * To enable pwm for display backlight dimming uncomment this directive. diff --git a/platform/targets/Module17/hwconfig.h b/platform/targets/Module17/hwconfig.h index c06890c7..cc8e3735 100644 --- a/platform/targets/Module17/hwconfig.h +++ b/platform/targets/Module17/hwconfig.h @@ -37,6 +37,6 @@ #define CONFIG_PIX_FMT_BW /* Device has no battery */ -#define BAT_NONE +#define CONFIG_BAT_NONE #endif diff --git a/platform/targets/linux/hwconfig.h b/platform/targets/linux/hwconfig.h index a41ed72a..a1376cd8 100644 --- a/platform/targets/linux/hwconfig.h +++ b/platform/targets/linux/hwconfig.h @@ -26,7 +26,7 @@ extern "C" { #define CONFIG_SCREEN_BRIGHTNESS /* Battery type */ -#define BAT_LIPO_2S +#define CONFIG_BAT_LIPO_2S #ifdef __cplusplus } diff --git a/platform/targets/ttwrplus/hwconfig.h b/platform/targets/ttwrplus/hwconfig.h index 9140cfbc..5da4c77e 100644 --- a/platform/targets/ttwrplus/hwconfig.h +++ b/platform/targets/ttwrplus/hwconfig.h @@ -31,6 +31,6 @@ #define CONFIG_PIX_FMT_BW #define GPS_PRESENT -#define BAT_LIPO_1S +#define CONFIG_BAT_LIPO_1S #endif /* HWCONFIG_H */