aboutsummaryrefslogtreecommitdiff
path: root/cores
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-09-06 20:58:00 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-09-06 20:58:00 -0400
commitd81084e8e91ec4abc24e4b3f6a9ecb9621a6c736 (patch)
tree7b915649ba6f5b863a959cb345426fc4752f7e22 /cores
parent95fd39090e324e8f4ea683d39af829c692ecba93 (diff)
changed auto-reset trigger condition to fix auto-reset-and-upload for Windows. now reboots when a port, opened at 1200 bps, is closed.
Diffstat (limited to 'cores')
-rw-r--r--cores/arduino/CDC.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp
index 3ad3e98..5059cec 100644
--- a/cores/arduino/CDC.cpp
+++ b/cores/arduino/CDC.cpp
@@ -95,14 +95,13 @@ bool WEAK CDC_Setup(Setup& setup)
if (CDC_SET_LINE_CODING == r)
{
USB_RecvControl((void*)&_usbLineInfo,7);
- if (1200 == _usbLineInfo.dwDTERate) // auto-reset is triggered when avrdude opens the port at 1200 bps
- Reboot();
-
return true;
}
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;
}