Revision 395
Added by markw about 10 years ago
| firmware/5200/mainmenu.c | ||
|---|---|---|
| 
     void mainmenu()
 
   | 
||
| 
     {
 
   | 
||
| 
     #ifdef USB
 
   | 
||
| 
     	usb_log_init(files[7]);
 
   | 
||
| 
     	usb_init(&usb_porta,0);
 
   | 
||
| 
     #endif
 
   | 
||
| 
     #ifdef USB2
 
   | 
||
| ... | ... | |
| 
     | 
||
| 
     	if (SimpleFile_OK == dir_init((void *)DIR_INIT_MEM, DIR_INIT_MEMSIZE))
 
   | 
||
| 
     	{
 
   | 
||
| 
     		#ifdef USB
 
   | 
||
| 
     			usb_log_init(files[7]);
 
   | 
||
| 
     		#endif
 
   | 
||
| 
     		struct SimpleDirEntry * entries = dir_entries(ROM_DIR);
 
   | 
||
| 
     | 
||
| 
     		if (SimpleFile_OK == file_open_name_in_dir(entries, "5200.rom", files[5]))
 
   | 
||
| firmware/Makefile | ||
|---|---|---|
| 
     A800_SRC = ${A800_SRC_LIGHT} a800/joystick.c 
 
   | 
||
| 
     5200_SRC_LIGHT = 5200/freeze.c  5200/mainmenu.c
 
   | 
||
| 
     5200_SRC = ${5200_SRC_LIGHT} 5200/joystick.c
 
   | 
||
| 
     USB_SRC = usb/hid.c  usb/hidparser.c  usb/hub.c usb/timer.c  usb/usb.c
 
   | 
||
| 
     USB_SRC = usb/hid.c  usb/hidparser.c  usb/hub.c usb/timer.c  usb/usb.c usb/debug.c
 
   | 
||
| 
     | 
||
| 
     AEON_LITE_PRJ = AEON_LITE
 
   | 
||
| 
     AEON_LITE_SRC = $(COMMON_SRC) $(SDCARD_SRC) $(A800_SRC) de1/dirs.c
 
   | 
||
| firmware/a800/mainmenu.c | ||
|---|---|---|
| 
     | 
||
| 
     #ifdef USB
 
   | 
||
| 
     #include "usb.h"
 
   | 
||
| 
     #include "usb/debug.h"
 
   | 
||
| 
     #endif
 
   | 
||
| 
     | 
||
| 
     #undef USBSETTINGS
 
   | 
||
| ... | ... | |
| 
     void mainmenu()
 
   | 
||
| 
     {
 
   | 
||
| 
     #ifdef USB
 
   | 
||
| 
     	usb_log_init(files[7]);
 
   | 
||
| 
     	usb_init(&usb_porta,0);
 
   | 
||
| 
     #endif
 
   | 
||
| 
     #ifdef USB2
 
   | 
||
| ... | ... | |
| 
     	freezer_rom_present = 0;
 
   | 
||
| 
     	if (SimpleFile_OK == dir_init((void *)DIR_INIT_MEM, DIR_INIT_MEMSIZE))
 
   | 
||
| 
     	{
 
   | 
||
| 
     		#ifdef USB
 
   | 
||
| 
     			usb_log_init(files[7]);
 
   | 
||
| 
     		#endif
 
   | 
||
| 
     		init_drive_emulator();
 
   | 
||
| 
     | 
||
| 
     		struct SimpleDirEntry * entries = dir_entries(ROM_DIR);
 
   | 
||
| firmware/usb/debug.c | ||
|---|---|---|
| 
     //#define hid_debugf(IN, ...) {};
 
   | 
||
| 
     //#define hidp_debugf(IN, ...) {};
 
   | 
||
| 
     //#define iprintf(IN, ...) {};
 
   | 
||
| 
     #include "debug.h"
 
   | 
||
| 
     | 
||
| 
     #include "stdarg.h"
 
   | 
||
| 
     | 
||
| 
     #include "printf/printf.h"
 
   | 
||
| 
     | 
||
| 
     struct SimpleFile * usb_file;
 
   | 
||
| 
     | 
||
| 
     void usb_log_init(struct SimpleFile * file)
 
   | 
||
| 
     {
 
   | 
||
| 
     	file_open_name("usb.log", &file);
 
   | 
||
| 
     	if (file_size(usb_file)>=65536 && file_readonly(usb_file)==0)
 
   | 
||
| 
     	file_open_name("/usb.log", file);
 
   | 
||
| 
     	if (file_size(file)>=65536 && file_readonly(file)==0)
 
   | 
||
| 
     		usb_file = file;
 
   | 
||
| 
     	else
 
   | 
||
| 
     		usb_file = 0;
 
   | 
||
| firmware/usb/debug.h | ||
|---|---|---|
| 
     | 
||
| 
     struct SimpleFile * usb_file;
 
   | 
||
| 
     | 
||
| 
     void usb_log_init(struct SimpleFile * file)
 
   | 
||
| 
     {
 
   | 
||
| 
     	file_open_name("usb.log", &file);
 
   | 
||
| 
     	usb_file = file;
 
   | 
||
| 
     }
 
   | 
||
| 
     void usb_log_init(struct SimpleFile * file);
 
   | 
||
| 
     | 
||
| 
     void usb_log(char * format, ...);
 
   | 
||
| 
     | 
||
| 
     //#define hid_debugf usblog;
 
   | 
||
| 
     //#define hidp_debugf usb_log;
 
   | 
||
| 
     //#define iprintf usb_log;
 
   | 
||
| 
     #define hid_debugf usb_log;
 
   | 
||
| 
     #define hidp_debugf usb_log;
 
   | 
||
| 
     #define iprintf usb_log;
 
   | 
||
| 
     | 
||
| firmware/usb/usb.c | ||
|---|---|---|
| 
       int i;
 
   | 
||
| 
       for(i=0; i<USB_NUMDEVICES; i++) {
 
   | 
||
| 
         if(devices[i].bAddress && devices[i].parent == parent && devices[i].port == port && devices[i].host_addr == usbhostslave) {
 
   | 
||
| 
           iprintf("  -> device with address %x\n", dev[i].bAddress);
 
   | 
||
| 
           iprintf("  -> device with address %x\n", devices[i].bAddress);
 
   | 
||
| 
     | 
||
| 
           // check if this is a hub (parent of some other device)
 
   | 
||
| 
           // and release its kids first
 
   | 
||
Debugged usb logging