File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
ports/esp32s2/common-hal/frequencyio Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -84,12 +84,9 @@ void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t*
84
84
.pulse_gpio_num = pin -> number ,
85
85
.ctrl_gpio_num = PCNT_PIN_NOT_USED ,
86
86
.channel = PCNT_CHANNEL_0 ,
87
- .lctrl_mode = PCNT_MODE_DISABLE ,
88
- .hctrl_mode = PCNT_MODE_KEEP ,
87
+ // What to do on the positive / negative edge of pulse input?
89
88
.pos_mode = PCNT_COUNT_INC , // count both rising and falling edges
90
89
.neg_mode = PCNT_COUNT_INC ,
91
- .counter_h_lim = 0 ,
92
- .counter_l_lim = 0 ,
93
90
};
94
91
95
92
// Initialize PCNT unit
@@ -129,7 +126,7 @@ void common_hal_frequencyio_frequencyin_deinit(frequencyio_frequencyin_obj_t* se
129
126
}
130
127
131
128
uint32_t common_hal_frequencyio_frequencyin_get_item (frequencyio_frequencyin_obj_t * self ) {
132
- return ( 1000 / ( self -> capture_period / self -> frequency )) ;
129
+ return self -> frequency ;
133
130
}
134
131
135
132
void common_hal_frequencyio_frequencyin_pause (frequencyio_frequencyin_obj_t * self ) {
You can’t perform that action at this time.
0 commit comments