summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 71b0f08fff..9cfacad9b0 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -31,7 +31,7 @@
31#include "power.h" 31#include "power.h"
32#include "button.h" 32#include "button.h"
33#include "ata.h" 33#include "ata.h"
34#include "mpeg.h" 34#include "audio.h"
35#include "mp3_playback.h" 35#include "mp3_playback.h"
36#include "usb.h" 36#include "usb.h"
37#include "powermgmt.h" 37#include "powermgmt.h"
@@ -343,7 +343,7 @@ static void battery_level_update(void)
343static void handle_auto_poweroff(void) 343static void handle_auto_poweroff(void)
344{ 344{
345 long timeout = poweroff_idle_timeout_value[poweroff_timeout]*60*HZ; 345 long timeout = poweroff_idle_timeout_value[poweroff_timeout]*60*HZ;
346 int mpeg_stat = mpeg_status(); 346 int audio_stat = audio_status();
347 347
348#ifdef HAVE_CHARGING 348#ifdef HAVE_CHARGING
349 /* 349 /*
@@ -360,8 +360,8 @@ static void handle_auto_poweroff(void)
360 (radio_get_status() != FMRADIO_PLAYING) && 360 (radio_get_status() != FMRADIO_PLAYING) &&
361#endif 361#endif
362 !usb_inserted() && 362 !usb_inserted() &&
363 ((mpeg_stat == 0) || 363 ((audio_stat == 0) ||
364 ((mpeg_stat == (MPEG_STATUS_PLAY | MPEG_STATUS_PAUSE)) && 364 ((audio_stat == (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE)) &&
365 !sleeptimer_active))) 365 !sleeptimer_active)))
366 { 366 {
367 if(TIME_AFTER(current_tick, last_event_tick + timeout) && 367 if(TIME_AFTER(current_tick, last_event_tick + timeout) &&
@@ -377,7 +377,7 @@ static void handle_auto_poweroff(void)
377 { 377 {
378 if(TIME_AFTER(current_tick, sleeptimer_endtick)) 378 if(TIME_AFTER(current_tick, sleeptimer_endtick))
379 { 379 {
380 mpeg_stop(); 380 audio_stop();
381#ifdef HAVE_CHARGING 381#ifdef HAVE_CHARGING
382 if((charger_input_state == CHARGER) || 382 if((charger_input_state == CHARGER) ||
383 (charger_input_state == CHARGER_PLUGGED)) 383 (charger_input_state == CHARGER_PLUGGED))
@@ -413,8 +413,8 @@ static void car_adapter_mode_processing(void)
413 413
414 if (waiting_to_resume_play) { 414 if (waiting_to_resume_play) {
415 if (TIME_AFTER(current_tick, play_resume_time)) { 415 if (TIME_AFTER(current_tick, play_resume_time)) {
416 if (mpeg_status() & MPEG_STATUS_PAUSE) { 416 if (audio_status() & AUDIO_STATUS_PAUSE) {
417 mpeg_resume(); 417 audio_resume();
418 } 418 }
419 waiting_to_resume_play = false; 419 waiting_to_resume_play = false;
420 } 420 }
@@ -423,15 +423,15 @@ static void car_adapter_mode_processing(void)
423 /* 423 /*
424 * Just got unplugged, pause if playing 424 * Just got unplugged, pause if playing
425 */ 425 */
426 if ((mpeg_status() & MPEG_STATUS_PLAY) && 426 if ((audio_status() & AUDIO_STATUS_PLAY) &&
427 !(mpeg_status() & MPEG_STATUS_PAUSE)) { 427 !(audio_status() & AUDIO_STATUS_PAUSE)) {
428 mpeg_pause(); 428 audio_pause();
429 } 429 }
430 } else if(charger_input_state == CHARGER_PLUGGED) { 430 } else if(charger_input_state == CHARGER_PLUGGED) {
431 /* 431 /*
432 * Just got plugged in, delay & resume if we were playing 432 * Just got plugged in, delay & resume if we were playing
433 */ 433 */
434 if (mpeg_status() & MPEG_STATUS_PAUSE) { 434 if (audio_status() & AUDIO_STATUS_PAUSE) {
435 /* delay resume a bit while the engine is cranking */ 435 /* delay resume a bit while the engine is cranking */
436 play_resume_time = current_tick + HZ*5; 436 play_resume_time = current_tick + HZ*5;
437 waiting_to_resume_play = true; 437 waiting_to_resume_play = true;
@@ -920,7 +920,7 @@ void shutdown_hw(void)
920 fd = -1; 920 fd = -1;
921 } 921 }
922#endif 922#endif
923 mpeg_stop(); 923 audio_stop();
924 ata_flush(); 924 ata_flush();
925 ata_spindown(1); 925 ata_spindown(1);
926 while(ata_disk_is_active()) 926 while(ata_disk_is_active())