From 9ed2f4013ff66889f93d630c194c7b544a632ad8 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Sun, 17 Dec 2023 16:34:13 -0300 Subject: [PATCH 1/3] Improve Log Messages --- cores/esp32/esp32-hal-gpio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index 456f12c833e..255305cf07c 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -104,14 +104,14 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) #endif if (pin >= SOC_GPIO_PIN_COUNT) { - log_e("Invalid pin selected"); + log_e("Invalid pin (%i) selected", pin); return; } if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ perimanSetBusDeinit(ESP32_BUS_TYPE_GPIO, gpioDetachBus); if(!perimanClearPinBus(pin)){ - log_e("Deinit of previous bus failed"); + log_e("Deinit of previous bus from GPIO %i failed", pin); return; } } @@ -140,7 +140,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) } if(gpio_config(&conf) != ESP_OK) { - log_e("GPIO config failed"); + log_e("GPIO %i config failed", pin); return; } if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ @@ -164,7 +164,7 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val) if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) != NULL){ gpio_set_level((gpio_num_t)pin, val); } else { - log_e("Pin is not set as GPIO."); + log_e("Pin %i is not set as GPIO.", pin); } } @@ -174,7 +174,7 @@ extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin) return gpio_get_level((gpio_num_t)pin); } else { - log_e("Pin is not set as GPIO."); + log_e("Pin %i is not set as GPIO.", pin); return 0; } } @@ -204,7 +204,7 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE); } if(!interrupt_initialized) { - log_e("GPIO ISR Service Failed To Start"); + log_e("GPIO %i ISR Service Failed To Start", pin); return; } From 7facaa1a1c09aef7944e18d931533cc11fa3fe3d Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 18 Dec 2023 09:52:45 -0300 Subject: [PATCH 2/3] uses pin# in log messages --- cores/esp32/esp32-hal-gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index 255305cf07c..8f6bb10395d 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -111,7 +111,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ perimanSetBusDeinit(ESP32_BUS_TYPE_GPIO, gpioDetachBus); if(!perimanClearPinBus(pin)){ - log_e("Deinit of previous bus from GPIO %i failed", pin); + log_e("Deinit of previous bus from pin %i failed", pin); return; } } @@ -140,7 +140,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) } if(gpio_config(&conf) != ESP_OK) { - log_e("GPIO %i config failed", pin); + log_e("Pin %i config failed", pin); return; } if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ @@ -204,7 +204,7 @@ extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, interrupt_initialized = (err == ESP_OK) || (err == ESP_ERR_INVALID_STATE); } if(!interrupt_initialized) { - log_e("GPIO %i ISR Service Failed To Start", pin); + log_e("IO %i ISR Service Failed To Start", pin); return; } From a32278efed463a72e3724f3b9a600911c7da5474 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Tue, 19 Dec 2023 13:36:19 -0300 Subject: [PATCH 3/3] Uses IO # in messages --- cores/esp32/esp32-hal-gpio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index 8f6bb10395d..ad7f0904c6b 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -104,14 +104,14 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) #endif if (pin >= SOC_GPIO_PIN_COUNT) { - log_e("Invalid pin (%i) selected", pin); + log_e("Invalid IO %i selected", pin); return; } if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ perimanSetBusDeinit(ESP32_BUS_TYPE_GPIO, gpioDetachBus); if(!perimanClearPinBus(pin)){ - log_e("Deinit of previous bus from pin %i failed", pin); + log_e("Deinit of previous bus from IO %i failed", pin); return; } } @@ -140,7 +140,7 @@ extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode) } if(gpio_config(&conf) != ESP_OK) { - log_e("Pin %i config failed", pin); + log_e("IO %i config failed", pin); return; } if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) == NULL){ @@ -164,7 +164,7 @@ extern void ARDUINO_ISR_ATTR __digitalWrite(uint8_t pin, uint8_t val) if(perimanGetPinBus(pin, ESP32_BUS_TYPE_GPIO) != NULL){ gpio_set_level((gpio_num_t)pin, val); } else { - log_e("Pin %i is not set as GPIO.", pin); + log_e("IO %i is not set as GPIO.", pin); } } @@ -174,7 +174,7 @@ extern int ARDUINO_ISR_ATTR __digitalRead(uint8_t pin) return gpio_get_level((gpio_num_t)pin); } else { - log_e("Pin %i is not set as GPIO.", pin); + log_e("IO %i is not set as GPIO.", pin); return 0; } }