mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
Changed RSSI range to 0..255
This commit is contained in:
@@ -89,7 +89,7 @@ struct rc_input_values {
|
|||||||
/** number of channels actually being seen */
|
/** number of channels actually being seen */
|
||||||
uint32_t channel_count;
|
uint32_t channel_count;
|
||||||
|
|
||||||
/** receive signal strength indicator (RSSI): < 0: Undefined, 0: no signal, 1000: full reception */
|
/** receive signal strength indicator (RSSI): < 0: Undefined, 0: no signal, 255: full reception */
|
||||||
int32_t rssi;
|
int32_t rssi;
|
||||||
|
|
||||||
/** Input source */
|
/** Input source */
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ controls_tick() {
|
|||||||
* other. Don't do that.
|
* other. Don't do that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* receive signal strenght indicator (RSSI). 0 = no connection, 1000: perfect connection */
|
/* receive signal strenght indicator (RSSI). 0 = no connection, 255: perfect connection */
|
||||||
uint16_t rssi = 0;
|
uint16_t rssi = 0;
|
||||||
|
|
||||||
perf_begin(c_gather_dsm);
|
perf_begin(c_gather_dsm);
|
||||||
@@ -108,7 +108,7 @@ controls_tick() {
|
|||||||
else
|
else
|
||||||
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RC_DSM11;
|
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_RC_DSM11;
|
||||||
|
|
||||||
rssi = 1000;
|
rssi = 255;
|
||||||
}
|
}
|
||||||
perf_end(c_gather_dsm);
|
perf_end(c_gather_dsm);
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ controls_tick() {
|
|||||||
if (ppm_updated) {
|
if (ppm_updated) {
|
||||||
|
|
||||||
/* XXX sample RSSI properly here */
|
/* XXX sample RSSI properly here */
|
||||||
rssi = 1000;
|
rssi = 255;
|
||||||
|
|
||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_PPM;
|
r_status_flags |= PX4IO_P_STATUS_FLAGS_RC_PPM;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ sbus_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, uint
|
|||||||
*rssi = 100; // XXX magic number indicating bad signal, but not a signal loss (yet)
|
*rssi = 100; // XXX magic number indicating bad signal, but not a signal loss (yet)
|
||||||
}
|
}
|
||||||
|
|
||||||
*rssi = 1000;
|
*rssi = 255;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user