diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c index 514cac1..5f13b84 100644 --- a/apps/plugins/chessclock.c +++ b/apps/plugins/chessclock.c @@ -311,7 +311,10 @@ enum plugin_status plugin_start(const void* parameter) int nr; (void)parameter; - rb->memset(&settings, 0, sizeof(settings)); + + settings.nr_timers = 1; + settings.total_time = 0; + settings.round_time = 0; /* now go ahead and have fun! */ rb->splash(HZ, "Chess Clock"); @@ -478,6 +481,7 @@ static int run_timer(int nr) /* Backlight on if 10 seconds remain */ rb->backlight_on(); } + rb->lcd_puts(0, FIRST_LINE, (unsigned char *)player_info); } last_tick=now; if (round_time) { @@ -536,10 +540,11 @@ static int run_timer(int nr) case 1: /* restart */ ticks=0; + last_tick = *rb->current_tick; break; case 2: /* set round time */ - val=(max_ticks-ticks)/HZ; + val = (max_ticks > ticks)? (max_ticks-ticks)/HZ : 0; res=chessclock_set_int("Round time", &val, 10, 0, MAX_TIME,