This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

switch case statement bouncing

switch(periodplay)
{ default : NVIC_ST_RELOAD_R = 0;Sound_Off();
break;
case 0x01: NVIC_ST_RELOAD_R = beatC0 ; break;
case 0x02: NVIC_ST_RELOAD_R = beatD;
break;
case 0x04 : NVIC_ST_RELOAD_R = beatE ; break;
case 0x08 : NVIC_ST_RELOAD_R = beatG ;
break;
} NVIC_ST_CURRENT_R = 0;
}

Let say "periodplay" have value 0x04. case statement assign "Reload" with beatE, than follow break statement. After break it jumps to the previous case 0x02. And than come out of switch to NVIC_CURRENT_R=0. Any suggestion for troubleshooting?