From f1abb7cf73267fa980ca6490f26819e59fa48bfe Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Thu, 23 Feb 2023 12:14:30 -0500 Subject: [PATCH 1/5] Testing Arduino disconnect patch This changes the way the program detects whether the Arduino has rebooted spontaneously. It sends out a test 'packet' to the Arduino every second. When operating normally, the Arduino will ignore this packet. But, if the Arduino has rebooted, the Arduino will send back an 'invalid mode packet'. The program tries to detect this and automatically attempts to restore the previous operation mode. --- arduino_connect | 2 +- .../diyemg_sketch_1.2-a.1.ino | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) rename diyemg_sketch_1.1-a.1/diyemg_sketch_1.1-a.1.ino => diyemg_sketch_1.2-a.1/diyemg_sketch_1.2-a.1.ino (93%) diff --git a/arduino_connect b/arduino_connect index 2b16aa2..7f545f2 160000 --- a/arduino_connect +++ b/arduino_connect @@ -1 +1 @@ -Subproject commit 2b16aa2da5d23be1b3e907caa2352aaf96c77dbe +Subproject commit 7f545f2de359abccc3252314fb5ed3648da547a9 diff --git a/diyemg_sketch_1.1-a.1/diyemg_sketch_1.1-a.1.ino b/diyemg_sketch_1.2-a.1/diyemg_sketch_1.2-a.1.ino similarity index 93% rename from diyemg_sketch_1.1-a.1/diyemg_sketch_1.1-a.1.ino rename to diyemg_sketch_1.2-a.1/diyemg_sketch_1.2-a.1.ino index a0963a2..d44df78 100644 --- a/diyemg_sketch_1.1-a.1/diyemg_sketch_1.1-a.1.ino +++ b/diyemg_sketch_1.2-a.1/diyemg_sketch_1.2-a.1.ino @@ -1,4 +1,4 @@ -/* DIY Spiker unit controller - v1.0 +/* DIY Spiker unit controller - v1.2 Written by Kevin Williams 10/26/2020: - Complete rewrite to match new hardware specifications @@ -72,11 +72,20 @@ inline void __attribute__((optimize("O3"))) update_output(const int level) { return; } +ISR(TIMER1_OVF_vect) { + digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); +} void setup(void) { Serial.begin(115200); String mode; char buff[10]; + + // standby signal + TCCR1A = 0; + TCCR1B = 0x3; + TCNT1 = 0; + TIMSK1 = _BV(TOIE1); // enable TIMER2 overflow interrupt // indicator pinMode(LED_BUILTIN, OUTPUT); @@ -146,6 +155,10 @@ void setup(void) { // 0 = A0, 1 = A1 ADMUX = (1 << REFS0) | channel_select; ADCSRA = 0x82; + + // disable status led + TIMSK1 = 0; + digitalWrite(LED_BUILTIN, 0); } From e19558169754c3c9d9ff3351c5feb28e21b9fd68 Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Thu, 23 Feb 2023 14:04:04 -0500 Subject: [PATCH 2/5] Updated fix to include graphing mode --- .gitignore | 3 ++- arduino_connect | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 472ce4e..f503195 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -package_builds/ +package_builds +*.log diff --git a/arduino_connect b/arduino_connect index 7f545f2..3e47d96 160000 --- a/arduino_connect +++ b/arduino_connect @@ -1 +1 @@ -Subproject commit 7f545f2de359abccc3252314fb5ed3648da547a9 +Subproject commit 3e47d96436da67559ffd4b3660eb0003dab31e36 From 5ffeb955568bdff82b4437bc55552d7f19f69829 Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Mon, 27 Feb 2023 11:02:04 -0500 Subject: [PATCH 3/5] Documentation update --- arduino_connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino_connect b/arduino_connect index 3e47d96..d2179a9 160000 --- a/arduino_connect +++ b/arduino_connect @@ -1 +1 @@ -Subproject commit 3e47d96436da67559ffd4b3660eb0003dab31e36 +Subproject commit d2179a91330850b7b8becd05cd4f1d141d64775c From f4ae82e5676a961777889d75239801e18781822c Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Tue, 28 Feb 2023 15:22:21 -0500 Subject: [PATCH 4/5] Update to submodules --- arduino_connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino_connect b/arduino_connect index d2179a9..bb9ab18 160000 --- a/arduino_connect +++ b/arduino_connect @@ -1 +1 @@ -Subproject commit d2179a91330850b7b8becd05cd4f1d141d64775c +Subproject commit bb9ab18730374041eb8970348367ed7425ffc7b0 From 56af4969ed3724dfd7b8fa1a91b913c0ed00111b Mon Sep 17 00:00:00 2001 From: Kevin Williams Date: Wed, 1 Mar 2023 13:21:26 -0500 Subject: [PATCH 5/5] Update arduino_connect --- arduino_connect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino_connect b/arduino_connect index bb9ab18..ee043aa 160000 --- a/arduino_connect +++ b/arduino_connect @@ -1 +1 @@ -Subproject commit bb9ab18730374041eb8970348367ed7425ffc7b0 +Subproject commit ee043aaa26ccfa81a41b28d1cc8c1cfa3e13bf1a