本帖最后由 zhiyonghe 于 2011-6-1 13:29 编辑
下面是两个不同应用的 int();- void USB_Init(void)
- {
- pInformation = &Device_Info;
- pInformation->ControlState = 2;
- pProperty = &Device_Property;
- pUser_Standard_Requests = &User_Standard_Requests;
- /* Initialize devices one by one */
- pProperty->Init();
- }
pProperty->Init(); //这一句在不同的应用中指向下面各自的 int();
-
- void MASS_init()
- {
- /* Update the serial number string descriptor with the data from the unique
- ID*/
- Get_SerialNum();
- pInformation->Current_Configuration = 0;
- /* Connect the device */
- PowerOn();
- /* USB interrupts initialization */
- /* clear pending interrupts */
- _SetISTR(0);
- wInterrupt_Mask = IMR_MSK;
- /* set interrupts mask */
- _SetCNTR(wInterrupt_Mask);
- bDeviceState = UNCONNECTED;
- }
- //==========================================================
- void Joystick_init(void)
- {
- /* Update the serial number string descriptor with the data from the unique
- ID*/
- Get_SerialNum();
- pInformation->Current_Configuration = 0;
- /* Connect the device */
- PowerOn();
- /* USB interrupts initialization */
- _SetISTR(0); /* clear pending interrupts */
- wInterrupt_Mask = IMR_MSK;
- _SetCNTR(wInterrupt_Mask); /* set interrupts mask */
- bDeviceState = UNCONNECTED;
- }
|