Are there any ways to improve this ISR - STM32F401RE?
the return statements are not needed
for clearity it's better to use some arrays to minimize the code


The read channel value part can be written as:

  //read channel value
  else if(elapsedTime &gt;= 1000 &amp;&amp; elapsedTime &lt;= 2000)
  {
       if((currentChannel &gt;= 1) &amp;&amp; (currentChannel &lt;= 6)) 
       {
             channelVal[currentChannel - 1] = elapsedTime;
             currentChannel = (currentChannel + 1) % 7;
       }
  }