summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/system.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
index dcff642..eb5d9dd 100644
--- a/src/system.h
+++ b/src/system.h
@@ -18,13 +18,67 @@
*/
class System {
private:
+ /**
+ * Shutdown threshold counter. Contains the time since both
+ * buttons were first pressed at the same time in 256µs steps.
+ */
uint16_t want_shutdown;
+
+ /**
+ * Debounce counter for button presses. Buttons are ignored while
+ * this value is greater than zero
+ */
uint8_t btn_debounce;
+
+ /**
+ * Index of the currently active animation
+ */
uint8_t current_anim_no;
+
+ /**
+ * Shuts down the entire system. Shows a shutdown animation, waits
+ * untel both buttons are released, turns off all hardware and puts
+ * the system to sleep. Re-enables the hardware and shows the
+ * last active animation after a wakeup
+ */
void shutdown(void);
+
+ /**
+ * Modem receive function. Maintains the internal state machine
+ * (see RxExpect)
+ */
void receive(void);
+
+ /**
+ * Loads a pattern from the EEPROM and shows it on the display.
+ * Loads the first 132 bytes (4 bytes header + 128 bytes data) of
+ * the pattern into the global disp_buf variable, updates the
+ * global active_anim to reflect the read metadata and calls
+ * Display::show() to display the pattern.
+ *
+ * @param pattern_no index of pattern to show
+ */
void loadPattern(uint8_t pattern_no);
+
+ /**
+ * Show the pattern stored in pattern on the display.
+ * Updates the global active_anim object with the metadata
+ * stored in the first four bytes of pattern and cals
+ * Display::show() to display it
+ *
+ * @param pattern array containing the pattern
+ */
void loadPattern_buf(uint8_t *pattern);
+
+ /**
+ * Load pattern from PROGMEM. Loads the entire pattern stored
+ * at pattern_ptr into the global disp_buf variable, updates
+ * the global active_anim object with the metadata stored in the
+ * first four pattern bytes and calls Display::show() to display
+ * the pattern. The pattern data must not be longer than 128 bytes.
+ *
+ * @param pattern_ptr pointer to pattern data in PROGMEM
+ */
void loadPattern_P(const uint8_t *pattern_ptr);
enum TransmissionControl : uint8_t {