📄 test.c
字号:
#include <stdio.h>
#include "typedef.h"
#include "low.h"
#include "pci.h"
#include "hcd.h"
#include "usb.h"
#include "ehci.h"
#include "ohci.h"
#include "uhci.h"
#include "hub.h"
#include "amecam.h"
void main()
{
long res;
long res1,res2,res3,res4;
#ifdef DEBUG_HARDWARE_INTERRUPT
InitLog(0,0);
#endif
init_irq_table();
init_event_handling();
init_busmap();
pci_init();
res1 = ohci_hcd_init();
res2 = uhci_hcd_init();
res3 = ehci_hcd_init();
if(res1 < 0 && res2 < 0 && res3 <0)
{
printf("There are no any host controller attach,Press any key to quit!\n");
getch();
goto error;
}
res = usb_hub_init();
if(res < 0)
goto error_3;
res4 = usb_amecam_init();
printf("Press any key to continue,Later Press 'A' OR 'a' to quit\n");
getch();
event_loop();
if(res4 >= 0)
{
usb_amecam_cleanup();
}
error_3:
usb_hub_cleanup();
error:
if(res3 >= 0)
{
ehci_hcd_cleanup();
}
if(res2 >= 0)
{
uhci_hcd_cleanup();
}
if(res1 >= 0)
{
ohci_hcd_cleanup();
}
pci_exit();
cleanup_evevnt_handling();
#ifdef DEBUG_HARDWARE_INTERRUPT
CleanupLog();
#endif
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -