mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 08:27:34 +08:00
px4iofirmware: fixed display of sbus rate in px4io status
This commit is contained in:
committed by
Lorenz Meier
parent
c5f5b9f53c
commit
fde635ef5a
@@ -2614,6 +2614,7 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
/* set override immediate flag */
|
||||
ret = io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, 0, PX4IO_P_SETUP_ARMING_OVERRIDE_IMMEDIATE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PWM_SERVO_SET_SBUS_RATE:
|
||||
|
||||
+4
-2
@@ -117,7 +117,7 @@ static enum SBUS2_DECODE_STATE {
|
||||
static uint8_t sbus_frame[SBUS_FRAME_SIZE + (SBUS_FRAME_SIZE / 2)];
|
||||
|
||||
static unsigned partial_frame_count;
|
||||
static unsigned sbus1_frame_delay = (1000U*1000U)/SBUS1_DEFAULT_RATE_HZ;
|
||||
static unsigned sbus1_frame_delay = (1000U * 1000U) / SBUS1_DEFAULT_RATE_HZ;
|
||||
|
||||
static unsigned sbus_frame_drops;
|
||||
|
||||
@@ -646,8 +646,10 @@ void sbus1_set_output_rate_hz(uint16_t rate_hz)
|
||||
if (rate_hz > SBUS1_MAX_RATE_HZ) {
|
||||
rate_hz = SBUS1_MAX_RATE_HZ;
|
||||
}
|
||||
|
||||
if (rate_hz < SBUS1_MIN_RATE_HZ) {
|
||||
rate_hz = SBUS1_MIN_RATE_HZ;
|
||||
}
|
||||
sbus1_frame_delay = (1000U*1000U) / rate_hz;
|
||||
|
||||
sbus1_frame_delay = (1000U * 1000U) / rate_hz;
|
||||
}
|
||||
|
||||
@@ -685,6 +685,7 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
|
||||
break;
|
||||
|
||||
case PX4IO_P_SETUP_SBUS_RATE:
|
||||
r_page_setup[offset] = value;
|
||||
sbus1_set_output_rate_hz(value);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user