33
44int t1_count = 0 ;
55int t2_count = 0 ;
6- int timer2_id ;
6+ int t2_id ;
77
88// timer event callback (called once)
99__attribute__((export_name ("on_timer1" )))
@@ -24,7 +24,7 @@ void on_timer2(int event_id) {
2424 printf ("timer callback 2 entered (event id=%d, count=%d)\n" , event_id , t2_count );
2525
2626 if (t2_count == 5 ) {
27- twr_timer_cancel (timer2_id );
27+ twr_timer_cancel (t2_id );
2828 if (t1_count != 0 )
2929 printf ("twr_timer_single_shot FAIL!!\n" );
3030 }
@@ -34,10 +34,10 @@ int tests_timer(int is_async) {
3434
3535 printf ("starting timer tests.\n" );
3636
37- int timer2 = twr_register_callback ("on_timer2" );
38- timer2_id = twr_timer_repeat (500 , timer2 );
37+ int t2_eventid = twr_register_callback ("on_timer2" );
38+ t2_id = twr_timer_repeat (500 , t2_eventid );
3939
40- int timer1 = twr_register_callback ("on_timer1" );
40+ int t1_eventid = twr_register_callback ("on_timer1" );
4141
4242 if (is_async ) {
4343 printf ("going to sleep...\n" );
@@ -48,11 +48,11 @@ int tests_timer(int is_async) {
4848 printf ("FAIL!! t2_count is %d\n" , t2_count );
4949 }
5050
51- twr_timer_single_shot (2000 , timer1 );
51+ twr_timer_single_shot (2000 , t1_eventid );
5252 }
5353
5454 else {
55- twr_timer_single_shot (4000 , timer1 );
55+ twr_timer_single_shot (4000 , t1_eventid );
5656 }
5757
5858 return 0 ;
0 commit comments