From 7c2ece0331e0cd9dad9f738698c1d58d04558858 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sun, 24 Jan 2016 16:06:58 +0100 Subject: tut --- avr/1wire.c | 18 +++++--- avr/main.c | 5 ++- pc/__pycache__/analyze.cpython-34.pyc | Bin 0 -> 4154 bytes pc/analyze.py | 80 ++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 pc/__pycache__/analyze.cpython-34.pyc create mode 100644 pc/analyze.py diff --git a/avr/1wire.c b/avr/1wire.c index 5dbca82..affd80d 100644 --- a/avr/1wire.c +++ b/avr/1wire.c @@ -79,15 +79,20 @@ uint8_t w1_bit_io( uint8_t b ) _delay_us( 1 ); if( b ) { - //hard_vcc; - //asm volatile("nop" ::: ); + hard_vcc; + _delay_us(7 ); soft_vcc; + _delay_us( 15 - 1 - 7 ); + } + else + { + _delay_us( 15 - 1 ); } - _delay_us( 15 - 1 ); if( (W1_IN & (1<0.9999] + +def showstats(stats): + for stat,pos in zip(stats,range(len(stats))): + print("%i:\t%s"%(pos,str(dict(stat)))) + +def prettydict(d): + for k,v in sorted(d.items(), key=lambda a:-a[1]): + print("%02X: %2.0f | "%(k,100*v),end="") + print("") + +d = Dumps() +d.load("mydump.txt") + +cc = getconstcols(stats(mirror(d.filter([],[])))) +d.show(cc,[]) + +for i in stats(mirror(d.filter(cc,[]))): + prettydict(i) -- cgit v1.2.1