mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Merge pull request #277 from GullCode/adsb_warning_fix
Fix adsb warnings
This commit is contained in:
commit
fe98a58a4f
@ -319,14 +319,14 @@ void encode_frame_velo(ADSBFrame& frame, const uint32_t ICAO_address, const uint
|
|||||||
|
|
||||||
// Decoding method from dump1090
|
// Decoding method from dump1090
|
||||||
adsb_vel decode_frame_velo(ADSBFrame& frame){
|
adsb_vel decode_frame_velo(ADSBFrame& frame){
|
||||||
adsb_vel velo {false, 0, 0};
|
adsb_vel velo {false, 0, 0, 0};
|
||||||
|
|
||||||
uint8_t * frame_data = frame.get_raw_data();
|
uint8_t * frame_data = frame.get_raw_data();
|
||||||
uint8_t velo_type = frame.get_msg_sub();
|
uint8_t velo_type = frame.get_msg_sub();
|
||||||
|
|
||||||
if(velo_type >= 1 && velo_type <= 4){ //vertical rate is always present
|
if(velo_type >= 1 && velo_type <= 4){ //vertical rate is always present
|
||||||
|
|
||||||
velo.v_rate = (((frame_data[8] & 0x07 ) << 6) | ((frame_data[9]) >> 2) - 1) * 64;
|
velo.v_rate = (((frame_data[8] & 0x07 ) << 6) | ((frame_data[9] >> 2) - 1)) * 64;
|
||||||
|
|
||||||
if((frame_data[8] & 0x8) >> 3) velo.v_rate *= -1; //check v_rate sign
|
if((frame_data[8] & 0x8) >> 3) velo.v_rate *= -1; //check v_rate sign
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t * get_raw_data() const {
|
uint8_t * get_raw_data() const {
|
||||||
return (uint8_t* const)raw_data;
|
return (uint8_t* )raw_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void make_CRC() {
|
void make_CRC() {
|
||||||
|
Loading…
Reference in New Issue
Block a user