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 mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avrdude-dev