Index: head/devel/bossa/Makefile =================================================================== --- head/devel/bossa/Makefile (revision 438911) +++ head/devel/bossa/Makefile (revision 438912) @@ -1,49 +1,49 @@ # $FreeBSD$ PORTNAME= bossa PORTVERSION= 1.7.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= bsdports@kyle-evans.net COMMENT= Flash programmer for Atmel SAM microcontrollers LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USE_GITHUB= yes GH_ACCOUNT= shumatech GH_PROJECT= ${PORTNAME:tu} USES= compiler:c++11-lang gmake CXXFLAGS+= -I${PREFIX}/include LDFLAGS+= -L${PREFIX}/lib ALL_TARGET= bin/bossac OPTIONS_DEFINE= BOSSA BOSSASH OPTIONS_DEFAULT= BOSSASH OPTIONS_SUB= yes BOSSA_DESC= Include BOSSA GUI application using wxWidgets BOSSA_ALL_TARGET= bin/bossa BOSSA_USE= wx=3.0 wx_comps=wx BOSSASH_DESC= Include BOSSA Shell BOSSASH_USES= readline BOSSASH_ALL_TARGET= bin/bossash post-extract: ${REINPLACE_CMD} -e 's/wx-config/$${WX_CONFIG}/' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/bin/bossac ${STAGEDIR}${PREFIX}/bin/bossac do-install-BOSSA-on: ${INSTALL_PROGRAM} ${WRKSRC}/bin/bossa ${STAGEDIR}${PREFIX}/bin/bossa do-install-BOSSASH-on: ${INSTALL_PROGRAM} ${WRKSRC}/bin/bossash ${STAGEDIR}${PREFIX}/bin/bossash .include Index: head/devel/bossa/files/patch-src_PosixSerialPort.cpp =================================================================== --- head/devel/bossa/files/patch-src_PosixSerialPort.cpp (nonexistent) +++ head/devel/bossa/files/patch-src_PosixSerialPort.cpp (revision 438912) @@ -0,0 +1,47 @@ +--- src/PosixSerialPort.cpp.orig 2017-03-31 15:31:35 UTC ++++ src/PosixSerialPort.cpp +@@ -85,6 +85,9 @@ PosixSerialPort::open(int baud, + + switch (baud) + { ++ case 1200: ++ speed = B1200; ++ break; + case 9600: + speed = B9600; + break; +@@ -297,6 +300,34 @@ PosixSerialPort::timeout(int millisecs) + { + _timeout = millisecs; + return true; ++} ++ ++void ++PosixSerialPort::setDTR(bool dtr) ++{ ++ if (_devfd == -1) ++ return; ++ ++ int iFlags = TIOCM_DTR; ++ ++ if (dtr) ++ ioctl(_devfd, TIOCMBIS, &iFlags); ++ else ++ ioctl(_devfd, TIOCMBIC, &iFlags); ++} ++ ++void ++PosixSerialPort::setRTS(bool rts) ++{ ++ if (_devfd == -1) ++ return; ++ ++ int iFlags = TIOCM_RTS; ++ ++ if (rts) ++ ioctl(_devfd, TIOCMBIS, &iFlags); ++ else ++ ioctl(_devfd, TIOCMBIC, &iFlags); + } + + void Property changes on: head/devel/bossa/files/patch-src_PosixSerialPort.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/bossa/files/patch-src_PosixSerialPort.h =================================================================== --- head/devel/bossa/files/patch-src_PosixSerialPort.h (nonexistent) +++ head/devel/bossa/files/patch-src_PosixSerialPort.h (revision 438912) @@ -0,0 +1,11 @@ +--- src/PosixSerialPort.h.orig 2017-03-31 15:31:35 UTC ++++ src/PosixSerialPort.h +@@ -52,6 +52,8 @@ class PosixSerialPort : public SerialPort (public) + + bool timeout(int millisecs); + void flush(); ++ void setDTR(bool dtr); ++ void setRTS(bool rts); + void setAutoFlush(bool autoflush); + + private: Property changes on: head/devel/bossa/files/patch-src_PosixSerialPort.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/bossa/files/patch-src_SerialPort.h =================================================================== --- head/devel/bossa/files/patch-src_SerialPort.h (nonexistent) +++ head/devel/bossa/files/patch-src_SerialPort.h (revision 438912) @@ -0,0 +1,11 @@ +--- src/SerialPort.h.orig 2017-03-31 15:31:35 UTC ++++ src/SerialPort.h +@@ -68,6 +68,8 @@ class SerialPort (public) + + virtual bool timeout(int millisecs) = 0; + virtual void flush() = 0; ++ virtual void setDTR(bool dtr) = 0; ++ virtual void setRTS(bool rts) = 0; + + virtual std::string name() const { return _name; } + Property changes on: head/devel/bossa/files/patch-src_SerialPort.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/bossa/files/patch-src_WinSerialPort.cpp =================================================================== --- head/devel/bossa/files/patch-src_WinSerialPort.cpp (nonexistent) +++ head/devel/bossa/files/patch-src_WinSerialPort.cpp (revision 438912) @@ -0,0 +1,18 @@ +--- src/WinSerialPort.cpp.orig 2017-03-31 15:31:35 UTC ++++ src/WinSerialPort.cpp +@@ -251,3 +251,15 @@ WinSerialPort::flush() + { + Sleep(1); + } ++ ++void ++WinSerialPort::setDTR(bool dtr) ++{ ++ Sleep(1); ++} ++ ++void ++WinSerialPort::setRTS(bool rts) ++{ ++ Sleep(1); ++} Property changes on: head/devel/bossa/files/patch-src_WinSerialPort.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/bossa/files/patch-src_WinSerialPort.h =================================================================== --- head/devel/bossa/files/patch-src_WinSerialPort.h (nonexistent) +++ head/devel/bossa/files/patch-src_WinSerialPort.h (revision 438912) @@ -0,0 +1,11 @@ +--- src/WinSerialPort.h.orig 2017-03-31 15:31:35 UTC ++++ src/WinSerialPort.h +@@ -55,6 +55,8 @@ class WinSerialPort : public SerialPort (public) + + bool timeout(int millisecs); + void flush(); ++ void setDTR(bool dtr); ++ void setRTS(bool rts); + + private: + HANDLE _handle; Property changes on: head/devel/bossa/files/patch-src_WinSerialPort.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/bossa/files/patch-src_bossac.cpp =================================================================== --- head/devel/bossa/files/patch-src_bossac.cpp (nonexistent) +++ head/devel/bossa/files/patch-src_bossac.cpp (revision 438912) @@ -0,0 +1,69 @@ +--- src/bossac.cpp.orig 2017-03-31 15:31:35 UTC ++++ src/bossac.cpp +@@ -64,6 +64,7 @@ class BossaConfig (public) + bool help; + bool forceUsb; + string forceUsbArg; ++ bool arduinoErase; + + int readArg; + string portArg; +@@ -89,6 +90,7 @@ BossaConfig::BossaConfig() + info = false; + help = false; + forceUsb = false; ++ arduinoErase = false; + + readArg = 0; + bootArg = 1; +@@ -189,6 +191,11 @@ static Option opts[] = + 'R', "reset", &config.reset, + { ArgNone }, + "reset CPU (if supported)" ++ }, ++ { ++ 'a', "arduino_erase", &config.arduinoErase, ++ { ArgNone }, ++ "erase and reset via Arduino 1200 baud hack (cannot be used with port autodetection)" + } + }; + +@@ -257,6 +264,12 @@ main(int argc, char* argv[]) + return help(argv[0]); + } + ++ if (config.arduinoErase && !config.port) ++ { ++ fprintf(stderr, "%s: port must be specified for Arduino 1200bps erase hack\n", argv[0]); ++ return help(argv[0]); ++ } ++ + if (config.read || config.write || config.verify) + { + if (args == argc) +@@ -311,6 +324,25 @@ main(int argc, char* argv[]) + fprintf(stderr, "Invalid USB value: %s\n", config.forceUsbArg.c_str()); + return 1; + } ++ } ++ ++ if (config.arduinoErase) ++ { ++ SerialPort::Ptr port; ++ if (config.forceUsb) ++ port = portFactory.create(config.portArg, isUsb); ++ else ++ port = portFactory.create(config.portArg); ++ ++ if(!port->open(1200)) ++ { ++ fprintf(stderr, "Failed to open port at 1200bps\n"); ++ return 1; ++ } ++ ++ port->setRTS(true); ++ port->setDTR(false); ++ port->close(); + } + + if (config.port) Property changes on: head/devel/bossa/files/patch-src_bossac.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property