mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 08:41:36 +08:00
Build fix, added command line switch norc to disable RC
This commit is contained in:
@@ -175,6 +175,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
void print_status();
|
void print_status();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable RC input handling
|
||||||
|
*/
|
||||||
|
int disable_rc_handling();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the DSM VCC is controlled by relay one flag
|
* Set the DSM VCC is controlled by relay one flag
|
||||||
*
|
*
|
||||||
@@ -276,6 +281,11 @@ private:
|
|||||||
*/
|
*/
|
||||||
int io_get_status();
|
int io_get_status();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable RC input handling
|
||||||
|
*/
|
||||||
|
int io_disable_rc_handling();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch RC inputs from IO.
|
* Fetch RC inputs from IO.
|
||||||
*
|
*
|
||||||
@@ -853,6 +863,12 @@ PX4IO::io_set_arming_state()
|
|||||||
return io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, clear, set);
|
return io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, clear, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
PX4IO::io_disable_rc_handling()
|
||||||
|
{
|
||||||
|
return io_disable_rc_handling();
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
PX4IO::io_disable_rc_handling()
|
PX4IO::io_disable_rc_handling()
|
||||||
{
|
{
|
||||||
@@ -1785,6 +1801,16 @@ start(int argc, char *argv[])
|
|||||||
errx(1, "driver init failed");
|
errx(1, "driver init failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* disable RC handling on request */
|
||||||
|
if (argc > 0 && !strcmp(argv[0], "norc")) {
|
||||||
|
|
||||||
|
if(g_dev->disable_rc_handling())
|
||||||
|
warnx("Failed disabling RC handling");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
warnx("unknown argument: %s", argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
int dsm_vcc_ctl;
|
int dsm_vcc_ctl;
|
||||||
|
|
||||||
if (param_get(param_find("RC_RL1_DSM_VCC"), &dsm_vcc_ctl) == OK) {
|
if (param_get(param_find("RC_RL1_DSM_VCC"), &dsm_vcc_ctl) == OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user