aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/diskloader/src/CDC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bootloaders/diskloader/src/CDC.cpp')
-rw-r--r--bootloaders/diskloader/src/CDC.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/bootloaders/diskloader/src/CDC.cpp b/bootloaders/diskloader/src/CDC.cpp
index cc798b4..a542d3c 100644
--- a/bootloaders/diskloader/src/CDC.cpp
+++ b/bootloaders/diskloader/src/CDC.cpp
@@ -23,13 +23,6 @@
#if defined(USBCON)
#ifdef CDC_ENABLED
-void Reboot()
-{
- USB.detach();
- cli();
- asm volatile("jmp 0x7800"); // jump to bootloader - DiskLoader takes up last 2 kB
-}
-
typedef struct
{
u32 dwDTERate;
@@ -92,8 +85,6 @@ bool WEAK CDC_Setup(Setup& setup)
if (CDC_SET_CONTROL_LINE_STATE == r)
{
-// if (0 != _usbLineInfo.lineState && 1200 == _usbLineInfo.dwDTERate) // auto-reset is triggered when the port, already open at 1200 bps, is closed
-// Reboot();
_usbLineInfo.lineState = setup.wValueL;
return true;
}
@@ -101,73 +92,5 @@ bool WEAK CDC_Setup(Setup& setup)
return false;
}
-/*
-int _serialPeek = -1;
-void Serial_::begin(uint16_t baud_count)
-{
-}
-
-void Serial_::end(void)
-{
-}
-
-int Serial_::available(void)
-{
- u8 avail = USB_Available(CDC_RX);
- if (_serialPeek != -1)
- avail++;
- return avail;
-}
-
-// peek is nasty
-int Serial_::peek(void)
-{
- if (_serialPeek == -1)
- _serialPeek = read();
- return _serialPeek;
-}
-
-int Serial_::read(void)
-{
- int c;
- if (_serialPeek != -1)
- {
- c = _serialPeek;
- _serialPeek = -1;
- } else {
- c = USB_Recv(CDC_RX);
- }
- return c;
-}
-
-
-
-void Serial_::flush(void)
-{
- USB_Flush(CDC_TX);
-}
-
-size_t Serial_::write(uint8_t c)
-{
-
- // TODO - ZE - check behavior on different OSes and test what happens if an
- // open connection isn't broken cleanly (cable is yanked out, host dies
- // or locks up, or host virtual serial port hangs)
- if (_usbLineInfo.lineState > 0) {
- int r = USB_Send(CDC_TX,&c,1);
- if (r > 0) {
- return r;
- } else {
-// setWriteError();
- return 0;
- }
- }
-// setWriteError();
- return 0;
-}
-
-Serial_ Serial;
-*/
-
#endif
#endif /* if defined(USBCON) */ \ No newline at end of file