Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow gptimer to fail gracefully #54

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/esp_dmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,12 @@ esp_err_t dmx_driver_install(dmx_port_t dmx_num, int intr_flags) {
.direction = GPTIMER_COUNT_UP,
.resolution_hz = 1000000, // 1MHz resolution timer
};
gptimer_new_timer(&timer_config, &driver->gptimer_handle); // TODO: err check
esp_err_t err = gptimer_new_timer(&timer_config, &driver->gptimer_handle);
if (err) {
ESP_LOGE(TAG, "DMX driver gptimer error");
dmx_driver_delete(dmx_num);
return err;
}
const gptimer_event_callbacks_t gptimer_cb = {.on_alarm = dmx_timer_isr};
gptimer_register_event_callbacks(driver->gptimer_handle, &gptimer_cb, driver);
gptimer_enable(driver->gptimer_handle);
Expand Down