[NEW BSP] Mbed lpc1768 board

Marcos Díaz marcos.diaz at tallertechnologies.com
Fri Jun 6 14:47:09 UTC 2014


If you prefer we could make it more suitable to RTEMS coding style.
Which examples can we get of it?
Thanks!

On Fri, Jun 6, 2014 at 11:31 AM, Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
> 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.



-- 
______________________________


Marcos Díaz

Software Engineer


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina


Phone: +54 351 4217888 / +54 351 4218211/ +54 351 7617452

Skype: markdiaz22




More information about the devel mailing list