From e5291c73048914a485b3326f53818731a9dcffd0 Mon Sep 17 00:00:00 2001 From: Maxwell Pray Date: Tue, 21 Feb 2023 04:54:10 -0800 Subject: [PATCH 1/3] Include "led_blaster.h" in led_blaster.cpp. --- led_blaster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/led_blaster.cpp b/led_blaster.cpp index 75d9bc6..5b34bf5 100644 --- a/led_blaster.cpp +++ b/led_blaster.cpp @@ -8,6 +8,8 @@ #include +#include "led_blaster.h" + namespace LedBlaster { uint16_t led_on_ms; uint16_t led_off_ms; From 94dec03e0319f81ee5ba8cf9dc302732dcbed5df Mon Sep 17 00:00:00 2001 From: Maxwell Pray Date: Tue, 21 Feb 2023 04:54:36 -0800 Subject: [PATCH 2/3] Include "notebook_adapter.h" in notebook_adapter.cpp. --- notebook_adapter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notebook_adapter.cpp b/notebook_adapter.cpp index 47696ac..d593958 100644 --- a/notebook_adapter.cpp +++ b/notebook_adapter.cpp @@ -6,7 +6,9 @@ #define DATA_MODE_TIMEOUT_MS 1000 #include + #include "led_blaster.h" +#include "notebook_adapter.h" namespace NotebookAdapter { unsigned long last_data_ms = 0; From 7bd69af66ec4b40607eb50097a1327bd94362fa4 Mon Sep 17 00:00:00 2001 From: Maxwell Pray Date: Tue, 21 Feb 2023 04:54:54 -0800 Subject: [PATCH 3/3] Move LedBlaster::setup to be the top-most function. --- led_blaster.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/led_blaster.cpp b/led_blaster.cpp index 5b34bf5..cd78ee8 100644 --- a/led_blaster.cpp +++ b/led_blaster.cpp @@ -14,6 +14,11 @@ namespace LedBlaster { uint16_t led_on_ms; uint16_t led_off_ms; + void setup() { + pinMode(LED_PIN, OUTPUT); + enable_fast_mode(false); + } + void enable_fast_mode(bool fast_mode_enabled) { if (fast_mode_enabled) { led_on_ms = LED_ON_MS_FAST; @@ -24,11 +29,6 @@ namespace LedBlaster { } } - void setup() { - pinMode(LED_PIN, OUTPUT); - enable_fast_mode(false); - } - void emit_0() { digitalWrite(LED_PIN, HIGH); delayMicroseconds(led_on_ms);