Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Simple mode: reset timer on manual patch switch

  • Loading branch information...
commit 02a915c71a2fbae3e1811f6af371ba6f3c5c1871 1 parent 2d5c99e
Sébastien Bourdeauducq authored November 13, 2011

Showing 1 changed file with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. 7  src/performance.c
7  src/performance.c
@@ -363,6 +363,7 @@ static void event_callback(mtk_event *e, int count)
363 363
 
364 364
 	index = -1;
365 365
 	if(simple_mode) {
  366
+		t = rtems_clock_get_ticks_since_boot();
366 367
 		next = 0;
367 368
 		for(i=0;i<count;i++) {
368 369
 			if(e[i].type == EVENT_TYPE_PRESS) {
@@ -373,11 +374,8 @@ static void event_callback(mtk_event *e, int count)
373 374
 			}
374 375
 		}
375 376
 		if(as_mode) {
376  
-			t = rtems_clock_get_ticks_since_boot();
377  
-			if(t >= next_as_time) {
  377
+			if(t >= next_as_time)
378 378
 				next = 1;
379  
-				next_as_time = t + AUTOSWITCH_PERIOD;
380  
-			}
381 379
 		}
382 380
 		if(next) {
383 381
 			current_patch += next;
@@ -386,6 +384,7 @@ static void event_callback(mtk_event *e, int count)
386 384
 			if(current_patch < 0)
387 385
 				current_patch = npatches - 1;
388 386
 			index = current_patch;
  387
+			next_as_time = t + AUTOSWITCH_PERIOD;
389 388
 		}
390 389
 		if(dt_mode && (index != -1))
391 390
 			osd_event(patches[index].filename);

0 notes on commit 02a915c

Please sign in to comment.
Something went wrong with that request. Please try again.