Browse Source

Add a function to test if USB interrupt send would block

pull/5/head
Raphael Assenat 6 years ago
parent
commit
39e7ba9d49
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      usb.c
  2. +1
    -0
      usb.h

+ 5
- 0
usb.c View File

@ -604,6 +604,11 @@ ISR(USB_COM_vect)
#endif
}
char usb_interruptReady(void)
{
return interrupt_data_len == -1;
}
void usb_interruptSend(void *data, int len)
{
uint8_t sreg = SREG;


+ 1
- 0
usb.h View File

@ -198,6 +198,7 @@ struct usb_parameters {
struct usb_hid_parameters hid_params[MAX_HID_INTERFACES];
};
char usb_interruptReady(void);
void usb_interruptSend(void *data, int len); // EP1
void usb_init(const struct usb_parameters *params);
void usb_doTasks(void);


Loading…
Cancel
Save