File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
ports/esp32s2/peripherals Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -46,23 +46,26 @@ void peripherals_timer_reset(void) {
46
46
}
47
47
48
48
void peripherals_timer_init (const timer_config_t * config , timer_index_t * timer ) {
49
+ bool break_loop = false;
50
+
49
51
// get free timer
50
52
for (uint8_t i = 0 ; i < 2 ; i ++ ) {
51
53
for (uint8_t j = 0 ; j < 2 ; j ++ ) {
52
54
if (timer_state [i ][j ] == TIMER_FREE ) {
53
55
timer -> idx = (timer_idx_t )j ;
54
56
timer -> group = (timer_group_t )i ;
55
57
timer_state [i ][j ] = TIMER_BUSY ;
56
- goto init_timer ;
58
+ break_loop = true;
59
+ break ;
57
60
} else if (i == 1 && j == 1 ) {
58
61
timer -> idx = TIMER_MAX ;
59
62
timer -> group = TIMER_GROUP_MAX ;
60
63
return ;
61
64
}
62
65
}
66
+ if (break_loop ) {break ;}
63
67
}
64
68
65
- init_timer :
66
69
// initialize timer module
67
70
timer_init (timer -> group , timer -> idx , config );
68
71
timer_set_counter_value (timer -> group , timer -> idx , 0 );
You can’t perform that action at this time.
0 commit comments