Skip to content

Commit 02a915c

Browse files
author
Sebastien Bourdeauducq
committedNov 13, 2011
Simple mode: reset timer on manual patch switch
1 parent 2d5c99e commit 02a915c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

Diff for: ‎src/performance.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ static void event_callback(mtk_event *e, int count)
363363

364364
index = -1;
365365
if(simple_mode) {
366+
t = rtems_clock_get_ticks_since_boot();
366367
next = 0;
367368
for(i=0;i<count;i++) {
368369
if(e[i].type == EVENT_TYPE_PRESS) {
@@ -373,11 +374,8 @@ static void event_callback(mtk_event *e, int count)
373374
}
374375
}
375376
if(as_mode) {
376-
t = rtems_clock_get_ticks_since_boot();
377-
if(t >= next_as_time) {
377+
if(t >= next_as_time)
378378
next = 1;
379-
next_as_time = t + AUTOSWITCH_PERIOD;
380-
}
381379
}
382380
if(next) {
383381
current_patch += next;
@@ -386,6 +384,7 @@ static void event_callback(mtk_event *e, int count)
386384
if(current_patch < 0)
387385
current_patch = npatches - 1;
388386
index = current_patch;
387+
next_as_time = t + AUTOSWITCH_PERIOD;
389388
}
390389
if(dt_mode && (index != -1))
391390
osd_event(patches[index].filename);

0 commit comments

Comments
 (0)
Please sign in to comment.