Fix: Prevent death restart caused by setting button pin to GPIO_NUM_NC (#98)

This commit is contained in:
HonestQiao 2025-01-23 20:49:50 +08:00 committed by GitHub
parent 84f5674359
commit 87425b821c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,7 @@ static const char* TAG = "Button";
Button::Button(gpio_num_t gpio_num, bool active_high) : gpio_num_(gpio_num) {
if (gpio_num == GPIO_NUM_NC) {
button_handle_ = NULL;
return;
}
button_config_t button_config = {