summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/main.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/main.c b/apps/main.c
index 47c91ddada..c43248e45a 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -29,6 +29,7 @@
29#include "panic.h" 29#include "panic.h"
30#include "menu.h" 30#include "menu.h"
31#include "system.h" 31#include "system.h"
32#include "usb.h"
32#ifndef SIMULATOR 33#ifndef SIMULATOR
33#include "dmalloc.h" 34#include "dmalloc.h"
34#include "bmalloc.h" 35#include "bmalloc.h"
@@ -41,10 +42,40 @@
41 42
42#include "version.h" 43#include "version.h"
43 44
45#include "sh7034.h"
46#include "sprintf.h"
47
44char appsversion[]=APPSVERSION; 48char appsversion[]=APPSVERSION;
45 49
46void init(void); 50void init(void);
47 51
52/* Test code!!! */
53void dbg_ports(void)
54{
55 unsigned short porta;
56 unsigned short portb;
57 unsigned char portc;
58 char buf[32];
59
60 lcd_clear_display();
61
62 while(1)
63 {
64 porta = PADR;
65 portb = PBDR;
66 portc = PCDR;
67
68 snprintf(buf, 32, "PCDR: %04x", porta);
69 lcd_puts(0, 0, buf);
70 snprintf(buf, 32, "PCDR: %04x", portb);
71 lcd_puts(0, 1, buf);
72 snprintf(buf, 32, "PCDR: %02x", portc);
73 lcd_puts(0, 2, buf);
74 lcd_update();
75 sleep(HZ/10);
76 }
77}
78
48void app_main(void) 79void app_main(void)
49{ 80{
50 init(); 81 init();
@@ -89,6 +120,8 @@ void init(void)
89#endif 120#endif
90 set_irq_level(0); 121 set_irq_level(0);
91 122
123 usb_init();
124
92 rc = ata_init(); 125 rc = ata_init();
93 if(rc) 126 if(rc)
94 panicf("ata: %d",rc); 127 panicf("ata: %d",rc);
@@ -107,6 +140,8 @@ void init(void)
107 mpeg_init( global_settings.volume, 140 mpeg_init( global_settings.volume,
108 global_settings.bass, 141 global_settings.bass,
109 global_settings.treble ); 142 global_settings.treble );
143
144 usb_start_monitoring();
110} 145}
111 146
112int main(void) 147int main(void)