qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 08/13] hw/gpio/nrf51_gpio: Add nRF51 GPIO per


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v3 08/13] hw/gpio/nrf51_gpio: Add nRF51 GPIO peripheral
Date: Fri, 2 Nov 2018 15:02:36 +0000

On 31 October 2018 at 00:25, Steffen Görtz <address@hidden> wrote:
> This adds a model of the nRF51 GPIO peripheral.
>
> Reference Manual: http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.pdf
>
> The nRF51 series microcontrollers support up to 32 GPIO pins in various 
> configurations.
> The pins can be used as input pins with pull-ups or pull-down.
> Furthermore, three different output driver modes per level are
> available (disconnected, standard, high-current).
>
> The GPIO-Peripheral has a mechanism for detecting level changes which is
> not featured in this model.
>
> Signed-off-by: Steffen Görtz <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---

> +
> +static void update_state(NRF51GPIOState *s)
> +{
> +    uint32_t pull;
> +    bool connected_out, dir, connected_in, out, input;
> +
> +    for (size_t i = 0; i < NRF51_GPIO_PINS; i++) {

Hi. This style of declaring the loop variable inside the for()
is not supported by all our compilers, and it's generating
compile warnings (you can see that patchew is mailing you the
logs for these as followups to your cover letter):

/tmp/qemu-test/src/hw/gpio/nrf51_gpio.c:64:5: error: 'for' loop
initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < NRF51_GPIO_PINS; i++) {
     ^


> +static void reflect_dir_bit_in_cnf(NRF51GPIOState *s)
> +{
> +    uint32_t value = s->dir;
> +    for (size_t i = 0; i < NRF51_GPIO_PINS; i++) {

Similarly here, and I think I saw another use somewhere else
in this patchset too.


thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]