From 0c56f055753b8f31e81b5a47dcda0a4eed68afb7 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 15 Feb 2011 00:34:43 -0300 Subject: [PATCH] nanonote.patch: cleanup and properly power down on exit (also turns off LED) - nanonote.c: remove some commented-out items - nanonote.c (nanonote_powerdown): make all data lines inputs on exit, making it more likely that the target powers down --- uart/avrdude/patches/nanonote.patch | 37 +++++++++++++---------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/uart/avrdude/patches/nanonote.patch b/uart/avrdude/patches/nanonote.patch index 3bb0079..acc9f3a 100644 --- a/uart/avrdude/patches/nanonote.patch +++ b/uart/avrdude/patches/nanonote.patch @@ -1,7 +1,7 @@ Index: avrdude/avrdude-5.10/Makefile.am =================================================================== ---- avrdude.orig/avrdude-5.10/Makefile.am 2011-02-09 21:16:39.000000000 -0300 -+++ avrdude/avrdude-5.10/Makefile.am 2011-02-09 21:17:04.000000000 -0300 +--- avrdude.orig/avrdude-5.10/Makefile.am 2011-02-15 00:16:48.000000000 -0300 ++++ avrdude/avrdude-5.10/Makefile.am 2011-02-15 00:16:52.000000000 -0300 @@ -111,6 +111,8 @@ lists.c \ lists.h \ @@ -13,8 +13,8 @@ Index: avrdude/avrdude-5.10/Makefile.am pgm.c \ Index: avrdude/avrdude-5.10/config_gram.y =================================================================== ---- avrdude.orig/avrdude-5.10/config_gram.y 2011-02-09 21:16:39.000000000 -0300 -+++ avrdude/avrdude-5.10/config_gram.y 2011-02-09 21:17:04.000000000 -0300 +--- avrdude.orig/avrdude-5.10/config_gram.y 2011-02-15 00:16:48.000000000 -0300 ++++ avrdude/avrdude-5.10/config_gram.y 2011-02-15 00:16:52.000000000 -0300 @@ -48,6 +48,7 @@ #include "avr.h" #include "jtagmkI.h" @@ -46,8 +46,8 @@ Index: avrdude/avrdude-5.10/config_gram.y current_prog->desc[PGM_DESCLEN-1] = 0; Index: avrdude/avrdude-5.10/lexer.l =================================================================== ---- avrdude.orig/avrdude-5.10/lexer.l 2011-02-09 21:16:39.000000000 -0300 -+++ avrdude/avrdude-5.10/lexer.l 2011-02-09 21:17:04.000000000 -0300 +--- avrdude.orig/avrdude-5.10/lexer.l 2011-02-15 00:16:48.000000000 -0300 ++++ avrdude/avrdude-5.10/lexer.l 2011-02-15 00:16:52.000000000 -0300 @@ -164,6 +164,7 @@ min_write_delay { yylval=NULL; return K_MIN_WRITE_DELAY; } miso { yylval=NULL; return K_MISO; } @@ -59,8 +59,8 @@ Index: avrdude/avrdude-5.10/lexer.l Index: avrdude/avrdude-5.10/nanonote.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ avrdude/avrdude-5.10/nanonote.c 2011-02-09 21:17:18.000000000 -0300 -@@ -0,0 +1,295 @@ ++++ avrdude/avrdude-5.10/nanonote.c 2011-02-15 00:20:23.000000000 -0300 +@@ -0,0 +1,290 @@ +/* + * avrdude - A Downloader/Uploader for AVR device programmers + * Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean @@ -81,15 +81,12 @@ Index: avrdude/avrdude-5.10/nanonote.c + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ -+/* $Id: serbb_posix.c 917 2010-01-15 16:40:17Z joerg_wunsch $ */ + +/* + * Posix serial bitbanging interface for avrdude. + */ + + -+//#include "ac_cfg.h" -+ +#include +#include +#include @@ -98,15 +95,7 @@ Index: avrdude/avrdude-5.10/nanonote.c +#include +#include + -+/* -+#include -+#include -+#include -+*/ -+ -+//#include "avrdude.h" +#include "avr.h" -+//#include "pindefs.h" +#include "pgm.h" +#include "bitbang.h" + @@ -290,7 +279,13 @@ Index: avrdude/avrdude-5.10/nanonote.c + +static void nanonote_powerdown(PROGRAMMER *pgm) +{ -+ misc_high(pgm); ++ gpio_input(DAT0); ++ gpio_input(CLK); ++ gpio_input(CMD); ++ gpio_input(DAT3); ++ gpio_input(DAT2); ++ gpio_input(DAT1); ++ gpio_high(POWER_OFF); +} + + @@ -359,7 +354,7 @@ Index: avrdude/avrdude-5.10/nanonote.c Index: avrdude/avrdude-5.10/nanonote.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ avrdude/avrdude-5.10/nanonote.h 2011-02-09 21:17:04.000000000 -0300 ++++ avrdude/avrdude-5.10/nanonote.h 2011-02-15 00:16:52.000000000 -0300 @@ -0,0 +1,6 @@ +#ifndef nanonote_h +#define nanonote_h