kopia lustrzana https://github.com/rs1729/RS
rs_multi: sync with mod
rodzic
de42745ec9
commit
ad8e5ac3e8
|
@ -932,18 +932,20 @@ static int headcmp(dsp_t *dsp, int opt_dc) {
|
||||||
|
|
||||||
//if (opt_dc == 0 || dsp->opt_iq > 1) dsp->dc = 0; // reset? e.g. 2nd pass
|
//if (opt_dc == 0 || dsp->opt_iq > 1) dsp->dc = 0; // reset? e.g. 2nd pass
|
||||||
|
|
||||||
if (dsp->symhd != 1) step = 2;
|
if (dsp->symhd != 1) step = 2; // step == symhd
|
||||||
if (inv) sign=1;
|
if (inv) sign=1;
|
||||||
|
|
||||||
for (pos = 0; pos < len; pos++) { // L = dsp->hdrlen * dsp->sps + 0.5;
|
for (pos = 0; pos < len; pos++) { // L = dsp->hdrlen * dsp->sps + 0.5;
|
||||||
//read_bufbit(dsp, dsp->symhd, dsp->rawbits+pos*step, mvp+1-(int)(len*dsp->sps), pos);
|
//read_bufbit(dsp, dsp->symhd, dsp->rawbits+pos*step, mvp+1-(int)(len*dsp->sps), pos);
|
||||||
read_bufbit(dsp, dsp->symhd, dsp->rawbits+pos*step, dsp->mv_pos+1-dsp->L, pos);
|
read_bufbit(dsp, dsp->symhd, dsp->rawbits+pos*step, dsp->mv_pos+1-dsp->L, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos = len*step; // == hdrlen
|
||||||
dsp->rawbits[pos] = '\0';
|
dsp->rawbits[pos] = '\0';
|
||||||
|
|
||||||
while (len > 0) {
|
while (pos > 0) {
|
||||||
if ((dsp->rawbits[len-1]^sign) != dsp->hdr[len-1]) errs += 1;
|
if ((dsp->rawbits[pos-1]^sign) != dsp->hdr[pos-1]) errs += 1;
|
||||||
len--;
|
pos--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return errs;
|
return errs;
|
||||||
|
|
|
@ -99,7 +99,7 @@ typedef struct {
|
||||||
double dir; double horiV; double vertV;
|
double dir; double horiV; double vertV;
|
||||||
double lat2; double lon2; double alt2;
|
double lat2; double lon2; double alt2;
|
||||||
double dir2; double horiV2; double vertV2;
|
double dir2; double horiV2; double vertV2;
|
||||||
//float T;
|
float T;
|
||||||
float Rf;
|
float Rf;
|
||||||
float _frmcnt;
|
float _frmcnt;
|
||||||
float meas24[9];
|
float meas24[9];
|
||||||
|
@ -615,6 +615,7 @@ static int reset_cfgchk(gpx_t *gpx) {
|
||||||
gpx->ptu_out = 0;
|
gpx->ptu_out = 0;
|
||||||
//gpx->gps.dMSL = 0;
|
//gpx->gps.dMSL = 0;
|
||||||
*gpx->SN_out = '\0';
|
*gpx->SN_out = '\0';
|
||||||
|
gpx->T = -273.15f;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,6 +872,18 @@ static int print_gpx(gpx_t *gpx) {
|
||||||
gpx->prev_cntsec_diff = cntsec_diff;
|
gpx->prev_cntsec_diff = cntsec_diff;
|
||||||
gpx->prev_manpol = gpx->option.inv;
|
gpx->prev_manpol = gpx->option.inv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gpx->T = -273.15f;
|
||||||
|
if (gpx->cfgchk && gpx->ptu_out)
|
||||||
|
{
|
||||||
|
gpx->T = get_Temp(gpx);
|
||||||
|
if (gpx->T < -270.0f && gpx->dfmtyp != DFM_types[UNDEF]) {
|
||||||
|
if ((gpx->sonde_typ & 0xF) == 0x8 || (gpx->sonde_typ & 0xF) == 0xC)
|
||||||
|
{
|
||||||
|
gpx->dfmtyp = DFM_types[UNKNW];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output & 0xF000) {
|
if (output & 0xF000) {
|
||||||
|
@ -902,16 +915,16 @@ static int print_gpx(gpx_t *gpx) {
|
||||||
if (gpx->cfgchk)
|
if (gpx->cfgchk)
|
||||||
{
|
{
|
||||||
if (gpx->option.ptu && gpx->ptu_out) {
|
if (gpx->option.ptu && gpx->ptu_out) {
|
||||||
float t = get_Temp(gpx);
|
//float t = get_Temp(gpx);
|
||||||
if (t > -270.0) {
|
if (gpx->T > -270.0f) {
|
||||||
printf(" T=%.1fC ", t); // 0xC:P+ DFM-09P , 0xC:T- DFM-17TU , 0xD:P- DFM-17P ?
|
printf(" T=%.1fC ", gpx->T); // 0xC:P+ DFM-09P , 0xC:T- DFM-17TU , 0xD:P- DFM-17P ?
|
||||||
if (gpx->option.vbs == 3) printf(" (0x%X:%c%c) ", gpx->sonde_typ & 0xF, gpx->sensortyp, gpx->option.inv?'-':'+');
|
if (gpx->option.vbs == 3) printf(" (0x%X:%c%c) ", gpx->sonde_typ & 0xF, gpx->sensortyp, gpx->option.inv?'-':'+');
|
||||||
}
|
}
|
||||||
if (gpx->option.dbg) {
|
if (gpx->option.dbg) {
|
||||||
float t2 = get_Temp2(gpx);
|
float t2 = get_Temp2(gpx);
|
||||||
float t4 = get_Temp4(gpx);
|
float t4 = get_Temp4(gpx);
|
||||||
if (t2 > -270.0) printf(" T2=%.1fC ", t2);
|
if (t2 > -270.0f) printf(" T2=%.1fC ", t2);
|
||||||
if (t4 > -270.0) printf(" T4=%.1fC ", t4);
|
if (t4 > -270.0f) printf(" T4=%.1fC ", t4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gpx->option.vbs == 3 && gpx->ptu_out >= 0xA) {
|
if (gpx->option.vbs == 3 && gpx->ptu_out >= 0xA) {
|
||||||
|
@ -1013,8 +1026,8 @@ static int print_gpx(gpx_t *gpx) {
|
||||||
printf(", \"batt\": %.2f", gpx->status[0]);
|
printf(", \"batt\": %.2f", gpx->status[0]);
|
||||||
}
|
}
|
||||||
if (gpx->ptu_out) { // get temperature
|
if (gpx->ptu_out) { // get temperature
|
||||||
float t = get_Temp(gpx); // ecc-valid temperature?
|
//float t = get_Temp(gpx); // ecc-valid temperature?
|
||||||
if (t > -270.0) printf(", \"temp\": %.1f", t);
|
if (gpx->T > -270.0f) printf(", \"temp\": %.1f", gpx->T);
|
||||||
}
|
}
|
||||||
if (gpx->posmode == 4 && contaux && gpx->xdata[0]) {
|
if (gpx->posmode == 4 && contaux && gpx->xdata[0]) {
|
||||||
char xdata_str[2*XDATA_LEN+1];
|
char xdata_str[2*XDATA_LEN+1];
|
||||||
|
|
|
@ -1102,7 +1102,7 @@ static int print_frame(gpx_t *gpx, int pos, dsp_t *dsp) {
|
||||||
}
|
}
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
if (gpx->option.slt /*&& gpx->option.jsn*/) {
|
if (gpx->frame_bytes[1] != 0x49 && gpx->option.slt /*&& gpx->option.jsn*/) {
|
||||||
print_pos(gpx, cs1 == cs2);
|
print_pos(gpx, cs1 == cs2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1112,6 +1112,7 @@ static int print_frame(gpx_t *gpx, int pos, dsp_t *dsp) {
|
||||||
byte = gpx->frame_bytes[i];
|
byte = gpx->frame_bytes[i];
|
||||||
fprintf(stdout, "%02x", byte);
|
fprintf(stdout, "%02x", byte);
|
||||||
}
|
}
|
||||||
|
if (cs1 == cs2) fprintf(stdout, " [OK]"); else fprintf(stdout, " [NO]");
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -921,7 +921,7 @@ static int print_frame(gpx_t *gpx, int pos, dsp_t *dsp) {
|
||||||
}
|
}
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
if (gpx->option.slt /*&& gpx->option.jsn*/) {
|
if (gpx->option.slt /*&& gpx->option.jsn && gpx->frame_bytes[1] != 0x49*/) {
|
||||||
print_pos(gpx, bc, cs1 == cs2);
|
print_pos(gpx, bc, cs1 == cs2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -932,6 +932,7 @@ static int print_frame(gpx_t *gpx, int pos, dsp_t *dsp) {
|
||||||
byte = gpx->frame_bytes[i];
|
byte = gpx->frame_bytes[i];
|
||||||
fprintf(stdout, "%02x", byte);
|
fprintf(stdout, "%02x", byte);
|
||||||
}
|
}
|
||||||
|
if (cs1 == cs2) fprintf(stdout, " [OK]"); else fprintf(stdout, " [NO]");
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue