optimized fuses, rx binary crap filter

Sat, 21 Dec 2013 16:21:06 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Sat, 21 Dec 2013 16:21:06 +0100
changeset 145
80be5eb283d3
parent 144
8f07a8d15826
child 146
a1eb2dc83819

optimized fuses, rx binary crap filter

blackbox/Makefile file | annotate | diff | comparison | revisions
blackbox/main.c file | annotate | diff | comparison | revisions
slotUI/freeslot.py file | annotate | diff | comparison | revisions
--- a/blackbox/Makefile	Sat Dec 21 14:54:21 2013 +0100
+++ b/blackbox/Makefile	Sat Dec 21 16:21:06 2013 +0100
@@ -2,7 +2,8 @@
 
 MCU=atmega16
 #FUSES=-U lfuse:w:0x3f:m -U hfuse:w:0xd8:m
-FUSES=-U lfuse:w:0x2f:m -U hfuse:w:0xc8:m
+#FUSES=-U lfuse:w:0x2f:m -U hfuse:w:0xc8:m
+FUSES=-U lfuse:w:0x3c:m -U hfuse:w:0xc9:m
 BOOTFUSES=-U lfuse:w:0xff:m -U hfuse:w:0xce:m
 
 #F_CPU=4185600
@@ -95,7 +96,7 @@
 	$(AVRDUDE) $(PROGRAMMER) -b $(ISP_BAUD) -i 1 -p $(MCU) -V -U flash:w:$(PRG).hex:i
 
 fuse:
-	$(AVRDUDE) -c $(PROGRAMMER) -p $(MCU) -V $(FUSES)
+	$(AVRDUDE) $(PROGRAMMER) -p $(MCU) -V $(FUSES)
 
 clean:
 	rm -rf *.o *.elf *.elf.src *.s *.i
--- a/blackbox/main.c	Sat Dec 21 14:54:21 2013 +0100
+++ b/blackbox/main.c	Sat Dec 21 16:21:06 2013 +0100
@@ -260,7 +260,7 @@
                         slot[tmp].unlimitedfuel = 0;
                         if ((buffer[2]-'0') != 0) slot[tmp].unlimitedfuel = 1;
                         RS232_puts_p(ok);
-                    } RS232_puts_p(error);
+                    } else RS232_puts_p(error);
                     break;
 
                 case 'L': // Limit maximum speed for a car
--- a/slotUI/freeslot.py	Sat Dec 21 14:54:21 2013 +0100
+++ b/slotUI/freeslot.py	Sat Dec 21 16:21:06 2013 +0100
@@ -125,7 +125,11 @@
             self.com.readline() # clear to next linefeed
             line =  "RW:%i:%i:%i:%i:%x\n" % (slot, track, sender, status, clk)
         self.log.write(line)
-        return line
+        if line.find(chr(0)) == -1:
+            return line
+        else:
+            self.log.write("malformed RX\n")
+            return ""
 
     def query(self, msg):
         if self.com:

mercurial