Bsongis/xlite pxx (#5856)

Pulses refactoring
This commit is contained in:
Bertrand Songis
2018-04-29 22:55:29 +02:00
committed by GitHub
parent 6ec64b227c
commit cfc02f67eb
22 changed files with 209 additions and 217 deletions
+12 -1
View File
@@ -106,6 +106,8 @@ void uartPutPcmCrc(uint8_t port)
}
#endif
#if !defined(INTMODULE_USART) || !defined(EXTMODULE_USART)
#if defined(PPM_PIN_SERIAL)
void pxxPutPcmSerialBit(uint8_t port, uint8_t bit)
{
@@ -180,7 +182,7 @@ void pxxInitPcmArray(uint8_t port)
#if defined(PPM_PIN_SERIAL)
modulePulsesData[port].pxx.pcmValue = 0;
#else
modulePulsesData[port].pxx.rest = 18000;
modulePulsesData[port].pxx.rest = PXX_PERIOD_HALF_US;
#endif
modulePulsesData[port].pxx.pcmOnesCount = 0;
@@ -211,6 +213,15 @@ void pxxPutPcmCrc(uint8_t port)
pxxPutPcmByte(port, pulseValue >> 8);
pxxPutPcmByte(port, pulseValue);
}
#else
// those functions should not be used, a link error will occur if wrong
void pxxInitPcmArray(uint8_t port);
void pxxInitPcmCrc(uint8_t port);
void pxxPutPcmByte(uint8_t port, uint8_t byte);
void pxxPutPcmHead(uint8_t port);
void pxxPutPcmTail(uint8_t port);
void pxxPutPcmCrc(uint8_t port);
#endif
#if defined(INTMODULE_USART) || defined(EXTMODULE_USART)
inline void initPcmArray(uint8_t port)