Mesh now turns message LED on on new message

This commit is contained in:
Stefan `Sec` Zehl 2011-08-04 14:54:16 +02:00
parent b814761438
commit 2e1f1a69d1
3 changed files with 15 additions and 1 deletions

View File

@ -128,6 +128,9 @@ void m_choose(){
char list[99];
int i=0;
meshmsg=0;
gpioSetValue (RB_LED1, 0);
while(1){
char *p=list;
strcpy(p,"Note");
@ -231,5 +234,10 @@ void m_choose(){
void tick_mesh(void){
if(GLOBAL(privacy)<2)
mesh_systick();
if(_timectr%64)
if(meshmsg){
gpioSetValue (RB_LED1, 1);
meshmsg=0;
};
};

View File

@ -9,6 +9,7 @@
char meshgen=0; // Generation
char meshincctr=0;
char meshmsg=0;
MPKT meshbuffer[MESHBUFSIZE];
uint32_t const meshkey[4] = {
@ -124,9 +125,13 @@ void mesh_recvloop(void){
// only accept newer/better packets
if(mpkt->flags==MF_USED)
if(MO_TIME(buf)<MO_TIME(mpkt->pkt))
if(MO_TIME(buf)<=MO_TIME(mpkt->pkt))
continue;
if((MO_TYPE(buf)>='A' && MO_TYPE(buf)<='C') ||
(MO_TYPE(buf)>='A' && MO_TYPE(buf)<='C'))
meshmsg=1;
memcpy(mpkt->pkt,buf,MESHPKTSIZE);
mpkt->flags=MF_USED;

View File

@ -30,6 +30,7 @@ typedef struct {
extern char meshgen; // Generation
extern char meshincctr; // Time checker
extern char meshmsg; // Is there something interesting?
extern MPKT meshbuffer[MESHBUFSIZE];
void initMesh(void);