Removed anachronisms introduced with low battery shutdown patch.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11524 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2006-11-14 02:46:59 +00:00
parent cc50c149e9
commit 7bc41203af
5 changed files with 20 additions and 20 deletions

View file

@ -645,6 +645,7 @@ void audio_flush_and_reload_tracks(void)
void audio_error_clear(void)
{
#ifdef AUDIO_HAVE_RECORDING
extern void pcm_rec_error_clear(void);
pcm_rec_error_clear();
#endif
}
@ -661,6 +662,7 @@ int audio_status(void)
#ifdef HAVE_RECORDING
/* Do this here for constitency with mpeg.c version */
extern unsigned long pcm_rec_status(void);
ret |= pcm_rec_status();
#endif

View file

@ -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)
{

View file

@ -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

View file

@ -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);

View file

@ -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;