Hi,
can any please help me to break these two funtions apart so that they can both be called without one conlicting with the other?
void USB1Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USB_Interrupt_Proc(); //this needs to be active for USB Hide pc comm.
// USBDev_IntHandler(); //this is needed for the maasstorage, but can not activate both sametime
}
I'm tryinh to add the mass storage example to my existing project and it calls for both of these functions to be called with in the interrupt routene as shown. however when I call one of them the usb goes into a error. it seems as though both of these lines can not be compiled together. In order to make the other work i have to comment one of them out as shown and recompile otherwise they will not co-exist together. I'm only calling one at a time and still will not work. perhaps i may not understand how they are both handeled. Does anyone have any advise, Please help me to be a ble call any one of these functions when needed.
Regards
Lupo
USB interrupt conflict
Re: USB interrupt conflict
Hi Lupo-
Without more info on your design, why not separate the functions into 2 interrupts for different ports?
Hope that helps
Bart
Without more info on your design, why not separate the functions into 2 interrupts for different ports?
Hope that helps
Bart
Re: USB interrupt conflict
Hi Bartt, and thanks for your help, how ever i have tried brking as follws:
void USB1Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USB_Interrupt_Proc(); //this needs to be active for USB Hide
}
void USB2Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USBDev_IntHandler(); //this is needed for the maasstorage, but can not activate both sametime
}
but i still get the same reult whether i combine them or put them separte. I'm not sure if perhaps i need to change something to the second interrupt. As you can see i did change the second interrupt's function name to USB2Interrupt. But still experiencing difficulty.
I'm also loading two separate descriptors one for each function as well, and not sure if this could be causing the error or conflict. But i still need to figure out how to get them to work in the same
Rogram.
Lupo
void USB1Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USB_Interrupt_Proc(); //this needs to be active for USB Hide
}
void USB2Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USBDev_IntHandler(); //this is needed for the maasstorage, but can not activate both sametime
}
but i still get the same reult whether i combine them or put them separte. I'm not sure if perhaps i need to change something to the second interrupt. As you can see i did change the second interrupt's function name to USB2Interrupt. But still experiencing difficulty.
I'm also loading two separate descriptors one for each function as well, and not sure if this could be causing the error or conflict. But i still need to figure out how to get them to work in the same
Rogram.
Lupo
Re: USB interrupt conflict
Hi,
Plesae can anyone show me how I can use two separate interrupts in the same program. As you can see above I have tried putting each of my USB modules in separate interrupt routene and having cloflicts. I would like to call each one individually when needed and unload the other since I only use one or the other. I have re-copied it for simplicity
void USB1Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USB_Interrupt_Proc(); //this needs to be active for USB Hide
}
void USB2Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USBDev_IntHandler(); //this is needed for the maasstorage, but can not activate both sametime
}
Plesae any advise i will appreciate thanks
XLupo
Plesae can anyone show me how I can use two separate interrupts in the same program. As you can see above I have tried putting each of my USB modules in separate interrupt routene and having cloflicts. I would like to call each one individually when needed and unload the other since I only use one or the other. I have re-copied it for simplicity
void USB1Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USB_Interrupt_Proc(); //this needs to be active for USB Hide
}
void USB2Interrupt() iv IVT_USB_1 ilevel 7 ics ICS_SRS{
USBDev_IntHandler(); //this is needed for the maasstorage, but can not activate both sametime
}
Plesae any advise i will appreciate thanks
XLupo
Re: USB interrupt conflict
Hi,
You can use separate interrupts in the program, just use different IVT for each interrupt routine.
Regards,
Filip.
You can use separate interrupts in the program, just use different IVT for each interrupt routine.
Regards,
Filip.
Re: USB interrupt conflict
Thanks Philip,
Since I need two separate Interrupts for two separate USB handlers as you can see above, which IVT do you advise to use for the second Interrupt? as you know there is only one IVT availablt for USB, which is USB_1. How can I incorporate the second, using which IVT? I have tried changing the IVT with a couple of others which are listed under the Interrupt assistance, but doesnt work. The first USB handler is the USB_Interrupt_Proc(); which is listed under the library's original list and the second USBDEV_IntHandler() was just added for the mass storage which was just added to the library as you know. I have tried using the same IVT as you can see but it seems as though only one works. if i state both with the same IVT only the second one in line which was stated seems to work. I then change the order which they were stated and recompile, then the other works but not the fitrst. Please advise on this or if there is another way of doing this. Thank you
Xlupo
Since I need two separate Interrupts for two separate USB handlers as you can see above, which IVT do you advise to use for the second Interrupt? as you know there is only one IVT availablt for USB, which is USB_1. How can I incorporate the second, using which IVT? I have tried changing the IVT with a couple of others which are listed under the Interrupt assistance, but doesnt work. The first USB handler is the USB_Interrupt_Proc(); which is listed under the library's original list and the second USBDEV_IntHandler() was just added for the mass storage which was just added to the library as you know. I have tried using the same IVT as you can see but it seems as though only one works. if i state both with the same IVT only the second one in line which was stated seems to work. I then change the order which they were stated and recompile, then the other works but not the fitrst. Please advise on this or if there is another way of doing this. Thank you
Xlupo
- janko.kaljevic
- Posts: 3565
- Joined: 16 Jun 2011 13:48
Re: USB interrupt conflict
Hello,
Running both USB libraries at the same time is not good idea.
Most probably it will not work well.
Other option is to separately run HID and Mass Storage Device.
For example at one moment you use HID and then (after a button press) you initialize MSD.
If you want to implement HID and MSD at the same time, you will need to create a composite USB device and define in descriptor both classes.
This is possible only with our latest USB device library.
Best regards.
Running both USB libraries at the same time is not good idea.
Most probably it will not work well.
Other option is to separately run HID and Mass Storage Device.
For example at one moment you use HID and then (after a button press) you initialize MSD.
If you want to implement HID and MSD at the same time, you will need to create a composite USB device and define in descriptor both classes.
This is possible only with our latest USB device library.
Best regards.
-
- Posts: 18
- Joined: 04 Apr 2013 09:51
Re: USB interrupt conflict
when i tried using usb interrupts i used the general usb iterrupt then reading the iterrupt flags to call the appropriate function to be the interrupt routine
or even setting my own flag to call functions as an interrupt routine
hope that help
or even setting my own flag to call functions as an interrupt routine
hope that help