summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-11-14 02:46:59 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-11-14 02:46:59 +0000
commit7bc41203afbf8a69dec331d304a226cb70484855 (patch)
tree7ff3ec861b9288f2118c940fe8d5a3c976e6f62a /firmware
parentcc50c149e9452e7c8ea199fd72f7458ead96bad7 (diff)
downloadrockbox-7bc41203afbf8a69dec331d304a226cb70484855.tar.gz
rockbox-7bc41203afbf8a69dec331d304a226cb70484855.zip
Removed anachronisms introduced with low battery shutdown patch.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11524 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-h100-remote.c7
-rw-r--r--firmware/export/lcd-remote.h1
-rw-r--r--firmware/export/pcm_record.h8
-rw-r--r--firmware/powermgmt.c22
4 files changed, 18 insertions, 20 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index 0592f60e00..e366906724 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -484,6 +484,11 @@ static void remote_lcd_init(void)
lcd_remote_set_invert_display(cached_invert);
}
+bool remote_detect(void)
+{
+ return (GPIO_READ & 0x40000000)?false:true;
+}
+
int remote_type(void)
{
return _remote_type;
@@ -499,7 +504,7 @@ static void remote_tick(void)
int val;
int level;
- current_status = ((GPIO_READ & 0x40000000) == 0);
+ current_status = remote_detect();
/* Only report when the status has changed */
if (current_status != last_status)
{
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 9665652716..9d5808b157 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -33,6 +33,7 @@
#define REMOTETYPE_H300_LCD 2
#define REMOTETYPE_H300_NONLCD 3
extern int remote_type(void);
+extern bool remote_detect(void);
#endif
#define STYLE_DEFAULT 0
diff --git a/firmware/export/pcm_record.h b/firmware/export/pcm_record.h
index c1187a4c6c..639ad7c97d 100644
--- a/firmware/export/pcm_record.h
+++ b/firmware/export/pcm_record.h
@@ -48,8 +48,12 @@ void pcm_stop_recording(void);
void pcm_calculate_rec_peaks(int *left, int *right);
/** General functions for high level codec recording **/
-void pcm_rec_error_clear(void);
-unsigned long pcm_rec_status(void);
+/* pcm_rec_error_clear is deprecated for general use. audio_error_clear
+ should be used */
+/* void pcm_rec_error_clear(void); */
+/* pcm_rec_status is deprecated for general use. audio_status merges the
+ results for consistency with the hardware codec version */
+/* unsigned long pcm_rec_status(void); */
void pcm_rec_init(void);
void pcm_rec_mux(int source);
int pcm_rec_current_bitrate(void);
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index d30a31897e..42366b0b24 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -66,6 +66,7 @@
#if defined(IAUDIO_X5) && !defined (SIMULATOR)
#include "pcf50606.h"
+#include "lcd-remote-target.h"
#endif
/*
@@ -317,7 +318,7 @@ int pid_i = 0; /* PID integral term */
static unsigned int avgbat; /* average battery voltage (filtering) */
static unsigned int battery_centivolts;/* filtered battery voltage, centvolts */
#ifdef HAVE_CHARGE_CTRL
-#define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */
+#define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */
#elif CONFIG_BATTERY == BATT_LIPOL1300
#define BATT_AVE_SAMPLES 128 /* slow filter for iriver */
#else
@@ -723,26 +724,17 @@ static int runcurrent(void)
#endif
#if defined(HAVE_RECORDING) && defined(CURRENT_RECORD)
-#if CONFIG_CODEC == SWCODEC
- unsigned int audio_stat = pcm_rec_status();
-#else
- int audio_stat = audio_status();
-#endif
- if (audio_stat & AUDIO_STATUS_RECORD)
+ if (audio_status() & AUDIO_STATUS_RECORD)
current += CURRENT_RECORD;
#endif
#ifdef HAVE_SPDIF_POWER
-#ifdef SPDIF_POWER_INVERTED
- if (GPIO1_OUT & 0x01000000)
-#else
- if (!(GPIO1_OUT & 0x01000000))
-#endif
+ if (spdif_powered())
current += CURRENT_SPDIF_OUT;
#endif
#ifdef HAVE_REMOTE_LCD
- if ((GPIO_READ & 0x40000000) == 0)
+ if (remote_detect())
current += CURRENT_REMOTE;
#endif
@@ -1271,11 +1263,7 @@ void sys_poweroff(void)
power off after an 20 second timeout */
shutdown_timeout = HZ*20;
#if defined(HAVE_RECORDING)
-#if CONFIG_CODEC == SWCODEC
- unsigned int audio_stat = pcm_rec_status();
-#else
int audio_stat = audio_status();
-#endif
if (audio_stat & AUDIO_STATUS_RECORD) {
audio_stop_recording();
shutdown_timeout += 8*HZ;