From c43a307011e8e89b5a31e4f9ffab0dfeb0e3ed5b Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 8 Feb 2003 02:59:47 +0000 Subject: Added some debugging info to chase the 3-hour time display bug git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3227 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/recording.c | 19 ++++++++++--------- firmware/mpeg.c | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index ade7e5146f..e301cd322e 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -53,6 +53,9 @@ extern int mp3buf_write; extern int mp3buf_read; extern bool recording; +extern unsigned long record_start_frame; /* Frame number where + recording started */ + #define SOURCE_MIC 0 #define SOURCE_LINE 1 #define SOURCE_SPDIF 2 @@ -122,8 +125,6 @@ void adjust_cursor(void) } } -#define BLINK_INTERVAL 2 - unsigned int frame_times[] = { 2612, /* 44.1kHz */ @@ -161,10 +162,10 @@ bool recording_screen(void) int w, h; int update_countdown = 1; bool have_recorded = false; - bool blink_toggle = false; unsigned long seconds; unsigned long last_seconds = 0; int hours, minutes; + unsigned long val; cursor = 0; mpeg_init_recording(); @@ -360,12 +361,12 @@ bool recording_screen(void) lcd_clear_display(); - if(mpeg_status() & MPEG_STATUS_RECORD) - { - blink_toggle = blink_toggle?false:true; - if(blink_toggle) - lcd_puts(0, 0, "Recording"); - } + /* DEBUG: Read the current frame */ + mas_readmem(MAS_BANK_D0, 0xfd0, &val, 1); + + snprintf(buf, 32, "%05x:%05x:%05x", + mpeg_num_recorded_frames(), val, record_start_frame); + lcd_puts(0, 0, buf); hours = seconds / 3600; minutes = (seconds - (hours * 3600)) / 60; diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 0ed52ed6cb..82073a6405 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -482,8 +482,8 @@ static int lowest_watermark_level; /* Debug value to observe the buffer #ifdef HAVE_MAS3587F static bool is_recording; /* We are recording */ static bool stop_pending; -static unsigned long record_start_frame; /* Frame number where - recording started */ +unsigned long record_start_frame; /* Frame number where + recording started */ static bool saving; /* We are saving the buffer to disk */ #endif @@ -2187,7 +2187,7 @@ unsigned long mpeg_num_recorded_frames(void) { /* Read the current frame */ mas_readmem(MAS_BANK_D0, 0xfd0, &val, 1); - + return val - record_start_frame; } else -- cgit v1.2.3