simplify the 'setup' API for the hardware

pull/18/head
Jesse Vincent 9 years ago
parent 637bb7652a
commit 7cd1286810

@ -18,8 +18,7 @@ void setup() {
Keyboard.begin(); Keyboard.begin();
Mouse.begin(); Mouse.begin();
AbsoluteMouse.begin(); AbsoluteMouse.begin();
KeyboardHardware.leds_setup(); KeyboardHardware.setup();
KeyboardHardware.pins_setup();
LEDControl.boot_animation(); LEDControl.boot_animation();
temporary_keymap = primary_keymap = Storage.load_primary_keymap(KEYMAPS); temporary_keymap = primary_keymap = Storage.load_primary_keymap(KEYMAPS);

@ -13,6 +13,10 @@ Model01Beta_::Model01Beta_(void) {
} }
void Model01Beta_::setup(void) {
pins_setup();
leds_setup();
}
void Model01Beta_::leds_setup() { void Model01Beta_::leds_setup() {
LED.setOutput(LED_DATA_PIN); LED.setOutput(LED_DATA_PIN);
LED.setColorOrderGRB(); // Uncomment for RGB color order LED.setColorOrderGRB(); // Uncomment for RGB color order

@ -38,9 +38,7 @@ class Model01Beta_ {
cRGB get_key_color(byte row, byte col); cRGB get_key_color(byte row, byte col);
void scan_matrix(void); void scan_matrix(void);
void setup();
void pins_setup();
void leds_setup();
private: private:
@ -51,6 +49,8 @@ class Model01Beta_ {
int left_initted = 0; int left_initted = 0;
boolean right_hand_connected(void); boolean right_hand_connected(void);
void pins_setup();
void leds_setup();
void scan_row(byte row); void scan_row(byte row);
void finish_scanning_row(byte row); void finish_scanning_row(byte row);
void scan_right_col(byte row, byte col, uint8_t *state); void scan_right_col(byte row, byte col, uint8_t *state);

Loading…
Cancel
Save