Merge branch 'master' of github.com:r0ket/r0ket

This commit is contained in:
schneider 2011-08-03 16:47:00 +02:00
commit 335e14e17f
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,4 @@
#include <sysdefs.h>
#include <sysinit.h> #include <sysinit.h>
#include <string.h> #include <string.h>
#include "basic/basic.h" #include "basic/basic.h"
@ -7,6 +8,7 @@
#include "basic/random.h" #include "basic/random.h"
char meshgen=0; // Generation char meshgen=0; // Generation
char meshincctr=0; // Generation
MPKT meshbuffer[MESHBUFSIZE]; MPKT meshbuffer[MESHBUFSIZE];
uint32_t const meshkey[4] = { uint32_t const meshkey[4] = {
@ -96,12 +98,15 @@ void mesh_recvloop(void){
else else
meshgen=MO_GEN(buf); meshgen=MO_GEN(buf);
_timet=0; _timet=0;
meshincctr=0;
}; };
if(MO_TYPE(buf)=='T'){ if(MO_TYPE(buf)=='T'){
time_t toff=MO_TIME(buf)-((getTimer()+(300/SYSTICKSPEED))/(1000/SYSTICKSPEED)); time_t toff=MO_TIME(buf)-((getTimer()+(600/SYSTICKSPEED))/(1000/SYSTICKSPEED));
if (toff>_timet) // Do not live in the past. if (toff>_timet){ // Do not live in the past.
_timet = toff; _timet = toff;
meshincctr++;
};
continue; continue;
}; };

View File

@ -29,6 +29,7 @@ typedef struct {
#define MF_LOCK (1<<1) #define MF_LOCK (1<<1)
extern char meshgen; // Generation extern char meshgen; // Generation
extern char meshincctr; // Time checker
extern MPKT meshbuffer[MESHBUFSIZE]; extern MPKT meshbuffer[MESHBUFSIZE];
void initMesh(void); void initMesh(void);

View File

@ -82,7 +82,10 @@ my %defs;
for my $idx (0..$#symb){ for my $idx (0..$#symb){
$_=$symb[$idx]; $_=$symb[$idx];
if(!$types{$_}){ 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{$_}}){ if(!$defs{$files{$_}}){
print H qq!#include "$files{$_}"!; print H qq!#include "$files{$_}"!;
@ -103,3 +106,5 @@ close(I);
close(H); close(H);
close(C); close(C);
print "done.";