From 10b4cab79362ed5ef3a0655f90d42fd194c16e2d Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 7 Mar 2025 12:57:53 -0500 Subject: [PATCH] battery_bench export_battery_tables add warnings moves shutoff and disk safe to end of file add warning comment out shutoff and disksafe level as further protection Change-Id: I1723b2ae6b2bd7fd359dc7dfcc8f1958d97673fc --- apps/plugins/battery_bench.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 8b4b51b018..caa9f7a4d1 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -539,14 +539,6 @@ void do_export_battery_tables(void) rb->fdprintf(fd, "# Rename to %s\n# " MODEL_NAME " Battery Levels (%s)\n\n", BATTERY_LEVELS_USER, rb->rbversion); - rb->fdprintf(fd, "# Battery voltage(millivolt) lower than this %s\n", - "player will shutdown"); - rb->fdprintf(fd, "shutoff: %d\n\n", *rb->device_battery_tables->shutoff); - - rb->fdprintf(fd, "# Battery voltage(millivolt) lower than this %s\n", - "won't access the disk to write"); - rb->fdprintf(fd, "disksafe: %d\n\n", *rb->device_battery_tables->disksafe); - rb->fdprintf(fd, "# Battery voltage(millivolt) of {"); for(i= 0;i < elems;i++) { @@ -577,10 +569,22 @@ void do_export_battery_tables(void) rb->lseek(fd, -2, SEEK_CUR); /*remove last comma */ rb->fdprintf(fd, "}\n\n"); #endif + + rb->fdprintf(fd, "# WARNING 'shutoff' and 'disksafe' levels protect " \ + "from battery over-discharge and dataloss\n\n"); + + rb->fdprintf(fd, "# Battery voltage(millivolt) lower than this %s\n", + "player will shutdown"); + + rb->fdprintf(fd, "#shutoff: %d\n\n", *rb->device_battery_tables->shutoff); + + rb->fdprintf(fd, "# Battery voltage(millivolt) lower than this %s\n", + "won't access the disk to write"); + rb->fdprintf(fd, "#disksafe: %d\n\n", *rb->device_battery_tables->disksafe); + rb->close(fd); } } - } enum plugin_status plugin_start(const void* parameter)