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
+11 -20
View File
@@ -222,18 +222,25 @@ void disable_pxx(uint32_t port)
}
}
void init_dsm2(uint32_t port)
void init_serial(uint32_t port, uint32_t baudrate, uint32_t period_half_us)
{
if (port == EXTERNAL_MODULE) {
init_main_ppm(2500 * 2, 0);
init_ssc(125);
if (baudrate == 125000) {
// TODO init_main_ppm could take the period as parameter?
init_main_ppm(2500 * 2, 0);
init_ssc(125);
}
else {
init_main_ppm(3500 * 2, 0);
init_ssc(100);
}
}
else {
// TODO
}
}
void disable_dsm2(uint32_t port)
void disable_serial(uint32_t port)
{
if (port == EXTERNAL_MODULE) {
disable_ssc();
@@ -244,22 +251,6 @@ void disable_dsm2(uint32_t port)
}
}
void init_sbusOut(uint32_t port)
{
if (port == EXTERNAL_MODULE) {
init_main_ppm(3500 * 2, 0);
init_ssc(100);
}
else {
// TODO
}
}
void disable_sbusOut(uint32_t port)
{
disable_dsm2(port);
}
#if !defined(SIMU)
extern "C" void PWM_IRQHandler(void)
{