next_update_time = get_time();
info.looped = 0;
while (terminate == 0 && (total_run_times == 0 || info.looped < total_run_times)) {
- char buf[max_user_text];
- get_battery_short_status(buf, max_user_text, "BAT0");
- if(buf[0] == 'D') {
- update_interval = update_interval_bat;
- } else {
- update_interval = update_interval_old;
+ if(update_interval_bat != update_interval_old) {
+ char buf[max_user_text];
+
+ get_battery_short_status(buf, max_user_text, "BAT0");
+ if(buf[0] == 'D') {
+ update_interval = update_interval_bat;
+ } else {
+ update_interval = update_interval_old;
+ }
}
info.looped++;