mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Changes to sonar for new IO
This commit is contained in:
parent
4bd0b0fb9c
commit
c16d642d66
19 changed files with 150 additions and 113 deletions
|
@ -265,12 +265,11 @@ void init(void)
|
|||
|
||||
if (feature(FEATURE_SONAR)) {
|
||||
sonarHardware = sonarGetHardwareConfiguration(&masterConfig.batteryConfig);
|
||||
sonarGPIOConfig_t sonarGPIOConfig = {
|
||||
.gpio = SONAR_GPIO,
|
||||
.triggerPin = sonarHardware->echo_pin,
|
||||
.echoPin = sonarHardware->trigger_pin,
|
||||
sonarIOConfig_t sonarConfig = {
|
||||
.triggerPin = sonarHardware->triggerIO,
|
||||
.echoPin = sonarHardware->echoIO
|
||||
};
|
||||
pwm_params.sonarGPIOConfig = &sonarGPIOConfig;
|
||||
pwm_params.sonarConfig = &sonarConfig;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue