[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avrdude-dev] Patch to support updated buspirate firmware in avrdude
From: |
Kari Knuuttila |
Subject: |
[avrdude-dev] Patch to support updated buspirate firmware in avrdude |
Date: |
Sat, 17 Jul 2010 16:19:22 +0300 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 |
Hi,
BusPirate uart interface saw some updates in recent versions which broke
the avrdude support.
This patch fixes:
* Recognition of command input line.
* 'y' answer to "Are you sure" question when performing reset.
Patch is backwards compatible.
Tested with latest BusPirate Fw 5.3 (new UI) and FW 4.3 (old UI).
-Kari Knuuttila
---
Index: buspirate.c
===================================================================
--- buspirate.c (revision 945)
+++ buspirate.c (working copy)
@@ -257,7 +257,11 @@
static int buspirate_is_prompt(char *str)
{
/* Prompt ends with '>' all other input probably ends with '\n' */
- return (str[strlen(str) - 1] == '>');
+ if( str[strlen(str) - 1] == '>' ||
+ str[strlen(str) - 2] == '>' )
+ return 1;
+ else
+ return 0;
}
static int buspirate_expect(struct programmer_t *pgm, char *send,
@@ -536,6 +540,7 @@
static void buspirate_enable(struct programmer_t *pgm)
{
unsigned char *reset_str = "#\n";
+ unsigned char *accept_str = "y\n";
char *rcvd;
int fw_v1 = 0, fw_v2 = 0;
int rc, print_banner = 0;
@@ -559,6 +564,9 @@
buspirate_enable(pgm);
return;
}
+ if (strncmp(rcvd, "Are you sure?",13) == 0) {
+ buspirate_send_bin(pgm, accept_str,
strlen(accept_str));
+ }
if (strncmp(rcvd, "RESET", 5) == 0) {
print_banner = 1;
continue;
- [avrdude-dev] Patch to support updated buspirate firmware in avrdude,
Kari Knuuttila <=