# HG changeset patch # User Ethan Zonca # Date 2017-10-10 15:52:14 # Node ID f2aec7c1f1bb1f6c51733640ccc22e98638cc858 # Parent af6b7df096c5fe520ae205d30ce0f013310f4cff Encode fix diff --git a/src/wspr.c b/src/wspr.c --- a/src/wspr.c +++ b/src/wspr.c @@ -150,17 +150,18 @@ void wspr_transmit(uint8_t* grid_locator speed_enc = 41; // Encode GPS status - uint32_t gps_status = 0b00; // MSB is valid fix, lsb is sats > 8 + uint32_t gps_status = 0b0 // valid fix + uint32_t gps_sats = 0b0 // lats > 8 // We always have a fix if we got to this point; and I think we zero out that we had a fix when turning the GPS off before entering this function // if(gps_getdata()->fixtype == 2 || gps_getdata()->fixtype == 3) - gps_status |= 0b10; + gps_status = 0b1; if(gps_getdata()->sats_in_solution > 5) - gps_status |= 0b01; + gps_sats = 0b1; - uint32_t engdata = gps_status + 2 * (speed_enc + 42 * (batt_enc + 40 * temp_enc)); + uint32_t engdata = gps_sats + 2 * (gps_status + 2 * (speed_enc + 42 * (batt_enc + 40 * temp_enc))); //////////////////////////////////////////// // Encode temp/batt/speed/gps