Using the Clicker's USB interrupt demo is fine because the only thing it does is respond to USB input messages. In my case, the main() loop will be triggering various functions which drive the machine, so where do I put the code to respond to incoming USB messages from the PC? For example, if I I want to pause or raise/lower the speed while the machine is running?
The PC sends commands such as this...
Code: Select all
$MS600
I tried calling the USB decoder from within the interrupt but the Clicker would no longer connect to the PC...
Code: Select all
void interrupt(){
USB_Interrupt_Proc(); // USB interrupt servicing
USB_Comms_Decoder(); // USB message decoder (reads incoming data and decodes it)
}
Any help/examples appreciated.
ST.