summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-03-19 22:18:00 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-03-19 22:18:00 +0100
commitbe91ae7ef3f8ac8de6a8cf33c26b1c3aef654813 (patch)
treeea70304108b07a261df296aa776de830c89a467d
parent17e51a53cdb70bc9dc899c95aa5faaef6d17f2d4 (diff)
document private System methods
-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 {