@@ -202,7 +202,9 @@ static void IRAM_ATTR mcpwmPulseOn() {
202202 .counter_mode = MCPWM_UP_COUNTER,
203203 };
204204 mcpwm_init (MCPWM_UNIT_1, MCPWM_TIMER_0, &pwm_config);
205- mcpwm_gpio_init (MCPWM_UNIT_1, MCPWM0A, 26 /* PWMA?*/ );
205+ // We do not connect the mcpwm output anywhere here
206+ // like with mcpwm_gpio_init(MCPWM_UNIT_1, MCPWM0A, somepin)
207+ // but we do that with gpio_matrix_out() later at another place.
206208
207209 mcpwm_sync_config_t sync_conf = {
208210 .sync_sig = MCPWM_SELECT_GPIO_SYNC0,
@@ -212,15 +214,13 @@ static void IRAM_ATTR mcpwmPulseOn() {
212214 // default is pos edge trigger, handled by mcpwm_sync_invert_gpio_synchro()
213215 // if neg edge needed
214216 mcpwm_sync_configure (MCPWM_UNIT_1, MCPWM_TIMER_0, &sync_conf);
215- #ifndef BOOSTER_INPUT
216- #error We need BOOSTER_INPUT to be defined, some temporary input pin needed
217- #endif
218- mcpwm_gpio_init (MCPWM_UNIT_1, MCPWM_SYNC_0, BOOSTER_INPUT); // used as an input placehoder, changed below
219-
220- // use internal pin instead
221- // mux name of sync 0 input: PWM1_SYNC0_IN_IDX
222- // mux name of RMT output: RMT_SIG_OUT0_IDX
223- // mux empty input mirror: SIG_IN_FUNC227_IDX
217+ // Here We wanted to do with the unused silicon "virtual" pin 30.
218+ // like this mcpwm_gpio_init(MCPWM_UNIT_1, MCPWM_SYNC_0, 30);
219+ // But mcpwm_gpio_init() checks if the pins are real so we can't do
220+ // that. Instead we use gpio_matrix_in(), see below.
221+ // mux name of pwm 1 sync 0 input: PWM1_SYNC0_IN_IDX
222+ // mux name of RMT 0 output: RMT_SIG_OUT0_IDX
223+ // pin 30 is the output opposite of a mux input mirror like the SIG_IN_FUNC227_IDX
224224 // https://docs.espressif.com/projects/rust/esp-hal/1.0.0-beta.0/esp32/src/esp_hal/soc/esp32/psram.rs.html
225225 gpio_matrix_out (30 /* unused-silicon*/ , RMT_SIG_OUT0_IDX, false , false );
226226 gpio_matrix_in (30 /* unused-silicon*/ , PWM1_SYNC0_IN_IDX, false );
0 commit comments