Skip to content

Commit

Permalink
Simple mode: reset timer on manual patch switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Nov 13, 2011
1 parent 2d5c99e commit 02a915c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/performance.c
Expand Up @@ -363,6 +363,7 @@ static void event_callback(mtk_event *e, int count)

index = -1;
if(simple_mode) {
t = rtems_clock_get_ticks_since_boot();
next = 0;
for(i=0;i<count;i++) {
if(e[i].type == EVENT_TYPE_PRESS) {
Expand All @@ -373,11 +374,8 @@ static void event_callback(mtk_event *e, int count)
}
}
if(as_mode) {
t = rtems_clock_get_ticks_since_boot();
if(t >= next_as_time) {
if(t >= next_as_time)
next = 1;
next_as_time = t + AUTOSWITCH_PERIOD;
}
}
if(next) {
current_patch += next;
Expand All @@ -386,6 +384,7 @@ static void event_callback(mtk_event *e, int count)
if(current_patch < 0)
current_patch = npatches - 1;
index = current_patch;
next_as_time = t + AUTOSWITCH_PERIOD;
}
if(dt_mode && (index != -1))
osd_event(patches[index].filename);
Expand Down

0 comments on commit 02a915c

Please sign in to comment.