Skip to content

Commit b51ef61

Browse files
authored
Merge pull request #199 from Pan-Chenliang/dshot_test
optimize dshot
2 parents ddfb361 + 243cba7 commit b51ef61

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

target/sieon/s1/drivers/drv_act.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,12 @@ rt_size_t main_act_write(actuator_dev_t dev, rt_uint16_t chan_sel, const rt_uint
854854
dshot_val = val;
855855
} else {
856856
float norm_throttle = (float)(val - 1000) / 1000.0f;
857-
dshot_val = dshot_throttle_to_value(norm_throttle);
857+
FMS_Out_Bus fms_out;
858+
if (mcn_copy_from_hub(MCN_HUB(fms_output), &fms_out) == FMT_EOK && fms_out.status == VehicleStatus_Disarm && norm_throttle < 0.05f) {
859+
dshot_val = DSHOT_CMD_MOTOR_STOP;
860+
} else {
861+
dshot_val = dshot_throttle_to_value(norm_throttle);
862+
}
858863
}
859864

860865
packed_sel |= (1u << i);

0 commit comments

Comments
 (0)