Use normal soft-serial function for AFHDS3

This commit is contained in:
Raphael Coeffic
2022-03-20 16:30:59 +01:00
parent 3057652b40
commit 3d6c971197
4 changed files with 9 additions and 26 deletions
+5 -4
View File
@@ -678,15 +678,16 @@ void extmoduleSendNextFrame()
extmoduleSendBuffer(extmodulePulsesData.afhds3.getData(),
extmodulePulsesData.afhds3.getSize());
#else
extmoduleSendNextFrameAFHDS3(extmodulePulsesData.afhds3.getData(),
extmodulePulsesData.afhds3.getSize());
extmoduleSendNextFrameSoftSerial(extmodulePulsesData.afhds3.getData(),
extmodulePulsesData.afhds3.getSize(),
false);
#endif
break;
#endif
#if defined(SBUS) || defined(DSM2) || defined(MULTIMODULE)
case PROTOCOL_CHANNELS_SBUS:
extmoduleSendNextFrameSoftSerial100kbit(
extmoduleSendNextFrameSoftSerial(
extmodulePulsesData.dsm2.pulses,
extmodulePulsesData.dsm2.ptr - extmodulePulsesData.dsm2.pulses,
GET_SBUS_POLARITY(EXTERNAL_MODULE));
@@ -696,7 +697,7 @@ void extmoduleSendNextFrame()
case PROTOCOL_CHANNELS_DSM2_DSM2:
case PROTOCOL_CHANNELS_DSM2_DSMX:
case PROTOCOL_CHANNELS_MULTIMODULE:
extmoduleSendNextFrameSoftSerial100kbit(
extmoduleSendNextFrameSoftSerial(
extmodulePulsesData.dsm2.pulses,
extmodulePulsesData.dsm2.ptr - extmodulePulsesData.dsm2.pulses);
break;
@@ -202,19 +202,7 @@ void extmoduleSerialStart()
stm32_pulse_config_output(&extmoduleTimer, &ocInit);
}
#if defined(AFHDS3) && !(defined(EXTMODULE_USART) && defined(EXTMODULE_TX_INVERT_GPIO))
void extmoduleSendNextFrameAFHDS3(const void* pulses, uint16_t length)
{
if (!stm32_pulse_stop_if_running(&extmoduleTimer))
return;
// Start DMA request and re-enable timer
stm32_pulse_start_dma_req(&extmoduleTimer, pulses, length);
}
#endif
void extmoduleSendNextFrameSoftSerial100kbit(const void* pulses, uint16_t length,
bool polarity)
void extmoduleSendNextFrameSoftSerial(const void* pulses, uint16_t length, bool polarity)
{
if (!stm32_pulse_stop_if_running(&extmoduleTimer))
return;
@@ -34,16 +34,11 @@ void extmoduleSendNextFramePxx1(const void* pulses, uint16_t length);
// Soft serial on PPM pin
void extmoduleSerialStart();
#if defined(AFHDS3) && !(defined(EXTMODULE_USART) && defined(EXTMODULE_TX_INVERT_GPIO))
void extmoduleSendNextFrameAFHDS3(const void* dataPtr, uint16_t dataSize);
#endif
void extmoduleSendNextFramePpm(void* pulses, uint16_t length,
uint16_t ppm_delay, bool polarity);
void extmoduleSendNextFrameSoftSerial100kbit(const void* pulses,
uint16_t length,
bool polarity = true);
void extmoduleSendNextFrameSoftSerial(const void* pulses, uint16_t length,
bool polarity = true);
// Bitbang serial
void extmoduleSendInvertedByte(uint8_t byte);
+1 -2
View File
@@ -44,8 +44,7 @@ void extmodulePxx1SerialStart() {}
void extmodulePxx1PulsesStart() {}
void extmoduleSendInvertedByte(uint8_t) {}
void extmoduleSendNextFramePxx1(void const*, unsigned short) {}
void extmoduleSendNextFrameAFHDS3(void const*, unsigned short) {}
void extmoduleSendNextFrameSoftSerial100kbit(void const*, unsigned short, bool) {}
void extmoduleSendNextFrameSoftSerial(void const*, unsigned short, bool) {}
void extmoduleSendNextFramePpm(void*, unsigned short, unsigned short, bool) {}
void init_trainer_ppm() {}