Skip to content

Commit 41e1704

Browse files
committed
Fixes config and install call order
1 parent 13c8926 commit 41e1704

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/m5_unit_component/adapter_gpio_v1.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ class GPIOImplV1 : public AdapterGPIOBase::GPIOImpl {
153153

154154
dump_rmt_config(_tx_config, "TX");
155155

156-
auto err = rmt_driver_install(_tx_config.channel, 0, 0);
156+
auto err = rmt_config(&_tx_config);
157157
if (err != ESP_OK) {
158-
M5_LIB_LOGE("Failed to install TX %d:%s", err, esp_err_to_name(err));
158+
M5_LIB_LOGE("Failed to config TX %d:%s", err, esp_err_to_name(err));
159159
return false;
160160
}
161161

162-
err = rmt_config(&_tx_config);
162+
err = rmt_driver_install(_tx_config.channel, 0, 0);
163163
if (err != ESP_OK) {
164-
M5_LIB_LOGE("Failed to config TX %d:%s", err, esp_err_to_name(err));
164+
M5_LIB_LOGE("Failed to install TX %d:%s", err, esp_err_to_name(err));
165165
return false;
166166
}
167167

@@ -194,15 +194,15 @@ class GPIOImplV1 : public AdapterGPIOBase::GPIOImpl {
194194

195195
dump_rmt_config(_rx_config, "RX");
196196

197-
auto err = rmt_driver_install(_rx_config.channel, cfg.rx.ring_buffer_size, 0);
197+
auto err = rmt_config(&_rx_config);
198198
if (err != ESP_OK) {
199-
M5_LIB_LOGE("Failed to install RX %d:%s", err, esp_err_to_name(err));
199+
M5_LIB_LOGE("Failed to config RX %d:%s", err, esp_err_to_name(err));
200200
return false;
201201
}
202202

203-
err = rmt_config(&_rx_config);
203+
err = rmt_driver_install(_rx_config.channel, cfg.rx.ring_buffer_size, 0);
204204
if (err != ESP_OK) {
205-
M5_LIB_LOGE("Failed to config RX %d:%s", err, esp_err_to_name(err));
205+
M5_LIB_LOGE("Failed to install RX %d:%s", err, esp_err_to_name(err));
206206
return false;
207207
}
208208

0 commit comments

Comments
 (0)