summaryrefslogtreecommitdiff
path: root/apps/plugins/battery_bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/battery_bench.c')
-rw-r--r--apps/plugins/battery_bench.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 302d74c02a..bf40fe1759 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -414,7 +414,9 @@ static void thread(void)
414 bat[buf_idx].flags = charge_state(); 414 bat[buf_idx].flags = charge_state();
415#endif 415#endif
416 buf_idx++; 416 buf_idx++;
417#if USING_STORAGE_CALLBACK
417 rb->register_storage_idle_func(flush_buffer); 418 rb->register_storage_idle_func(flush_buffer);
419#endif
418 } 420 }
419 421
420 /* What to do when the measurement buffer is full: 422 /* What to do when the measurement buffer is full:
@@ -454,8 +456,12 @@ static void thread(void)
454 } 456 }
455 } 457 }
456 458
459#if USING_STORAGE_CALLBACK
457 /* unregister flush callback and flush to disk */ 460 /* unregister flush callback and flush to disk */
458 rb->unregister_storage_idle_func(flush_buffer, true); 461 rb->unregister_storage_idle_func(flush_buffer, true);
462#else
463 flush_buffer(NULL);
464#endif
459 465
460 /* log end of bench and exit reason */ 466 /* log end of bench and exit reason */
461 fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666); 467 fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666);