diff options
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/apps/wps.c b/apps/wps.c index bf0283015f..784289ada4 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -391,46 +391,29 @@ long wps_show(void) | |||
391 | #ifdef HAVE_LCD_BITMAP | 391 | #ifdef HAVE_LCD_BITMAP |
392 | /* when the peak meter is enabled we want to have a | 392 | /* when the peak meter is enabled we want to have a |
393 | few extra updates to make it look smooth. On the | 393 | few extra updates to make it look smooth. On the |
394 | other hand we don't want to waste energy if it | 394 | other hand we don't want to waste energy if it |
395 | isn't displayed */ | 395 | isn't displayed */ |
396 | if (peak_meter_enabled) { | 396 | if (peak_meter_enabled) { |
397 | int i; | 397 | long next_refresh = current_tick; |
398 | 398 | long next_big_refresh = current_tick + HZ / 5; | |
399 | /* In high performance mode we read out the mas as | 399 | button = BUTTON_NONE; |
400 | often as we can. There is no sleep for cpu */ | 400 | while (TIME_BEFORE(current_tick, next_big_refresh)) { |
401 | if (global_settings.peak_meter_performance) { | 401 | button = button_get(false); |
402 | long next_refresh = current_tick; | 402 | if (button != BUTTON_NONE) { |
403 | long next_big_refresh = current_tick + HZ / 5; | 403 | break; |
404 | button = BUTTON_NONE; | ||
405 | while (!TIME_AFTER(current_tick, next_big_refresh)) { | ||
406 | button = button_get(false); | ||
407 | if (button != BUTTON_NONE) { | ||
408 | break; | ||
409 | } | ||
410 | peak_meter_peek(); | ||
411 | sleep(1); | ||
412 | |||
413 | if (TIME_AFTER(current_tick, next_refresh)) { | ||
414 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); | ||
415 | next_refresh = current_tick + HZ / peak_meter_fps; | ||
416 | } | ||
417 | } | 404 | } |
418 | } | 405 | peak_meter_peek(); |
419 | 406 | sleep(0); /* Sleep until end of current tick. */ | |
420 | /* In energy saver mode the cpu may sleep a | 407 | |
421 | little bit while waiting for buttons */ | 408 | if (TIME_AFTER(current_tick, next_refresh)) { |
422 | else { | ||
423 | for (i = 0; i < 4; i++) { | ||
424 | button = button_get_w_tmo(HZ / peak_meter_fps); | ||
425 | if (button != 0) { | ||
426 | break; | ||
427 | } | ||
428 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); | 409 | wps_refresh(id3, nid3, 0, WPS_REFRESH_PEAK_METER); |
410 | next_refresh += HZ / PEAK_METER_FPS; | ||
429 | } | 411 | } |
430 | } | 412 | } |
431 | } | 413 | |
432 | 414 | } | |
433 | /* The peak meter is disabled | 415 | |
416 | /* The peak meter is disabled | ||
434 | -> no additional screen updates needed */ | 417 | -> no additional screen updates needed */ |
435 | else { | 418 | else { |
436 | button = button_get_w_tmo(HZ/5); | 419 | button = button_get_w_tmo(HZ/5); |