Re: [PATCH] LPC1768: Fix compilation error

2015-11-06 Thread André Marques

Hello,

This issue was resolved earlier with the following patch

https://git.rtems.org/rtems/commit/c/src/lib/libbsp/Makefile.am?id=a57b72ded94b4e77fd4f9bd3cc37380a02e3e35a

where the inclusion of the GPIO API header file was removed from the 
libbsp/shared makefile and moved (in the case of the Raspberry Pi, but I 
forgot about the beagle BSP) to the BSP makefile which intends to use 
the API. This avoids these name clashes with BSPs that already have a 
gpio.h header file.


However the following patch reintroduced the gpio API header on the 
libbsp/shared makefile


https://git.rtems.org/rtems/commit/c/src/lib/libbsp/Makefile.am?id=6f6e5d758f6a1e7dcae74e151c3dd3d1034da232

This last patch should be reverted, and the shared/include/gpio.h should 
be included in the beagle BSP makefile that requires it, and motivated 
this reintroduction.


I think it is better to have the BSPs include the gpio API header file 
if they actually implement the API, than forcing the header to all BSPs 
and creating these problems.



Às 14:29 de 05-11-2015, Sebastian Huber escreveu:

On 05/11/15 15:17, Martin Galvan wrote:
The LPC1768 variants have a gpio.h file whose name clashes with the 
gpio.h from

the new GPIO API. This results on the BSPs failing to compile.

This patch renames the LPC1768 gpio.* files to lpc-gpio.*, as it's 
done on other

BSPs (e.g. Beaglebone).

Closes #2441.


Thanks.



--André Marques.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] LPC1768: Fix compilation error

2015-11-05 Thread Martin Galvan
The LPC1768 variants have a gpio.h file whose name clashes with the gpio.h from
the new GPIO API. This results on the BSPs failing to compile.

This patch renames the LPC1768 gpio.* files to lpc-gpio.*, as it's done on other
BSPs (e.g. Beaglebone).

Closes #2441.
---
 c/src/lib/libbsp/arm/lpc176x/Makefile.am|   4 +-
 c/src/lib/libbsp/arm/lpc176x/gpio/gpio.c| 392 
 c/src/lib/libbsp/arm/lpc176x/gpio/lpc-gpio.c| 392 
 c/src/lib/libbsp/arm/lpc176x/include/gpio.h | 100 --
 c/src/lib/libbsp/arm/lpc176x/include/lpc-gpio.h | 100 ++
 c/src/lib/libbsp/arm/lpc176x/preinstall.am  |   6 +-
 6 files changed, 497 insertions(+), 497 deletions(-)
 delete mode 100644 c/src/lib/libbsp/arm/lpc176x/gpio/gpio.c
 create mode 100644 c/src/lib/libbsp/arm/lpc176x/gpio/lpc-gpio.c
 delete mode 100644 c/src/lib/libbsp/arm/lpc176x/include/gpio.h
 create mode 100644 c/src/lib/libbsp/arm/lpc176x/include/lpc-gpio.h

diff --git a/c/src/lib/libbsp/arm/lpc176x/Makefile.am 
b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
index 50a7e79..352b2d9 100644
--- a/c/src/lib/libbsp/arm/lpc176x/Makefile.am
+++ b/c/src/lib/libbsp/arm/lpc176x/Makefile.am
@@ -41,7 +41,7 @@ include_bsp_HEADERS += include/io-defs.h
 include_bsp_HEADERS += include/io.h
 include_bsp_HEADERS += include/common-types.h
 include_bsp_HEADERS += include/gpio-defs.h
-include_bsp_HEADERS += include/gpio.h
+include_bsp_HEADERS += include/lpc-gpio.h
 include_bsp_HEADERS += include/can.h
 include_bsp_HEADERS += include/can-defs.h
 include_bsp_HEADERS += include/pwmout.h
@@ -131,7 +131,7 @@ libbsp_a_SOURCES += ../../shared/tod.c \
rtc/rtc-config.c

 # GPIO
-libbsp_a_SOURCES += gpio/gpio.c
+libbsp_a_SOURCES += gpio/lpc-gpio.c

 # CAN
 libbsp_a_SOURCES += can/can.c
diff --git a/c/src/lib/libbsp/arm/lpc176x/gpio/gpio.c 
b/c/src/lib/libbsp/arm/lpc176x/gpio/gpio.c
deleted file mode 100644
index e77e07b..000
--- a/c/src/lib/libbsp/arm/lpc176x/gpio/gpio.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/**
- * @file gpio.c
- *
- * @ingroup lpc176x
- *
- * @brief GPIO library for the lpc176x bsp.
- */
-
-/*
- * Copyright (c) 2014 Taller Technologies.
- *
- * @author  Boretto Martin(martin.bore...@tallertechnologies.com)
- * @author  Diaz Marcos (marcos.d...@tallertechnologies.com)
- * @author  Lenarduzzi Federico  (federico.lenardu...@tallertechnologies.com)
- * @author  Daniel Chicco  (daniel.chi...@tallertechnologies.com)
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-static uint32_t  function_vector_size = 0u;
-static lpc176x_registered_interrupt_function function_vector[
-  LPC176X_RESERVED_ISR_FUNCT_SIZE ];
-static bool isr_installed = false;
-
-rtems_status_code lpc176x_gpio_config(
-  const lpc176x_pin_number pin,
-  const lpc176x_gpio_direction dir
-)
-{
-  rtems_status_code status_code = RTEMS_INVALID_NUMBER;
-
-  if ( ( pin < LPC176X_MAX_PORT_NUMBER ) &&
-   ( dir < LPC176X_GPIO_FUNCTION_COUNT ) ) {
-const lpc176x_gpio_ports port = LPC176X_IO_PORT( pin );
-const uint32_t   pin_of_port = LPC176X_IO_PORT_BIT( pin );
-
-lpc176x_pin_select( pin, LPC176X_PIN_FUNCTION_00 );
-
-LPC176X_SET_BIT( LPC176X_FIO[ port ].dir, pin_of_port, dir );
-
-status_code = RTEMS_SUCCESSFUL;
-  }
-
-  /* else implies that the pin or the egde are out of range. Also,
- an invalid number is returned. */
-
-  return status_code;
-}
-
-/**
- * @brief Check for a rising edge and call the interrupt function.
- *
- * @param statR Rising edge interrupt.
- * @param pin The pin to check.
- * @param registered_isr_function Interrupt to check.
- * @return TRUE if is a rising edge. FALSE otherwise.
- */
-static bool lpc176x_check_rising_edge_and_call(
-  const uint32_t  statR,
-  const lpc176x_registered_interrupt_function registered_isr_function,
-  const uint32_t  pin
-)
-{
-  bool is_rising = false;
-
-  if ( statR & LPC176X_PIN_BIT( pin ) ) {
-registered_isr_function.function( registered_isr_function.pin,
-  LPC176X_GPIO_INTERRUPT_RISING );
-is_rising = true;
-  }
-
-  /* else implies that the current interrupt is not STATR. Also,
- there is nothing to do. */
-
-  return is_rising;
-}
-
-/**
- * @brief Check for a falling edge and call the interrupt function.
- *
- * @param statR Falling edge interrupt.
- * @param pin The pin to check.
- * @param registered_isr_function Interrupt to check.
- * @return TRUE if is a falling edge. FALSE otherwise.
- */
-static bool lpc176x_check_falling_edge_and_call(
-  const uint32_t  statF,
-  const lpc176x_registered_interrupt_function registered_isr_function,
-  const uint32_t  pin
-)
-{
-  bool is_falling = false;
-
-