[gnoduino: 80/237] changed auto-reset method for upload: now triggered by opening port at 1200 bps
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino: 80/237] changed auto-reset method for upload: now triggered by opening port at 1200 bps
- Date: Sat, 31 Mar 2012 20:21:32 +0000 (UTC)
commit 656afdcc18b576abf3cc38a0f8687dbae1cddf95
Author: Zach Eveland <zeveland blacklabel-development com>
Date: Wed Aug 24 17:12:28 2011 -0400
changed auto-reset method for upload: now triggered by opening port at 1200 bps
arduino/boards.txt | 2 +-
arduino/cores/arduino/CDC.cpp | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/arduino/boards.txt b/arduino/boards.txt
index 4c847a9..bb5eaad 100644
--- a/arduino/boards.txt
+++ b/arduino/boards.txt
@@ -3,7 +3,7 @@
leonardo.name=Arduino Leonardo
leonardo.upload.protocol=stk500
leonardo.upload.maximum_size=30720
-leonardo.upload.speed=115200
+leonardo.upload.speed=1200
leonardo.bootloader.low_fuses=0xde
leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xf3
diff --git a/arduino/cores/arduino/CDC.cpp b/arduino/cores/arduino/CDC.cpp
index b0e5e89..7d9d682 100644
--- a/arduino/cores/arduino/CDC.cpp
+++ b/arduino/cores/arduino/CDC.cpp
@@ -94,15 +94,15 @@ 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)
{
_usbLineInfo.lineState = setup.wValueL;
-// if (_usbLineInfo.dwDTERate == 115200 && _usbLineInfo.lineState == 0) // Emulate DTR reset hack
- if (_usbLineInfo.lineState == 0)
- Reboot();
return true;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]