Enabled timeout timer

This commit is contained in:
Sebastian 2016-11-21 22:51:26 +01:00
parent ba28f387ef
commit 5a3b89fc81
2 changed files with 59 additions and 26 deletions

View File

@ -4,6 +4,7 @@
#include <string.h>
#include "uart.h"
#include "timer.h"
#include "sss7.h"
@ -28,6 +29,7 @@ msg[10] = 'd';
uart_init();
timer_init();
sss7_init();
sei();
@ -40,8 +42,7 @@ while(1) {
PORTB ^= (1 << PB2);
}
_delay_ms(100);
_delay_ms(1000);
}
}

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python2
import sys
import serial
def send_byte(ser, byte):
ser.reset_input_buffer()
ser.write(byte)
read_byte = ser.read()
if read_byte != byte:
print "Written %s read %s" % (hex(ord(byte)), hex(ord(read_byte)))
sys.exit(-1)
def main():
if len(sys.argv) != 2:
print "Usage %s <port>" % (sys.argv[0])
sys.exit(-1)
ser = serial.Serial(sys.argv[1], 9600, timeout=0.40)
send_byte(ser, chr(0xAA))
send_byte(ser, chr(0xFE))
for byte in "Unfinished":
send_byte(ser, byte)
if __name__ == '__main__':
main()