Ticket #2390: gpio_api_bug.patch

File gpio_api_bug.patch, 1.9 KB (added by Ketul Shah, on Aug 13, 2015 at 2:22:34 PM)
  • c/src/lib/libbsp/shared/gpio.c

    From bb986cf9b233566b37cf6a166be95a22f54c0559 Mon Sep 17 00:00:00 2001
    From: Ketul Shah <ketulshah1993@gmail.com>
    Date: Thu, 13 Aug 2015 18:17:16 +0530
    Subject: [PATCH] Found a small bug in GPIO API while testing on BBB.
    
     c/src/lib/libbsp/shared/gpio.c              |  4 +--
     c/src/lib/libbsp/shared/include/gpio.h      |  4 +--
     1 files changed, 4 insertions(+), 4 deletions(-)
    
    ---
    diff --git a/c/src/lib/libbsp/shared/gpio.c b/c/src/lib/libbsp/shared/gpio.c
    index a87b39f..c2d0b1d 100644
    a b rtems_status_code rtems_gpio_clear(uint32_t pin_number) 
    12501250  return sc;
    12511251}
    12521252
    1253 uint8_t rtems_gpio_get_value(uint32_t pin_number)
     1253uint32_t rtems_gpio_get_value(uint32_t pin_number)
    12541254{
    12551255  uint32_t bank;
    12561256  uint32_t pin;
    1257   int rv;
     1257  uint32_t rv;
    12581258
    12591259  if ( pin_number < 0 || pin_number >= BSP_GPIO_PIN_COUNT ) {
    12601260    return -1;
  • c/src/lib/libbsp/shared/include/gpio.h

    diff --git a/c/src/lib/libbsp/shared/include/gpio.h b/c/src/lib/libbsp/shared/include/gpio.h
    index b2deb1e..84161ac 100644
    a b extern rtems_status_code rtems_gpio_clear(uint32_t pin_number); 
    444444 *         logical value.
    445445 * @retval -1 Pin number is invalid, or not a digital input pin.
    446446 */
    447 extern uint8_t rtems_gpio_get_value(uint32_t pin_number);
     447extern uint32_t rtems_gpio_get_value(uint32_t pin_number);
    448448
    449449/**
    450450 * @brief Requests multiple GPIO pin configurations. If the BSP provides
    extern rtems_status_code rtems_gpio_bsp_clear(uint32_t bank, uint32_t pin); 
    806806 *         logical value.
    807807 * @retval -1 Could not read the pin level.
    808808 */
    809 extern uint8_t rtems_gpio_bsp_get_value(uint32_t bank, uint32_t pin);
     809extern uint32_t rtems_gpio_bsp_get_value(uint32_t bank, uint32_t pin);
    810810
    811811/**
    812812 * @brief Assigns the digital input function to the given pin.