Skip to content

Commit 7307246

Browse files
Changes in sensor's reports
Horizon availability bit inverted to support backward compatibility Moved sensor health CAN packet to the right place
1 parent 31a374b commit 7307246

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Output_Formatter/CAN_output.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ enum CAN_ID_SENSOR
4444
CAN_Id_SlipPitch = 0x128, //!< float slip angle from body-acc, float pitch angle from body-acc
4545
CAN_Id_Voltage_Circle = 0x129, //!< float supply voltage, uint8_t circle-mode
4646
CAN_Id_SystemState = 0x12a, //!< u32 system_state, u32 git_tag dec
47+
CAN_Id_Sensor_Health = 0x12b, //!< float magnetic disturbance
4748

4849
CAN_Id_GPS_Date_Time = 0x140, //!< uint8_t year-2000, month, day, hour, mins, secs
4950
CAN_Id_GPS_Lat = 0x141, //!< double latitude
5051
CAN_Id_GPS_Lon = 0x142, //!< double longitude
5152
CAN_Id_GPS_Alt = 0x143, //!< float MSL altitude, float geo separation
5253
CAN_Id_GPS_Trk_Spd = 0x144, //!< float ground track, float groundspeed / m/s
5354
CAN_Id_GPS_Sats = 0x145, //!< uin8_t No of Sats, (uint8_t)bool SAT FIX type
54-
CAN_Id_Health = 0x146, //!< uin8_t No of Sats, (uint8_t)bool SAT FIX type
5555

5656
CAN_Id_Heartbeat_Sens = 0x520,
5757
CAN_Id_Heartbeat_GNSS = 0x540,
@@ -125,6 +125,11 @@ void CAN_output ( const output_data_t &x, bool horizon_activated)
125125
p.data_b[4] = (uint8_t)(x.flight_mode);
126126
CAN_send(p, 1);
127127

128+
p.id=CAN_Id_Sensor_Health;
129+
p.dlc=4;
130+
p.data_f[0] = x.magnetic_disturbance;
131+
CAN_send(p, 1);
132+
128133
p.id=CAN_Id_GPS_Date_Time;
129134
p.dlc=7;
130135
p.data_h[0] = x.c.year + 2000; // GNSS reports only 2000 + x
@@ -162,11 +167,6 @@ void CAN_output ( const output_data_t &x, bool horizon_activated)
162167
p.dlc=2;
163168
p.data_b[0] = x.c.SATS_number;
164169
p.data_b[1] = x.c.sat_fix_type;
165-
CAN_send(p, 1);
166-
167-
p.id=CAN_Id_Health;
168-
p.dlc=4;
169-
p.data_f[0] = x.magnetic_disturbance;
170170

171171
if( CAN_send(p, 1)) // check CAN for timeout this time
172172
system_state |= CAN_OUTPUT_ACTIVE;

Output_Formatter/system_state.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum availability_bits
2626
CAN_OUTPUT_ACTIVE = 0x4000,
2727
USART_2_OUTPUT_ACTIVE = 0x8000,
2828

29-
HORIZON_AVAILABLE = 0x10000
29+
HORIZON_NOT_AVAILABLE = 0x10000
3030
};
3131

3232
extern uint32_t system_state; //!< bits collected from availability_bits

0 commit comments

Comments
 (0)