add void Adafruit_TinyUSB_Core_touch1200(void)

This commit is contained in:
hathach committed 2019-05-15 23:04:32 +07:00
1 parent aee0e26e50
commit a18c380009
3 files changed
+9 -1

No files matched your search

@@ -94,6 +94,11 @@ void Adafruit_TinyUSB_Core_init(void)
xTaskCreate( usb_device_task, "usbd", USBD_STACK_SZ, NULL, TASK_PRIO_HIGH, NULL);
}
void Adafruit_TinyUSB_Core_touch1200(void)
{
enterSerialDfu();
}
uint8_t load_serial_number(uint16_t* serial_str)
{
// Serial is 64-bit DeviceID -> 16 chars len
@@ -39,4 +39,7 @@
// Called by main.cpp to initialize usb device typically with CDC device for Serial
void Adafruit_TinyUSB_Core_init(void);
// Invoked when host disconnects cdc at baud 1200, usually touch feature to go into DFU mode
void Adafruit_TinyUSB_Core_touch1200(void);
#endif /* ADAFRUIT_TINYUSB_CORE_H_ */
@@ -131,7 +131,7 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
cdc_line_coding_t coding;
tud_cdc_get_line_coding(&coding);
if ( coding.bit_rate == 1200 ) enterSerialDfu();
if ( coding.bit_rate == 1200 ) Adafruit_TinyUSB_Core_touch1200();
}
}