fix: signal polarity for soft-serial & timer based protocols (#3513)

* fix: signal polarity for soft-serial & timer based protocols

* fix: first PWM period after init
This commit is contained in:
Raphael Coeffic
2023-05-05 19:20:29 +10:00
committed by GitHub
parent f5c1a93f87
commit 6aa1fc90c4
5 changed files with 5 additions and 10 deletions
+2 -2
View File
@@ -106,7 +106,7 @@ static void* ppmInit(uint8_t module)
auto delay = GET_MODULE_PPM_DELAY(module) * 2;
etx_timer_config_t cfg = {
.type = ETX_PWM,
.polarity = GET_MODULE_PPM_POLARITY(module),
.polarity = !GET_MODULE_PPM_POLARITY(module),
.cmp_val = (uint16_t)delay,
};
@@ -141,7 +141,7 @@ static void ppmSendPulses(void* ctx, uint8_t* buffer, int16_t* channels, uint8_t
auto delay = GET_MODULE_PPM_DELAY(module) * 2;
etx_timer_config_t cfg = {
.type = ETX_PWM,
.polarity = GET_MODULE_PPM_POLARITY(module),
.polarity = !GET_MODULE_PPM_POLARITY(module),
.cmp_val = (uint16_t)delay,
};