remove now useless cycles counter

This commit is contained in:
Babz 2021-09-12 21:18:01 +02:00
parent 99c6ebded3
commit a9706a5e1d
3 changed files with 5 additions and 8 deletions

View File

@ -18,7 +18,6 @@
#include "wren_utils.h"
static int tick_ctr = 0;
static int cycle_ctr = 0;
static int shift_state = 0;
static int alpha_state = 0;
static int off_state = 0;
@ -180,7 +179,7 @@ int main(int isappli, int optnum) {
tick_ctr++;
if (must_redraw) {
set_statusbar(tick_ctr, cycle_ctr, shift_state, alpha_state, get_battery_voltage());
set_statusbar(tick_ctr, shift_state, alpha_state, get_battery_voltage());
set_menubar();
dclear(C_BLACK);
@ -203,7 +202,6 @@ int main(int isappli, int optnum) {
if (ret == 0) {
// pause timer during sheduler operations, we restart it before resuming a job
timer_pause(timer_sched);
cycle_ctr++;
// resume job
timer_start(timer_sched);
@ -224,7 +222,7 @@ int main(int isappli, int optnum) {
term_eprint("SCHEDULER EXIT");
set_statusbar(tick_ctr, cycle_ctr, shift_state, alpha_state, get_battery_voltage());
set_statusbar(tick_ctr, shift_state, alpha_state, get_battery_voltage());
set_menubar();
dclear(C_BLACK);

View File

@ -14,7 +14,7 @@ static void date_str(char *buf) {
sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d", t.year, t.month, t.week_day, t.hours, t.minutes, t.seconds);
}
void set_statusbar(int tick_ctr, int cycle_ctr, int shift_state, int alpha_state, int battery) {
void set_statusbar(int tick_ctr, int shift_state, int alpha_state, int battery) {
// set green bar
for (int i = 0; i < UNS_TERM_COLS; i++)
term_writeat(0, i, C_NONE, C_GREEN, " ");
@ -27,8 +27,7 @@ void set_statusbar(int tick_ctr, int cycle_ctr, int shift_state, int alpha_state
// then add actutal text
char statusbar[UNS_TERM_COLS + 1];
sprintf(statusbar, "%s%s t=%dk c=%d bat=%.2fV %s", shift_symbol, alpha_symbol, tick_ctr / 1000, cycle_ctr,
(float)battery / 100, now);
sprintf(statusbar, "%s%s t=%d bat=%.2fV %s", shift_symbol, alpha_symbol, tick_ctr, (float)battery / 100, now);
term_writeat(0, 0, C_BLACK, C_GREEN, statusbar);
}

View File

@ -1,7 +1,7 @@
#ifndef UNS_UI_H
#define UNS_UI_H
void set_statusbar(int tick_ctr, int cycle_ctr, int shift_state, int alpha_state, int battery);
void set_statusbar(int tick_ctr, int shift_state, int alpha_state, int battery);
extern char fnkeys[6][11];
void set_menubar(void);