Hi David,

On Mon, May 23, 2016, David G. Simmons wrote:
> I then changed int g_led_pin to int g_led_pins[8];
> 
> but initializing them all via
> 
> int x = 0;
> while(x++ < 8){
>       hal_gpio_init_out(g_led_pins[x], 1);
> }

That will call hal_gpio_init_out() with values of x from 1 to 8, and
it's probably the last one (which is out of bounds) that causes an
error.

> Interestingly, when I just now changed it to:
> 
> int x;
> for(x = 0; x < 8; x++){
>         hal_gpio_init_out(g_led_pins[x], 1);
> }

The above is a different range: 0 to 7.

Johan

Reply via email to