From 77372fd0c2b527789790b1288b816f34c8d04b14 Mon Sep 17 00:00:00 2001 From: brian crabtree Date: Thu, 5 Jul 2018 22:52:17 +0700 Subject: [PATCH 1/3] hide (harmless) battery errors) --- matron/src/hardware/battery.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/matron/src/hardware/battery.c b/matron/src/hardware/battery.c index b1bd6c044..6c850ff5b 100644 --- a/matron/src/hardware/battery.c +++ b/matron/src/hardware/battery.c @@ -59,7 +59,7 @@ void *battery_check(void *x) { if (read(fd[0], &buf, 4) > 0) { percent = atoi(buf); } else { - fprintf(stderr, "failed to read battery percentage\n"); + //fprintf(stderr, "failed to read battery percentage\n"); percent = -1; } @@ -67,7 +67,7 @@ void *battery_check(void *x) { if (read(fd[1], &buf, 1) > 0) { n = (buf[0] == 'C'); // Charging } else { - fprintf(stderr, "failed to read battery charging status\n"); + //fprintf(stderr, "failed to read battery charging status\n"); n = 0; } @@ -82,7 +82,7 @@ void *battery_check(void *x) { if (read(fd[2], &buf, 7) > 0) { n = atoi(buf) / 1000; } else { - fprintf(stderr, "failed to read battery current\n"); + //fprintf(stderr, "failed to read battery current\n"); n = -1; } From 6c308d7d68fec71419aa3b9874a9a4357bcb0eb6 Mon Sep 17 00:00:00 2001 From: brian crabtree Date: Thu, 5 Jul 2018 23:34:40 +0700 Subject: [PATCH 2/3] save state on sleep --- lua/menu.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/menu.lua b/lua/menu.lua index b84d0c862..2468a89de 100644 --- a/lua/menu.lua +++ b/lua/menu.lua @@ -1344,6 +1344,7 @@ m.key[pSLEEP] = function(n,z) --TODO fade out screen then run the shutdown script m.sleep = true menu.redraw() + norns.state.save() norns.audio.output_level(-100) gain_hp(0) --norns.audio.set_audio_level(0) From c46abc2b68a0dbb85b2b735e673d36d043eaca68 Mon Sep 17 00:00:00 2001 From: brian crabtree Date: Fri, 6 Jul 2018 01:22:17 +0700 Subject: [PATCH 3/3] stop tape --- lua/menu.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/menu.lua b/lua/menu.lua index 2468a89de..add393616 100644 --- a/lua/menu.lua +++ b/lua/menu.lua @@ -1344,7 +1344,8 @@ m.key[pSLEEP] = function(n,z) --TODO fade out screen then run the shutdown script m.sleep = true menu.redraw() - norns.state.save() + norns.state.save() + if tape.mode == tREC then tape_stop_rec() end norns.audio.output_level(-100) gain_hp(0) --norns.audio.set_audio_level(0)