mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
Operational mixing and outputs in hil
This commit is contained in:
@@ -211,8 +211,9 @@ HIL::init()
|
|||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* try to claim the generic PWM output device node as well - it's OK if we fail at this */
|
// XXX already claimed with CDEV
|
||||||
ret = register_driver(PWM_OUTPUT_DEVICE_PATH, &fops, 0666, (void *)this);
|
///* try to claim the generic PWM output device node as well - it's OK if we fail at this */
|
||||||
|
//ret = register_driver(PWM_OUTPUT_DEVICE_PATH, &fops, 0666, (void *)this);
|
||||||
if (ret == OK) {
|
if (ret == OK) {
|
||||||
log("default PWM output device");
|
log("default PWM output device");
|
||||||
_primary_pwm_device = true;
|
_primary_pwm_device = true;
|
||||||
@@ -821,12 +822,12 @@ hil_main(int argc, char *argv[])
|
|||||||
if (strcmp(argv[i], "-u") == 0 || strcmp(argv[i], "--update-rate") == 0) {
|
if (strcmp(argv[i], "-u") == 0 || strcmp(argv[i], "--update-rate") == 0) {
|
||||||
// if (new_mode == PORT1_FULL_PWM || new_mode == PORT1_PWM_AND_GPIO) {
|
// if (new_mode == PORT1_FULL_PWM || new_mode == PORT1_PWM_AND_GPIO) {
|
||||||
// XXX all modes have PWM settings
|
// XXX all modes have PWM settings
|
||||||
if (argc > i + 1) {
|
if (argc > i + 1) {
|
||||||
pwm_update_rate_in_hz = atoi(argv[i + 1]);
|
pwm_update_rate_in_hz = atoi(argv[i + 1]);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "missing argument for pwm update rate (-u)\n");
|
fprintf(stderr, "missing argument for pwm update rate (-u)\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
// } else {
|
// } else {
|
||||||
// fprintf(stderr, "pwm update rate currently only supported for mode_pwm, mode_pwm_gpio\n");
|
// fprintf(stderr, "pwm update rate currently only supported for mode_pwm, mode_pwm_gpio\n");
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user