mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_HAL: move is_dshot_protocol to AP_HAL
This commit is contained in:
parent
9751cb5b24
commit
3b8b90d170
@ -52,3 +52,19 @@ void AP_HAL::RCOutput::append_to_banner(char banner_msg[], uint8_t banner_msg_le
|
||||
hal.util->snprintf(banner_msg, banner_msg_len, "%s %s:%u-%u", banner_msg_temp, mode_str, (unsigned)low_ch, (unsigned)high_ch);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
true when the output mode is of type dshot
|
||||
*/
|
||||
bool AP_HAL::RCOutput::is_dshot_protocol(const enum output_mode mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case MODE_PWM_DSHOT150:
|
||||
case MODE_PWM_DSHOT300:
|
||||
case MODE_PWM_DSHOT600:
|
||||
case MODE_PWM_DSHOT1200:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -202,6 +202,10 @@ public:
|
||||
MODE_NEOPIXEL, // same as MODE_PWM_DSHOT at 800kHz but it's an LED
|
||||
MODE_PROFILED, // same as MODE_PWM_DSHOT using separate clock and data
|
||||
};
|
||||
// true when the output mode is of type dshot
|
||||
// static to allow use in the ChibiOS thread stuff
|
||||
static bool is_dshot_protocol(const enum output_mode mode);
|
||||
|
||||
|
||||
// https://github.com/bitdump/BLHeli/blob/master/BLHeli_32%20ARM/BLHeli_32%20Firmware%20specs/Digital_Cmd_Spec.txt
|
||||
enum BLHeliDshotCommand : uint8_t {
|
||||
|
Loading…
Reference in New Issue
Block a user