|
|
|
@ -25,8 +25,34 @@
|
|
|
|
|
void usbInit(void);
|
|
|
|
|
void usbPoll(void);
|
|
|
|
|
void usbReconnect(void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Setting this value to 1 will limit the protobuf messages `usbPoll` and
|
|
|
|
|
* `waitAndProcessUSBRequests` can handle to a few defined in `msg_read_tiny`.
|
|
|
|
|
*
|
|
|
|
|
* Also affects U2F and DebugLink messages.
|
|
|
|
|
*
|
|
|
|
|
* Setting to 1 is meant to prevent infinite recursion when you need to read a
|
|
|
|
|
* message while being called from FSM.
|
|
|
|
|
*
|
|
|
|
|
* Setting to 0 allows processing all messages.
|
|
|
|
|
*/
|
|
|
|
|
char usbTiny(char set);
|
|
|
|
|
void usbSleep(uint32_t millis);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This will wait given number of milliseconds for arrival of protobuf message.
|
|
|
|
|
* If it arrives, it will service it before returning.
|
|
|
|
|
*
|
|
|
|
|
* If you call this function from any function that is called from FSM,
|
|
|
|
|
* you must use `usbTiny(1)` before and `usbTiny(oldTinyValue)` or `usbTiny(0)`
|
|
|
|
|
* after, otherwise there is possibility of stack exhaustion.
|
|
|
|
|
*/
|
|
|
|
|
void waitAndProcessUSBRequests(uint32_t millis);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Flush out any messages still in USB bus FIFO while waiting given number
|
|
|
|
|
* of milliseconds. Any incoming USB protobuf messages are not serviced.
|
|
|
|
|
*/
|
|
|
|
|
void usbFlush(uint32_t millis);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|