summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-20 15:40:14 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-20 15:40:14 +0100
commit7ecbb11321a05f7498f36ff91d08b51fd3d00a62 (patch)
tree207c8c133929bd4643b68779391a78bdae06452c
parent78ace79b86aeba3575b2abe2ba617798f6d8da85 (diff)
Add StatusLED
-rw-r--r--Makefile1
-rw-r--r--StatusLED.cpp10
-rw-r--r--StatusLED.h28
-rw-r--r--debian/click.service19
-rw-r--r--debian/control1
5 files changed, 59 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1d7a760..91ee0c8 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ SRCS= \
Touchpad.cpp \
PIDFile.cpp \
Temperature.cpp \
+ StatusLED.cpp \
HEADERS=$(SRCS:.cpp=.h)
diff --git a/StatusLED.cpp b/StatusLED.cpp
new file mode 100644
index 0000000..c3544a5
--- /dev/null
+++ b/StatusLED.cpp
@@ -0,0 +1,10 @@
+#include "StatusLED.h"
+
+StatusLED::StatusLED()
+{
+}
+
+void StatusLED::addLED(const LED& led)
+{
+ m_leds.push_back(led);
+}
diff --git a/StatusLED.h b/StatusLED.h
new file mode 100644
index 0000000..39b19f5
--- /dev/null
+++ b/StatusLED.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <vector>
+#include <filesystem>
+
+struct LED
+{
+ std::filesystem::path green;
+ std::filesystem::path red;
+};
+
+class StatusLED
+{
+public:
+ enum class Mode
+ {
+ OK, // green
+ Error // red
+ };
+
+ StatusLED();
+
+ void addLED(const LED& led);
+
+private:
+ std::vector<LED> m_leds; // on best effort base, those will all show the same status
+ Mode m_mode;
+};
diff --git a/debian/click.service b/debian/click.service
new file mode 100644
index 0000000..90617fe
--- /dev/null
+++ b/debian/click.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Click
+After=network.target
+
+[Service]
+Type=simple
+# Restart=always
+ExecStart=click
+
+# Restart once a week, maybe certificates have changed
+Restart=always
+RuntimeMaxSec=604800
+
+# webserver will lower privileges to www-data:www-data
+#User=www-data
+#Group=www-data
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/control b/debian/control
index 32b713a..de141e8 100644
--- a/debian/control
+++ b/debian/control
@@ -22,3 +22,4 @@ Description: Software system for MIDI Click
.
Supported Hardware platforms:
- Raspberry Pi 3 B+
+ - Raspberry Pi 4 B