mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
Perform DMA check before writing to motors.
This commit is contained in:
parent
954d99a9d6
commit
f15bdcdce9
3 changed files with 13 additions and 1 deletions
|
@ -71,6 +71,10 @@ void pwmWriteDigital(uint8_t index, uint16_t value)
|
||||||
|
|
||||||
motorDmaOutput_t * const motor = &dmaMotors[index];
|
motorDmaOutput_t * const motor = &dmaMotors[index];
|
||||||
|
|
||||||
|
if (!motor->timerHardware->dmaChannel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
||||||
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,10 @@ void pwmWriteDigital(uint8_t index, uint16_t value)
|
||||||
|
|
||||||
motorDmaOutput_t * const motor = &dmaMotors[index];
|
motorDmaOutput_t * const motor = &dmaMotors[index];
|
||||||
|
|
||||||
|
if (!motor->timerHardware->dmaStream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
||||||
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,10 @@ void pwmWriteDigital(uint8_t index, uint16_t value)
|
||||||
|
|
||||||
motorDmaOutput_t * const motor = &dmaMotors[index];
|
motorDmaOutput_t * const motor = &dmaMotors[index];
|
||||||
|
|
||||||
|
if (!motor->timerHardware->dmaStream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
uint16_t packet = (value << 1) | (motor->requestTelemetry ? 1 : 0);
|
||||||
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
motor->requestTelemetry = false; // reset telemetry request to make sure it's triggered only once in a row
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue