Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pio/ppm/ppm.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* 8-channel Radio Control PPM example
* Output on GPIO3
*
* >=5ms 0.5ms 1-2ms 0.5ms 1-2ms 0.5ms 1-2ms 0.5ms
* synchro strobe ch0 value strobe ch1 value strobe ch8 value strobe
* _______ _______ _______ _______
* _______...__| |_____________| |___________...| |____________| |_
* synchro / ch0 value 1-2ms \/ ch0 value 1-2ms \ / ch8 value 1-2ms \
* >=5ms _______ -500ms _______ _______ _______
* _______...__| 0.5ms |_____________| 0.5ms |___________|...| 0.5ms |____________| 0.5ms |_
*/
#include <stdio.h>

Expand Down
4 changes: 2 additions & 2 deletions pio/ppm/ppm.pio
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void ppm_handler() {
}
}

// 500 microseconds strobe and gap microseconds
#define BUILD_CH_VALUE(gap_us) (((500 - 1) << 16) + (gap_us - 1))
// 500 microseconds strobe + gap = value (microseconds)
#define BUILD_CH_VALUE(value_us) (((500 - 1) << 16) + (value_us - 500 - 1))

static inline void ppm_program_init(PIO pio, uint pin) {
ppm_data.pio = pio == NULL ? pio0 : pio;
Expand Down