Browse Source

fix the bug ( error: array subscript is above array bounds [-Werror=array-bounds] )

sbg
stmoon 9 years ago committed by Lorenz Meier
parent
commit
fb131f43c3
  1. 2
      src/drivers/stm32/drv_io_timer.c

2
src/drivers/stm32/drv_io_timer.c

@ -645,7 +645,7 @@ int io_timer_set_enable(bool state, io_timer_channel_mode_t mode, io_timer_chann
irqstate_t flags = irqsave(); irqstate_t flags = irqsave();
for (int actions = 0; action_cache[actions].base != 0 && actions < arraySize(action_cache); actions++) { for (int actions = 0; actions < arraySize(action_cache) && action_cache[actions].base != 0 ; actions++) {
uint32_t rvalue = _REG32(action_cache[actions].base, STM32_GTIM_CCER_OFFSET); uint32_t rvalue = _REG32(action_cache[actions].base, STM32_GTIM_CCER_OFFSET);
rvalue &= ~action_cache[actions].ccer_clearbits; rvalue &= ~action_cache[actions].ccer_clearbits;
rvalue |= action_cache[actions].ccer_setbits; rvalue |= action_cache[actions].ccer_setbits;

Loading…
Cancel
Save