diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-14 02:46:59 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-14 02:46:59 +0000 |
commit | 7bc41203afbf8a69dec331d304a226cb70484855 (patch) | |
tree | 7ff3ec861b9288f2118c940fe8d5a3c976e6f62a | |
parent | cc50c149e9452e7c8ea199fd72f7458ead96bad7 (diff) | |
download | rockbox-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
-rw-r--r-- | apps/playback.c | 2 | ||||
-rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 7 | ||||
-rw-r--r-- | firmware/export/lcd-remote.h | 1 | ||||
-rw-r--r-- | firmware/export/pcm_record.h | 8 | ||||
-rw-r--r-- | firmware/powermgmt.c | 22 |
5 files changed, 20 insertions, 20 deletions
diff --git a/apps/playback.c b/apps/playback.c index dccae587b9..bacafc30b5 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -645,6 +645,7 @@ void audio_flush_and_reload_tracks(void) | |||
645 | void audio_error_clear(void) | 645 | void audio_error_clear(void) |
646 | { | 646 | { |
647 | #ifdef AUDIO_HAVE_RECORDING | 647 | #ifdef AUDIO_HAVE_RECORDING |
648 | extern void pcm_rec_error_clear(void); | ||
648 | pcm_rec_error_clear(); | 649 | pcm_rec_error_clear(); |
649 | #endif | 650 | #endif |
650 | } | 651 | } |
@@ -661,6 +662,7 @@ int audio_status(void) | |||
661 | 662 | ||
662 | #ifdef HAVE_RECORDING | 663 | #ifdef HAVE_RECORDING |
663 | /* Do this here for constitency with mpeg.c version */ | 664 | /* Do this here for constitency with mpeg.c version */ |
665 | extern unsigned long pcm_rec_status(void); | ||
664 | ret |= pcm_rec_status(); | 666 | ret |= pcm_rec_status(); |
665 | #endif | 667 | #endif |
666 | 668 | ||
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) | |||
484 | lcd_remote_set_invert_display(cached_invert); | 484 | lcd_remote_set_invert_display(cached_invert); |
485 | } | 485 | } |
486 | 486 | ||
487 | bool remote_detect(void) | ||
488 | { | ||
489 | return (GPIO_READ & 0x40000000)?false:true; | ||
490 | } | ||
491 | |||
487 | int remote_type(void) | 492 | int remote_type(void) |
488 | { | 493 | { |
489 | return _remote_type; | 494 | return _remote_type; |
@@ -499,7 +504,7 @@ static void remote_tick(void) | |||
499 | int val; | 504 | int val; |
500 | int level; | 505 | int level; |
501 | 506 | ||
502 | current_status = ((GPIO_READ & 0x40000000) == 0); | 507 | current_status = remote_detect(); |
503 | /* Only report when the status has changed */ | 508 | /* Only report when the status has changed */ |
504 | if (current_status != last_status) | 509 | if (current_status != last_status) |
505 | { | 510 | { |
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 @@ | |||
33 | #define REMOTETYPE_H300_LCD 2 | 33 | #define REMOTETYPE_H300_LCD 2 |
34 | #define REMOTETYPE_H300_NONLCD 3 | 34 | #define REMOTETYPE_H300_NONLCD 3 |
35 | extern int remote_type(void); | 35 | extern int remote_type(void); |
36 | extern bool remote_detect(void); | ||
36 | #endif | 37 | #endif |
37 | 38 | ||
38 | #define STYLE_DEFAULT 0 | 39 | #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); | |||
48 | void pcm_calculate_rec_peaks(int *left, int *right); | 48 | void pcm_calculate_rec_peaks(int *left, int *right); |
49 | 49 | ||
50 | /** General functions for high level codec recording **/ | 50 | /** General functions for high level codec recording **/ |
51 | void pcm_rec_error_clear(void); | 51 | /* pcm_rec_error_clear is deprecated for general use. audio_error_clear |
52 | unsigned long pcm_rec_status(void); | 52 | should be used */ |
53 | /* void pcm_rec_error_clear(void); */ | ||
54 | /* pcm_rec_status is deprecated for general use. audio_status merges the | ||
55 | results for consistency with the hardware codec version */ | ||
56 | /* unsigned long pcm_rec_status(void); */ | ||
53 | void pcm_rec_init(void); | 57 | void pcm_rec_init(void); |
54 | void pcm_rec_mux(int source); | 58 | void pcm_rec_mux(int source); |
55 | int pcm_rec_current_bitrate(void); | 59 | 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 @@ | |||
66 | 66 | ||
67 | #if defined(IAUDIO_X5) && !defined (SIMULATOR) | 67 | #if defined(IAUDIO_X5) && !defined (SIMULATOR) |
68 | #include "pcf50606.h" | 68 | #include "pcf50606.h" |
69 | #include "lcd-remote-target.h" | ||
69 | #endif | 70 | #endif |
70 | 71 | ||
71 | /* | 72 | /* |
@@ -317,7 +318,7 @@ int pid_i = 0; /* PID integral term */ | |||
317 | static unsigned int avgbat; /* average battery voltage (filtering) */ | 318 | static unsigned int avgbat; /* average battery voltage (filtering) */ |
318 | static unsigned int battery_centivolts;/* filtered battery voltage, centvolts */ | 319 | static unsigned int battery_centivolts;/* filtered battery voltage, centvolts */ |
319 | #ifdef HAVE_CHARGE_CTRL | 320 | #ifdef HAVE_CHARGE_CTRL |
320 | #define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */ | 321 | #define BATT_AVE_SAMPLES 32 /* filter constant / @ 2Hz sample rate */ |
321 | #elif CONFIG_BATTERY == BATT_LIPOL1300 | 322 | #elif CONFIG_BATTERY == BATT_LIPOL1300 |
322 | #define BATT_AVE_SAMPLES 128 /* slow filter for iriver */ | 323 | #define BATT_AVE_SAMPLES 128 /* slow filter for iriver */ |
323 | #else | 324 | #else |
@@ -723,26 +724,17 @@ static int runcurrent(void) | |||
723 | #endif | 724 | #endif |
724 | 725 | ||
725 | #if defined(HAVE_RECORDING) && defined(CURRENT_RECORD) | 726 | #if defined(HAVE_RECORDING) && defined(CURRENT_RECORD) |
726 | #if CONFIG_CODEC == SWCODEC | 727 | if (audio_status() & AUDIO_STATUS_RECORD) |
727 | unsigned int audio_stat = pcm_rec_status(); | ||
728 | #else | ||
729 | int audio_stat = audio_status(); | ||
730 | #endif | ||
731 | if (audio_stat & AUDIO_STATUS_RECORD) | ||
732 | current += CURRENT_RECORD; | 728 | current += CURRENT_RECORD; |
733 | #endif | 729 | #endif |
734 | 730 | ||
735 | #ifdef HAVE_SPDIF_POWER | 731 | #ifdef HAVE_SPDIF_POWER |
736 | #ifdef SPDIF_POWER_INVERTED | 732 | if (spdif_powered()) |
737 | if (GPIO1_OUT & 0x01000000) | ||
738 | #else | ||
739 | if (!(GPIO1_OUT & 0x01000000)) | ||
740 | #endif | ||
741 | current += CURRENT_SPDIF_OUT; | 733 | current += CURRENT_SPDIF_OUT; |
742 | #endif | 734 | #endif |
743 | 735 | ||
744 | #ifdef HAVE_REMOTE_LCD | 736 | #ifdef HAVE_REMOTE_LCD |
745 | if ((GPIO_READ & 0x40000000) == 0) | 737 | if (remote_detect()) |
746 | current += CURRENT_REMOTE; | 738 | current += CURRENT_REMOTE; |
747 | #endif | 739 | #endif |
748 | 740 | ||
@@ -1271,11 +1263,7 @@ void sys_poweroff(void) | |||
1271 | power off after an 20 second timeout */ | 1263 | power off after an 20 second timeout */ |
1272 | shutdown_timeout = HZ*20; | 1264 | shutdown_timeout = HZ*20; |
1273 | #if defined(HAVE_RECORDING) | 1265 | #if defined(HAVE_RECORDING) |
1274 | #if CONFIG_CODEC == SWCODEC | ||
1275 | unsigned int audio_stat = pcm_rec_status(); | ||
1276 | #else | ||
1277 | int audio_stat = audio_status(); | 1266 | int audio_stat = audio_status(); |
1278 | #endif | ||
1279 | if (audio_stat & AUDIO_STATUS_RECORD) { | 1267 | if (audio_stat & AUDIO_STATUS_RECORD) { |
1280 | audio_stop_recording(); | 1268 | audio_stop_recording(); |
1281 | shutdown_timeout += 8*HZ; | 1269 | shutdown_timeout += 8*HZ; |