kopia lustrzana https://github.com/sp9skp/spdxl
dekodowanie napiecia RS41
rodzic
be5320bacf
commit
507e47faa9
|
@ -585,6 +585,8 @@ static void updateChanT(){
|
|||
|
||||
if(qrg>999000) qrg=(long int)(qrg/10);
|
||||
|
||||
rxx[i].afckhz=0; // reset AFC
|
||||
|
||||
sprintf(tmp,"%02i%06li",i+1,(long int)(qrg));
|
||||
tmp1[0]=tmp[0];
|
||||
tmp1[1]=' ';
|
||||
|
|
|
@ -266,6 +266,7 @@ struct CONTEXTR4 {
|
|||
char serialNumber[6];
|
||||
unsigned long killTimer;
|
||||
double ozonval;
|
||||
float vbat;
|
||||
};
|
||||
|
||||
struct CONTEXTM10;
|
||||
|
@ -2771,6 +2772,14 @@ static int32_t getint16(const char frame[], uint32_t frame_len,
|
|||
return (int32_t)n;
|
||||
} /* end getint16() */
|
||||
|
||||
static int32_t getint24(const char frame[], uint32_t frame_len, uint32_t p)
|
||||
{
|
||||
uint32_t n;
|
||||
n = (uint32_t)(uint8_t)frame[p]+ 256UL*(uint32_t)(uint8_t)frame[p+1UL] +512UL*(uint32_t)(uint8_t)frame[p+2UL];
|
||||
if (n>=8388608UL) return (int32_t)(n-16777216UL);
|
||||
return (int32_t)n;
|
||||
} /* end getint16() */
|
||||
|
||||
|
||||
static uint32_t gethex(const char frame[], uint32_t frame_len,
|
||||
uint32_t p, uint32_t nibb)
|
||||
|
@ -3029,12 +3038,16 @@ static void decoders41(const char rxb[], uint32_t rxb_len,
|
|||
if (sondeaprs_verb) osi_WrStrLn("is new ", 8ul);
|
||||
}
|
||||
frameno = (uint32_t)getint16(rxb, rxb_len, p);
|
||||
|
||||
|
||||
if (frameno>pc->framenum) {
|
||||
/* new frame number */
|
||||
pc->framesent = 0;
|
||||
calok = 1;
|
||||
pc->framenum = frameno;
|
||||
pc->tused = systime;
|
||||
pc->vbat = (float)(getint24(rxb, rxb_len, p+10))/10.0;
|
||||
printf("VBAT:%f\n",pc->vbat);
|
||||
}
|
||||
else if (pc->framenum==frameno && !pc->framesent) calok = 1;
|
||||
else if (frameno<pc->framenum && sondeaprs_verb) {
|
||||
|
@ -3236,14 +3249,14 @@ static void decoders41(const char rxb[], uint32_t rxb_len,
|
|||
sondeaprs_nofilter,"RS41",5,0);
|
||||
pc->framesent = 1;
|
||||
//SKP
|
||||
store_sonde_db( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,0,0,0,0);
|
||||
if(saveLog) save_Slog( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,0,0,0,0);
|
||||
store_sonde_db( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,pc->vbat,0,0,0);
|
||||
if(saveLog) save_Slog( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,pc->vbat,0,0,0);
|
||||
}
|
||||
|
||||
|
||||
if (((pc && nameok) && lat!=0.0) && long0!=0.0) {
|
||||
store_sonde_rs( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,0,0,0,0,usercall);
|
||||
if(saveLog) save_Slog( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,0,0,0,0);
|
||||
store_sonde_rs( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,pc->vbat,0,0,0,usercall);
|
||||
if(saveLog) save_Slog( pc->name,frameno,lat,long0,heig,speed,dir,climb,4,pc->burstKill,pc->swVersion,pc->ozonval,pc->aux,0.0,(double)pc->mhz0,pc->vbat,0,0,0);
|
||||
}
|
||||
/* IF verb THEN WrStrLn("") END; */
|
||||
} /* end decoders41() */
|
||||
|
|
|
@ -769,7 +769,7 @@ static void Config(void)
|
|||
}
|
||||
{ // with
|
||||
struct PILS * anonym5 = &chan[c].pils;
|
||||
anonym5->configbaud = 4808UL;
|
||||
anonym5->configbaud = 4804UL;
|
||||
anonym5->demodbaud = (2UL*anonym5->configbaud*65536UL)/adcrate; //4800
|
||||
// initafir(anonym5->afirtab, 0UL, 2200UL, X2C_DIVR((float)(chan[c].configequalizer+120),100.0f)); //V9
|
||||
initafir(anonym5->afirtab, 0UL, 2200UL, X2C_DIVR((float)(chan[c].configequalizer+60),100.0f)); //v10
|
||||
|
|
Ładowanie…
Reference in New Issue