From 540a76faf88dcf9b8fae85e4e9c5f3e6e800e0f0 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 3 Aug 2011 16:44:46 +0200 Subject: [PATCH 1/2] Support missing symbols --- firmware/l0dable/mktable.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/l0dable/mktable.pl b/firmware/l0dable/mktable.pl index 25ab08b..cc96e87 100755 --- a/firmware/l0dable/mktable.pl +++ b/firmware/l0dable/mktable.pl @@ -82,7 +82,10 @@ my %defs; for my $idx (0..$#symb){ $_=$symb[$idx]; if(!$types{$_}){ - warn "Couldn't find $symb[$idx]"; + warn "Couldn't find $symb[$idx] - ignoring it."; + print C "NULL,"; + print I "#define $_ (NULL)"; + next; }; if(!$defs{$files{$_}}){ print H qq!#include "$files{$_}"!; @@ -103,3 +106,5 @@ close(I); close(H); close(C); +print "done."; + From 187fde3638c186ca1a62b92f90f6ed863122895d Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 3 Aug 2011 16:46:48 +0200 Subject: [PATCH 2/2] Add mesh debugging counter --- firmware/funk/mesh.c | 9 +++++++-- firmware/funk/mesh.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/firmware/funk/mesh.c b/firmware/funk/mesh.c index 8e001e6..e69a798 100644 --- a/firmware/funk/mesh.c +++ b/firmware/funk/mesh.c @@ -1,3 +1,4 @@ +#include #include #include #include "basic/basic.h" @@ -7,6 +8,7 @@ #include "basic/random.h" char meshgen=0; // Generation +char meshincctr=0; // Generation MPKT meshbuffer[MESHBUFSIZE]; uint32_t const meshkey[4] = { @@ -96,12 +98,15 @@ void mesh_recvloop(void){ else meshgen=MO_GEN(buf); _timet=0; + meshincctr=0; }; if(MO_TYPE(buf)=='T'){ - time_t toff=MO_TIME(buf)-((getTimer()+(300/SYSTICKSPEED))/(1000/SYSTICKSPEED)); - if (toff>_timet) // Do not live in the past. + time_t toff=MO_TIME(buf)-((getTimer()+(600/SYSTICKSPEED))/(1000/SYSTICKSPEED)); + if (toff>_timet){ // Do not live in the past. _timet = toff; + meshincctr++; + }; continue; }; diff --git a/firmware/funk/mesh.h b/firmware/funk/mesh.h index 54f1beb..2ff8f35 100644 --- a/firmware/funk/mesh.h +++ b/firmware/funk/mesh.h @@ -29,6 +29,7 @@ typedef struct { #define MF_LOCK (1<<1) extern char meshgen; // Generation +extern char meshincctr; // Time checker extern MPKT meshbuffer[MESHBUFSIZE]; void initMesh(void);