[FixRed] Bootloaders, devices without size_t defined

Change-Id: I452760478ea7324458a05c7af0a88bcbe92def45
This commit is contained in:
William Wilgus 2025-03-06 12:39:37 -05:00
parent 10f8312db4
commit a1fd56ba8e
3 changed files with 9 additions and 6 deletions

View file

@ -32,7 +32,7 @@ struct battery_tables_t {
unsigned short * const discharge; unsigned short * const discharge;
#if CONFIG_CHARGING #if CONFIG_CHARGING
unsigned short * const charge; unsigned short * const charge;
const size_t elems; const unsigned short elems;
bool isdefault; bool isdefault;
#endif #endif
}; };

View file

@ -113,7 +113,7 @@ struct battery_tables_t {
unsigned short * const discharge; unsigned short * const discharge;
#if CONFIG_CHARGING #if CONFIG_CHARGING
unsigned short * const charge; unsigned short * const charge;
const size_t elems; const unsigned short elems;
bool isdefault; bool isdefault;
#endif #endif
}; };

View file

@ -36,9 +36,6 @@
#include "backlight.h" #include "backlight.h"
#include "lcd.h" #include "lcd.h"
#include "rtc.h" #include "rtc.h"
#include "misc.h"
#include "splash.h"
#include "version.h"
#if CONFIG_TUNER #if CONFIG_TUNER
#include "fmradio.h" #include "fmradio.h"
#endif #endif
@ -65,6 +62,10 @@ extern unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11];
extern unsigned short percent_to_volt_charge[11]; extern unsigned short percent_to_volt_charge[11];
#endif #endif
#ifndef BOOTLOADER
#include "misc.h"
#include "splash.h"
struct battery_tables_t device_battery_tables = struct battery_tables_t device_battery_tables =
{ {
.history = power_history, .history = power_history,
@ -77,6 +78,7 @@ struct battery_tables_t device_battery_tables =
.elems = ARRAYLEN(percent_to_volt_discharge[0]), .elems = ARRAYLEN(percent_to_volt_discharge[0]),
.isdefault = true, .isdefault = true,
}; };
#endif
static int last_sent_battery_level = 100; static int last_sent_battery_level = 100;
static void set_sleep_timer(int seconds); static void set_sleep_timer(int seconds);
@ -849,7 +851,7 @@ static void power_thread(void)
} }
} /* power_thread */ } /* power_thread */
#if !defined(BOOTLOADER)
static bool battery_table_readln(int fd, char * buf, size_t bufsz, static bool battery_table_readln(int fd, char * buf, size_t bufsz,
const char *name, char **value, int* linect) INIT_ATTR; const char *name, char **value, int* linect) INIT_ATTR;
static bool battery_table_readln(int fd, char * buf, size_t bufsz, static bool battery_table_readln(int fd, char * buf, size_t bufsz,
@ -893,6 +895,7 @@ static bool battery_table_readln(int fd, char * buf, size_t bufsz,
} }
return rd > 0; return rd > 0;
} }
#endif
void init_battery_tables(void) void init_battery_tables(void)
{ {