// // FILE: [_controller.ino] // Created by GUIslice Builder version: [0.15.b004] // // GUIslice Builder Generated File // // For the latest guides, updates and support view: // https://github.com/ImpulseAdventure/GUIslice // // // ------------------------------------------------ // Headers to include // ------------------------------------------------ // // Varous system includes #include // Various library includes #include #include #include #include #include // Various local includes #include "_controller_GSLC.h" // // ------------------------------------------------ // Program Globals // ------------------------------------------------ // Battery level measurement #define VBATPIN A6 float measuredVBat; int batteryPercent; // TFT Setup #define TFT_CS 9 #define TFT_DC 10 Adafruit_ILI9341 tft(TFT_CS, TFT_DC); #include #define CHARS_HORIZONTAL 29 #define CHARS_ROWS 11 #define CHARS_TOTAL CHARS_HORIZONTAL * CHARS_ROWS CircularBuffer textBuffer; // Keyboard BBQ10Keyboard keyboard; #define KBD_BTN_1 0x06 #define KBD_BTN_2 0x11 #define KBD_BTN_3 0x07 #define KBD_BTN_4 0x12 #define KBD_SW_UP 0x01 #define KBD_SW_DN 0x02 #define KBD_SW_LF 0x03 #define KBD_SW_RT 0x04 #define KBD_SW_OK 0x05 // Upstream keyboard definitions that will be really important later #define _REG_CFG 2 #define CFG_OVERFLOW_INT (1 << 1) #define CFG_KEY_INT (1 << 4) #define CFG_USE_MODS (1 << 7) // Should Alt, Sym and Shifts modify the keys reported #define CFG_REPORT_MODS (1 << 6) // Should Alt, Sym and Shifts be reported as well // NeoPixels #define PIXELS_NUM_BOARD 1 #define PIXELS_NUM_WING 1 #define PIXELS_WING_PIN 11 Adafruit_NeoPixel pixels_board(PIXELS_NUM_BOARD, PIN_NEOPIXEL, NEO_GRB + NEO_KHZ800); Adafruit_NeoPixel pixels_wing(PIXELS_NUM_WING, PIXELS_WING_PIN, NEO_GRB + NEO_KHZ800); // GUI state globals bool textChanged = false; // Various loop handlers void handlerKeyboard(); void handlerBatteryLevel(); void processRingBuffer(); // Save some element references for direct access // gslc_tsElemRef* m_pElemBatteryLevel= NULL; gslc_tsElemRef* m_pElemRd1152 = NULL; gslc_tsElemRef* m_pElemRd96 = NULL; gslc_tsElemRef* m_pElemRdUART0 = NULL; gslc_tsElemRef* m_pElemRdUART5 = NULL; gslc_tsElemRef* m_pElemStatusText = NULL; gslc_tsElemRef* m_pElemText = NULL; // // Define debug message function static int16_t DebugOut(char ch) { if (ch == (char)'\n') Serial.println(""); else Serial.write(ch); return 0; } // ------------------------------------------------ // Callback Methods // ------------------------------------------------ //