On 31 October 2018 at 00:25, Steffen Görtz <cont...@steffen-goertz.de> 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 <cont...@steffen-goertz.de>
> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
> ---

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