Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I have a finite state machine coded barely like this:
while(1){ switch(core_state) { case IDLE: //bla, bla, bla break; case RUN: //bla, bla, bla break; } }It takes about 400ns to go through the SWITCH statement and branch into a certain state. I don't have the assembly code to compare with. Is it possible that IF-ELSE statement is faster than SWITCH?I'd like to speed it up 2 times at least. How shall I do it?
Thanks.