Enhance panic message by packet no.

This commit is contained in:
Stefan `Sec` Zehl 2012-01-03 02:45:48 +01:00
parent 14c31ed175
commit b64b48d777
1 changed files with 6 additions and 4 deletions

View File

@ -95,11 +95,13 @@ MPKT * meshGetMessage(uint8_t type){
return &meshbuffer[free]; return &meshbuffer[free];
}; };
void meshPanic(uint8_t * pkt){ void meshPanic(uint8_t * pkt,int bufno){
#if 1 #if 1
setSystemFont(); setSystemFont();
lcdClear(); lcdClear();
lcdPrint("MESH-PANIC:"); lcdPrint("PANIC[");
lcdPrint(IntToStrX(bufno,2));
lcdPrint("]");
lcdNl(); lcdNl();
for(int i=0;i<32;i++){ for(int i=0;i<32;i++){
lcdPrint(IntToStrX(pkt[i],2)); lcdPrint(IntToStrX(pkt[i],2));
@ -130,7 +132,7 @@ void mesh_cleanup(void){
}; };
if(mesh_sanity(meshbuffer[i].pkt)&MP_SEND!=0){ if(mesh_sanity(meshbuffer[i].pkt)&MP_SEND!=0){
meshbuffer[i].flags=MF_FREE; meshbuffer[i].flags=MF_FREE;
meshPanic(meshbuffer[i].pkt); meshPanic(meshbuffer[i].pkt,i);
}; };
}; };
}; };
@ -219,7 +221,7 @@ uint8_t mesh_recvqloop_work(void){
if(mesh_sanity(buf)){ if(mesh_sanity(buf)){
meshincctr++; meshincctr++;
if(mesh_sanity(buf)&MP_RECV!=0){ if(mesh_sanity(buf)&MP_RECV!=0){
meshPanic(buf); meshPanic(buf,-1);
}; };
return 0; return 0;
}; };