+int usb_seremu_write_buffer_free(void)
+{
+ uint32_t len;
+
+ tx_noautoflush = 1;
+ if (!tx_packet) {
+ if (!usb_configuration ||
+ usb_tx_packet_count(SEREMU_TX_ENDPOINT) >= TX_PACKET_LIMIT ||
+ (tx_packet = usb_malloc()) == NULL) {
+ tx_noautoflush = 0;
+ return 0;
+ }
+ }
+ len = SEREMU_TX_SIZE - tx_packet->index;
+ tx_noautoflush = 0;
+ return len;
+}
+