avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] patch for uisp


From: Theodore A. Roth
Subject: [avr-gcc-list] patch for uisp
Date: Fri, 8 Mar 2002 11:20:03 -0700 (MST)

Hi,

Here's a patch for uisp which allows specifying the device (-dpart) in a 
case insensitive way. This makes it easier to write a Makefile which will 
compile and upload a program with a single rule.

The problem being that uisp currently wants a device name like "ATmega103" 
and gcc wants "atmega103". By ignoring case in uisp, you can write 
Makefile rules like this:

AVR_TARGET = atmega103
TTY_DEV    = /dev/ttyS0

CFLAGS     = -g -Wall -mmcu=$(AVR_TARGET)
LDFLAGS    =
UISP_OPTS  = -dprog=stk500 -dserial=$(TTY_DEV) -dpart=$(AVR_TARGET)

$(PRG): $(OBJ)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ)

erase:
        $(UISP) $(UISP_OPTS) --erase

upload: $(PRG).srec erase
        $(UISP) $(UISP_OPTS) --upload if=$(PRG).srec


Ted Roth


diff -urN uisp-20020303/src/AvrAtmel.C uisp-20020303-tr/src/AvrAtmel.C
--- uisp-20020303/src/AvrAtmel.C        Sun Mar  3 10:04:39 2002
+++ uisp-20020303-tr/src/AvrAtmel.C     Fri Mar  8 10:58:10 2002
@@ -490,7 +490,7 @@
     } else{
       int j;
       for (j=0; prg_part[j].name[0] != 0; j++){
-       if (strcmp (desired_partname, prg_part[j].name)==0){
+       if (strcasecmp (desired_partname, prg_part[j].name)==0){
          desired_avrcode = prg_part[j].code;
          break;
        }
diff -urN uisp-20020303/src/Stk500.C uisp-20020303-tr/src/Stk500.C
--- uisp-20020303/src/Stk500.C  Sat Aug 18 07:22:26 2001
+++ uisp-20020303-tr/src/Stk500.C       Fri Mar  8 10:31:10 2002
@@ -326,7 +326,7 @@
   if (desired_partname!=NULL) {
     int j;
     for (j=0; prg_part[j].name[0] != 0; j++){
-      if (strcmp (desired_partname, prg_part[j].name)==0){
+      if (strcasecmp (desired_partname, prg_part[j].name)==0){
     desired_part = j;
     break;
       }

avr-gcc-list at http://avr1.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]