Interrupt on LUFA VS RX

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seen things touching on this in other posts, but many are outdated so wondering if anyone (read 'Dean' ;) knows an easy way to somehow tap into an RX interrupt on the LUFA virtual serial class driver demo.

The issue is basically that my project uses virtual serial port to communicate as I need to transfer MB's of data and don't want to go through the hassle of PC-side drivers. The Host->Device configuration is fairly simple, but at some point the device needs to enter a time-critical section where it does very minimal processing in order to be able to act on a port/pin change as fast as possible.

As such, I don't want to keep the full main loop going processing the USB and CDC tasks or I could end up lagging a bit before processing the event. The device basically does a:

while (pins != value) {}

but if the host wants to cancel and pop the device out of the task, it's unable without an interrupt signal on the serial port RX.

I'd be happy with any sort of received communication RX interrupt without knowing what happened as I could tolerate changing the loop to:

while (pins != value && !g_break) {}

but doing a full call to the USB routines would probably be too much.

Is there anything I can easily hook into?

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking more myself, is sending a break condition a possibility? Seems the EVENT_USB_Device_ControlRequest signal could catch this, process it to specifically check for a break before sending it to LUFA and set the flag.

Do breaks work with virtual serial ports and do you happen to know if it's something that I would likely be able to send from pyserial library?

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post