PPM Pulses code modification pulled from ersky9x
This commit is contained in:
@@ -43,6 +43,20 @@ extern uint8_t *pxxStreamPtr[NUM_MODULES]; // TODO not here, duplicated
|
|||||||
extern uint8_t dsm2Stream[64]; // Likely more than we need
|
extern uint8_t dsm2Stream[64]; // Likely more than we need
|
||||||
extern uint8_t *dsm2StreamPtr;
|
extern uint8_t *dsm2StreamPtr;
|
||||||
|
|
||||||
|
void module_output_active()
|
||||||
|
{
|
||||||
|
register Pio *pioptr ;
|
||||||
|
|
||||||
|
pioptr = PIOA ;
|
||||||
|
pioptr->PIO_ABCDSR[0] &= ~PIO_PA17 ; // Peripheral C
|
||||||
|
pioptr->PIO_ABCDSR[1] |= PIO_PA17 ; // Peripheral C
|
||||||
|
pioptr->PIO_PDR = PIO_PA17 ; // Disable bit A17 Assign to peripheral
|
||||||
|
pioptr->PIO_MDER = PIO_PA17 ; // Open Drain O/p in A17
|
||||||
|
// pioptr->PIO_MDDR = PIO_PA17 ; // Push Pull O/p in A17
|
||||||
|
pioptr->PIO_PUER = PIO_PA17 ; // With pull up
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_main_ppm(uint32_t period, uint32_t out_enable)
|
void init_main_ppm(uint32_t period, uint32_t out_enable)
|
||||||
{
|
{
|
||||||
register Pio *pioptr ;
|
register Pio *pioptr ;
|
||||||
@@ -51,10 +65,7 @@ void init_main_ppm(uint32_t period, uint32_t out_enable)
|
|||||||
setupPulsesPPM(EXTERNAL_MODULE) ;
|
setupPulsesPPM(EXTERNAL_MODULE) ;
|
||||||
|
|
||||||
if (out_enable) {
|
if (out_enable) {
|
||||||
pioptr = PIOA ;
|
module_output_active();
|
||||||
pioptr->PIO_ABCDSR[0] &= ~PIO_PA17 ; // Peripheral C
|
|
||||||
pioptr->PIO_ABCDSR[1] |= PIO_PA17 ; // Peripheral C
|
|
||||||
pioptr->PIO_PDR = PIO_PA17 ; // Disable bit A17 Assign to peripheral
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pwmptr = PWM ;
|
pwmptr = PWM ;
|
||||||
|
|||||||
Reference in New Issue
Block a user