summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorZakk Roberts <midk@rockbox.org>2006-04-15 13:07:21 +0000
committerZakk Roberts <midk@rockbox.org>2006-04-15 13:07:21 +0000
commit16a57e2e4fcb29f84d6ce44a011d341378270c1f (patch)
tree4c1a4187802ddf8cf8d230bd30a8168e311544e3 /firmware
parent97c3a6f10ac2babe2d6ff3a18823960fff0482e4 (diff)
downloadrockbox-16a57e2e4fcb29f84d6ce44a011d341378270c1f.tar.gz
rockbox-16a57e2e4fcb29f84d6ce44a011d341378270c1f.tar.bz2
rockbox-16a57e2e4fcb29f84d6ce44a011d341378270c1f.zip
Also add a config-specific 'Default' value, this should fix the sim builds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9680 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config-fmrecorder.h2
-rw-r--r--firmware/export/config-gigabeat.h2
-rw-r--r--firmware/export/config-gmini120.h2
-rw-r--r--firmware/export/config-gminisp.h2
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/export/config-h300.h2
-rw-r--r--firmware/export/config-iaudiox5.h2
-rw-r--r--firmware/export/config-ipod3g.h2
-rw-r--r--firmware/export/config-ipod4g.h2
-rw-r--r--firmware/export/config-ipodcolor.h2
-rw-r--r--firmware/export/config-ipodmini.h2
-rwxr-xr-xfirmware/export/config-ipodmini2g.h2
-rw-r--r--firmware/export/config-ipodnano.h2
-rw-r--r--firmware/export/config-ipodvideo.h2
-rw-r--r--firmware/export/config-ondiofm.h2
-rw-r--r--firmware/export/config-ondiosp.h2
-rw-r--r--firmware/export/config-player.h2
-rw-r--r--firmware/export/config-recorder.h2
-rw-r--r--firmware/export/config-recorderv2.h2
-rw-r--r--firmware/powermgmt.c38
21 files changed, 59 insertions, 19 deletions
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 125956691b..8711640e93 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -44,6 +44,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
+#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
index ec36de413e..83a92ce140 100644
--- a/firmware/export/config-gigabeat.h
+++ b/firmware/export/config-gigabeat.h
@@ -42,6 +42,8 @@
/* Define this if you have the WM8975 audio codec */
#define HAVE_WM8751
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
index e402d9e3c1..42424bb7b1 100644
--- a/firmware/export/config-gmini120.h
+++ b/firmware/export/config-gmini120.h
@@ -30,6 +30,8 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000
+#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a TCC730 (CalmRISC16) */
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h
index aa0bf09bb4..e066661061 100644
--- a/firmware/export/config-gminisp.h
+++ b/firmware/export/config-gminisp.h
@@ -21,6 +21,8 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000
+#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a TCC730 (CalmRISC16) */
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 62d262c16b..942f18adf3 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -58,6 +58,8 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#define AB_REPEAT_ENABLE 1
#define CONFIG_TUNER TEA5767
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index a577a369c7..186203c648 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -64,6 +64,8 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING 1
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 947a42e776..ae1940c987 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -64,6 +64,8 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING 1
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5249 */
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 2a16bafc07..4690feb8fe 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -53,6 +53,8 @@
/* The number of bytes reserved for loadable plugins */
#define PLUGIN_BUFFER_SIZE 0x80000
+#define BATTERY_CAPACITY_DEFAULT 950 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a Motorola SCF5250 */
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 62950b8d09..a611dfdcaa 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -50,6 +50,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD3G /* port controlled */
+#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5002 */
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 68b5d5f3b9..fa664acdb6 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -52,6 +52,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */
+#define BATTERY_CAPACITY_DEFAULT 630 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5020 */
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 7da7f0fc4e..b8f3d89346 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -51,6 +51,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPOD4G /* port controlled */
+#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5020 */
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index 047c9926ef..64be801577 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -52,6 +52,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_IPODMINI /* port controlled */
+#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5020 */
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index cd3daa9b81..454309a786 100755
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -55,6 +55,8 @@
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING
+#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5020 */
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 026355af60..b7116bf249 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -54,6 +54,8 @@
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#ifndef SIMULATOR
/* The Nano actually has a PP5021 - but it's register compatible with
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index 54b32265e1..1bbcfec157 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -54,6 +54,8 @@
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING
+#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
+
#ifndef SIMULATOR
/* The Nano actually has a PP5021 - but it's register compatible with
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index acaba63264..cb2033a9dc 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -28,6 +28,8 @@
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
+#define BATTERY_CAPACITY_DEFAULT 500 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 567bc0a161..3612300353 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -21,6 +21,8 @@
/* Define this if you have a MAS3539F */
#define CONFIG_CODEC MAS3539F
+#define BATTERY_CAPACITY_DEFAULT 500 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index d587a8aa89..324a0a2300 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -23,6 +23,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_PA14_LO /* port PA14, low active */
+#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index e4865d7e8f..92dd07695d 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -38,6 +38,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
+#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index eed46f2823..b508836080 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -41,6 +41,8 @@
/* Define this for LCD backlight available */
#define CONFIG_BACKLIGHT BL_RTC /* on I2C controlled RTC port */
+#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
+
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index fb2d886042..4c6db6d44c 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -185,7 +185,7 @@ static const short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
#else /* NiMH */
/* original values were taken directly after charging, but it should show
100% after turning off the device for some hours, too */
- { 450, 481, 491, 497, 503, 507, 512, 514, 517, 525, 540 }
+ { 450, 481, 491, 497, 503, 507, 512, 514, 517, 525, 540 }
/* orig. values: ...,528,560 */
#endif
};
@@ -197,7 +197,7 @@ charger_input_state_type charger_input_state IDATA_ATTR;
static const short percent_to_volt_charge[11] =
{
#if CONFIG_BATTERY == BATT_LIPOL1300
- /* Calibrated for 1900 mAh Ionity battery (estimated 90% charge when
+ /* Calibrated for 1900 mAh Ionity battery (estimated 90% charge when
entering in trickle-charging). We will never reach 100%. */
340, 390, 394, 399, 400, 404, 407, 413, 417, 422, 426
#else
@@ -243,11 +243,11 @@ int pid_i = 0; /* PID integral term */
*/
static unsigned int battery_centivolts;/* filtered battery voltage, centvolts */
static unsigned int avgbat; /* average battery voltage (filtering) */
-#define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */
+#define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */
/* battery level (0-100%) of this minute, updated once per minute */
static int battery_percent = -1;
-static int battery_capacity = BATTERY_CAPACITY_MIN; /* default value, mAH */
+static int battery_capacity = BATTERY_CAPACITY_DEFAULT; /* default value, mAh */
static int battery_type = 0;
/* Power history: power_history[0] is the newest sample */
@@ -348,7 +348,7 @@ static int voltage_to_percent(int voltage, const short* table)
else
if (voltage >= table[10])
return 100;
- else {
+ else {
/* search nearest value */
int i = 0;
while ((i < 10) && (table[i+1] < voltage))
@@ -405,7 +405,7 @@ static void battery_status_update(void)
else
#endif
{
- powermgmt_est_runningtime_min = level * battery_capacity / 100
+ powermgmt_est_runningtime_min = level * battery_capacity / 100
* 60 / runcurrent();
}
}
@@ -515,7 +515,7 @@ static int runcurrent(void)
/* Check to see whether or not we've received an alarm in the last second */
#ifdef HAVE_ALARM_MOD
-static void power_thread_rtc_process(void)
+static void power_thread_rtc_process(void)
{
if (rtc_check_alarm_flag()) {
rtc_enable_alarm(false);
@@ -592,7 +592,7 @@ static void power_thread_sleep(int ticks)
}
break;
}
-
+
#endif /* HAVE_CHARGE_STATE */
small_ticks = MIN(HZ/2, ticks);
@@ -674,7 +674,7 @@ static void power_thread(void)
/* initialize the voltages for the exponential filter */
- avgbat = adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR *
+ avgbat = adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR *
BATT_AVE_SAMPLES;
battery_centivolts = avgbat / BATT_AVE_SAMPLES / 10000;
@@ -682,7 +682,7 @@ static void power_thread(void)
fd = -1;
wrcount = 0;
#endif
-
+
while (1)
{
/* rotate the power history */
@@ -690,7 +690,7 @@ static void power_thread(void)
phps = phpd - 1;
for (i = 0; i < POWER_HISTORY_LEN-1; i++)
*phpd-- = *phps--;
-
+
/* insert new value at the start, in centivolts 8-) */
power_history[0] = battery_centivolts;
@@ -732,7 +732,7 @@ static void power_thread(void)
} else {
charge_state = TOPOFF;
target_voltage = TOPOFF_VOLTAGE;
- }
+ }
} else {
/*
* Start the charger full strength
@@ -743,8 +743,8 @@ static void power_thread(void)
if (charge_max_time_idle > i) {
charge_max_time_idle = i;
}
- charge_max_time_now = charge_max_time_idle;
-
+ charge_max_time_now = charge_max_time_idle;
+
snprintf(power_message, POWER_MESSAGE_LEN,
"ChgAt %d%% max %dm", battery_level(),
charge_max_time_now);
@@ -895,7 +895,7 @@ static void power_thread(void)
* plugged in, but it doesn't appear to be necessary and will
* generate more heat [gvb].
*/
-
+
pid_p = target_voltage - battery_centivolts;
if((pid_p > PID_DEADZONE) || (pid_p < -PID_DEADZONE))
pid_p = pid_p * PID_PCONST;
@@ -980,7 +980,7 @@ static void power_thread(void)
}
}
if(fd >= 0) {
- snprintf(debug_message, DEBUG_MESSAGE_LEN,
+ snprintf(debug_message, DEBUG_MESSAGE_LEN,
"%d, %d, %d, %d, %d, %d, %d, %d\n",
powermgmt_last_cycle_startstop_min, battery_centivolts,
battery_percent, charger_input_state, charge_state,
@@ -1002,7 +1002,7 @@ void powermgmt_init(void)
{
/* init history to 0 */
memset(power_history, 0x00, sizeof(power_history));
-
+
create_thread(power_thread, power_stack, sizeof(power_stack),
power_thread_name);
}
@@ -1015,12 +1015,12 @@ void sys_poweroff(void)
/* If the main thread fails to shut down the system, we will force a
power off after an 8 second timeout */
shutdown_timeout = HZ*8;
-
+
queue_post(&button_queue, SYS_POWEROFF, NULL);
}
/* Various hardware housekeeping tasks relating to shutting down the jukebox */
-void shutdown_hw(void)
+void shutdown_hw(void)
{
#ifndef SIMULATOR
#if defined(DEBUG_FILE) && defined(HAVE_CHARGE_CTRL)