[NEW BSP] Mbed lpc1768 board

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 6 14:31:50 UTC 2014


On 2014-06-06 16:25, Marcos Díaz wrote:
> Sorry, i didn't understand what is the new coding style we are adding.

You use for example four space characters for indentation and sometimes align 
function parameters in this way

+static inline uint8_t lpc176x_uart_get_register(const uintptr_t addr,
+        const uint8_t i)
+{
+    volatile uint32_t *reg = (volatile uint32_t *) addr;
+    return (uint8_t) reg [i];
+}

or this way

+rtems_status_code lpc176x_gpio_config(const lpc176x_pin_number pin,
+                                      const lpc176x_gpio_direction dir)
+{

You use

+    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);

and also

+    for(i=0; i < function_vector_size; ++i)
+    {

so not "for (".  Sometimes a space between operators, sometimes not.

You use

+    typedef struct
+    {
+        /**
+         * @brief Pin board.
+         */
+        lpc176x_pin_number pin;
+        /**
+         * @brief A function that attends an interrupt for 'pin'.
+         */
+        lpc176x_gpio_interrupt_function function;
+    } lpc176x_registered_interrupt_function;

So all in all is different to what we have, but we have so many styles in the 
BSP area, it doesn't matter.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list