File tree Expand file tree Collapse file tree
ports/esp32s2/peripherals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,23 +46,26 @@ void peripherals_timer_reset(void) {
4646}
4747
4848void peripherals_timer_init (const timer_config_t * config , timer_index_t * timer ) {
49+ bool break_loop = false;
50+
4951 // get free timer
5052 for (uint8_t i = 0 ; i < 2 ; i ++ ) {
5153 for (uint8_t j = 0 ; j < 2 ; j ++ ) {
5254 if (timer_state [i ][j ] == TIMER_FREE ) {
5355 timer -> idx = (timer_idx_t )j ;
5456 timer -> group = (timer_group_t )i ;
5557 timer_state [i ][j ] = TIMER_BUSY ;
56- goto init_timer ;
58+ break_loop = true;
59+ break ;
5760 } else if (i == 1 && j == 1 ) {
5861 timer -> idx = TIMER_MAX ;
5962 timer -> group = TIMER_GROUP_MAX ;
6063 return ;
6164 }
6265 }
66+ if (break_loop ) {break ;}
6367 }
6468
65- init_timer :
6669 // initialize timer module
6770 timer_init (timer -> group , timer -> idx , config );
6871 timer_set_counter_value (timer -> group , timer -> idx , 0 );
You can’t perform that action at this time.
0 commit comments