summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/agptek/debug-agptek.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/agptek/debug-agptek.c')
-rw-r--r--firmware/target/hosted/agptek/debug-agptek.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/firmware/target/hosted/agptek/debug-agptek.c b/firmware/target/hosted/agptek/debug-agptek.c
index 7f794a7073..d0ca613323 100644
--- a/firmware/target/hosted/agptek/debug-agptek.c
+++ b/firmware/target/hosted/agptek/debug-agptek.c
@@ -18,6 +18,13 @@
18 * 18 *
19 ****************************************************************************/ 19 ****************************************************************************/
20 20
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <fcntl.h>
24#include <stdio.h>
25#include <unistd.h>
26#include <string.h>
27
21#include "config.h" 28#include "config.h"
22#include "font.h" 29#include "font.h"
23#include "lcd.h" 30#include "lcd.h"
@@ -34,12 +41,26 @@ bool dbg_hw_info(void)
34{ 41{
35 int btn = 0; 42 int btn = 0;
36 43
44 /* Try to read the bootloader */
45 char verstr[40];
46 memset(verstr, 0, sizeof(verstr));
47 int fd = open("/etc/rockbox-bl-info.txt", O_RDONLY);
48 if(fd >= 0)
49 {
50 read(fd, verstr, sizeof(verstr) -1);
51 close(fd);
52 }
53
37 lcd_setfont(FONT_SYSFIXED); 54 lcd_setfont(FONT_SYSFIXED);
38 55
39 while(btn ^ BUTTON_POWER) { 56 while(btn ^ BUTTON_POWER) {
40 lcd_clear_display(); 57 lcd_clear_display();
41 line = 0; 58 line = 0;
42 59
60 if (verstr[0]) {
61 lcd_putsf(0, line++, "Boot ver: %s", verstr);
62 }
63
43 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate()); 64 lcd_putsf(0, line++, "pcm srate: %d", pcm_alsa_get_rate());
44#ifdef HAVE_HEADPHONE_DETECTION 65#ifdef HAVE_HEADPHONE_DETECTION
45 lcd_putsf(0, line++, "hp: %d", headphones_inserted()); 66 lcd_putsf(0, line++, "hp: %d", headphones_inserted());