More work on pulses ...
This commit is contained in:
@@ -20,103 +20,118 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
void intmoduleStop(void);
|
||||
void extmoduleStop(void);
|
||||
|
||||
void intmoduleNoneStart(void);
|
||||
void intmodulePxxStart(void);
|
||||
void intmoduleStop();
|
||||
void intmoduleTimerStart(uint32_t period, uint8_t state);
|
||||
void intmodulePxxStart();
|
||||
void intmodulePxx2Start();
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
void intmodulePpmStart(void);
|
||||
#endif
|
||||
|
||||
void extmoduleStop();
|
||||
void extmoduleTimerStart(uint32_t period, uint8_t state);
|
||||
void extmodulePpmStart(void);
|
||||
void extmodulePxxStart(void);
|
||||
void extmodulePpmStart();
|
||||
void extmodulePxxStart();
|
||||
void extmodulePxx2Start();
|
||||
void extmoduleSerialStart(uint32_t baudrate, uint32_t period_half_us);
|
||||
|
||||
|
||||
void init_pxx(uint32_t port)
|
||||
void init_pxx(uint8_t module)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmodulePxxStart();
|
||||
else
|
||||
extmodulePxxStart();
|
||||
}
|
||||
|
||||
void disable_pxx(uint32_t port)
|
||||
void disable_pxx(uint8_t module)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
void init_pxx2(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmodulePxx2Start();
|
||||
else
|
||||
extmodulePxx2Start();
|
||||
}
|
||||
|
||||
void disable_pxx2(uint8_t module)
|
||||
{
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
#if defined(DSM2)
|
||||
void init_serial(uint32_t port, uint32_t baudrate, uint32_t period_half_us)
|
||||
void init_serial(uint8_t module, uint32_t baudrate, uint32_t period_half_us)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmoduleSerialStart(baudrate, period_half_us);
|
||||
}
|
||||
}
|
||||
|
||||
void disable_serial(uint32_t port)
|
||||
void disable_serial(uint8_t module)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void init_ppm(uint32_t port)
|
||||
void init_ppm(uint8_t module)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmodulePpmStart();
|
||||
}
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
else if (port == INTERNAL_MODULE) {
|
||||
else {
|
||||
intmodulePpmStart();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void disable_ppm(uint32_t port)
|
||||
void disable_ppm(uint8_t module)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == EXTERNAL_MODULE) {
|
||||
extmoduleStop();
|
||||
}
|
||||
#if defined(TARANIS_INTERNAL_PPM)
|
||||
else if (port == INTERNAL_MODULE) {
|
||||
else {
|
||||
intmoduleStop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void init_no_pulses(uint32_t port)
|
||||
void init_no_pulses(uint8_t module)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
intmoduleNoneStart();
|
||||
else
|
||||
extmoduleTimerStart(18, false);
|
||||
init_module_timer(module, 18, false);
|
||||
}
|
||||
|
||||
void disable_no_pulses(uint32_t port)
|
||||
void disable_no_pulses(uint8_t module)
|
||||
{
|
||||
if (port == INTERNAL_MODULE)
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
|
||||
void init_module_timer(uint32_t port, uint32_t period, uint8_t state)
|
||||
void init_module_timer(uint8_t module, uint32_t period, uint8_t state)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleTimerStart(period, state);
|
||||
else
|
||||
extmoduleTimerStart(period, state);
|
||||
}
|
||||
}
|
||||
|
||||
void disable_module_timer(uint32_t port)
|
||||
void disable_module_timer(uint8_t module)
|
||||
{
|
||||
if (port == EXTERNAL_MODULE) {
|
||||
if (module == INTERNAL_MODULE)
|
||||
intmoduleStop();
|
||||
else
|
||||
extmoduleStop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user