gustavonihei commented on a change in pull request #5795: URL: https://github.com/apache/incubator-nuttx/pull/5795#discussion_r830359762
########## File path: arch/xtensa/src/esp32s3/esp32s3_gpio.c ########## @@ -141,25 +202,37 @@ int esp32s3_configgpio(int pin, gpio_pinattr_t attr) * Name: esp32s3_gpio_matrix_in * * Description: - * Set gpio input to a signal - * NOTE: one gpio can input to several signals - * If gpio == 0x3c, cancel input to the signal, input 0 to signal. - * If gpio == 0x3a, input nothing to signal. - * If gpio == 0x38, cancel input to the signal, input 1 to signal. + * Set GPIO input to a signal. + * NOTE: one GPIO can input to several signals. + * + * Input Parameters: + * pin - GPIO pin to be configured. + * - If pin == 0x3c, cancel input to the signal, input 0 + * to signal. + * - If pin == 0x3a, input nothing to signal. + * - If pin == 0x38, cancel input to the signal, input 1 + * to signal. + * signal_idx - Signal index. + * inv - Flag indicating whether the signal is inverted. + * + * Returned Value: + * None. * ****************************************************************************/ -void esp32s3_gpio_matrix_in(uint32_t gpio, uint32_t signal_idx, bool inv) +void esp32s3_gpio_matrix_in(uint32_t pin, uint32_t signal_idx, bool inv) { uint32_t regaddr = GPIO_FUNC0_IN_SEL_CFG_REG + (signal_idx * 4); - uint32_t regval = (gpio << GPIO_FUNC0_IN_SEL_S); + uint32_t regval = (pin << GPIO_FUNC0_IN_SEL_S); + + DEBUGASSERT(is_valid_gpio(pin)); if (inv) { regval |= GPIO_FUNC0_IN_INV_SEL; } - if (gpio != 0x3a) + if (pin != 0x3a) Review comment: The **0x3c** and **0x38** values will be handled by the GPIO Matrix peripheral, so no need to perform extra verification here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org