diff options
| author | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-05-30 13:14:59 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-30 13:14:59 -0700 |
| commit | fced377ac007d27f2650ccffbe0b18abcdcfe23d (patch) | |
| tree | bd5b141987394a5a16cfc416bfe2b9efdb14d067 /keyboards/zinc/rev1/split_util.c | |
| parent | 7b8a013826ad90714a05ea522de53adf964ab3b9 (diff) | |
| download | qmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.tar.gz qmk_firmware-fced377ac007d27f2650ccffbe0b18abcdcfe23d.zip | |
2020 May 30 Breaking Changes Update (#9215)
* Branch point for 2020 May 30 Breaking Change
* Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954)
* Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957)
* Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958)
* Migrate `ACTION_LAYER_MODS` to `LM()` (#8959)
* Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968)
* Convert V-USB usbdrv to a submodule (#8321)
* Unify Tap Hold functions and documentation (#8348)
* Changing board names to prevent confusion (#8412)
* Move the Keyboardio Model01 to a keyboardio/ subdir (#8499)
* Move spaceman keyboards (#8830)
* Migrate miscellaneous `fn_actions` entries (#8977)
* Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979)
* Organizing my keyboards (plaid, tartan, ergoinu) (#8537)
* Refactor Lily58 to use split_common (#6260)
* Refactor zinc to use split_common (#7114)
* Add a message if bin/qmk doesn't work (#9000)
* Fix conflicting types for 'tfp_printf' (#8269)
* Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480)
* Refactor and updates to TKC1800 code (#8472)
* Switch to qmk forks for everything (#9019)
* audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484)
* Audio enable corrections (2/3) (#8903)
* Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582)
* Audio enable corrections (Part 4) (#8974)
* Fix typo from PR7114 (#9171)
* Augment future branch Changelogs (#8978)
* Revert "Branch point for 2020 May 30 Breaking Change"
Diffstat (limited to 'keyboards/zinc/rev1/split_util.c')
| -rw-r--r-- | keyboards/zinc/rev1/split_util.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/keyboards/zinc/rev1/split_util.c b/keyboards/zinc/rev1/split_util.c deleted file mode 100644 index e1ff8b437..000000000 --- a/keyboards/zinc/rev1/split_util.c +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | #include <avr/io.h> | ||
| 2 | #include <avr/wdt.h> | ||
| 3 | #include <avr/power.h> | ||
| 4 | #include <avr/interrupt.h> | ||
| 5 | #include <util/delay.h> | ||
| 6 | #include <avr/eeprom.h> | ||
| 7 | #include "split_util.h" | ||
| 8 | #include "matrix.h" | ||
| 9 | #include "keyboard.h" | ||
| 10 | |||
| 11 | #ifdef USE_MATRIX_I2C | ||
| 12 | # include "i2c.h" | ||
| 13 | #else | ||
| 14 | # include "split_scomm.h" | ||
| 15 | #endif | ||
| 16 | |||
| 17 | volatile bool isLeftHand = true; | ||
| 18 | |||
| 19 | static void setup_handedness(void) { | ||
| 20 | #ifdef EE_HANDS | ||
| 21 | isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); | ||
| 22 | #else | ||
| 23 | // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c | ||
| 24 | #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) | ||
| 25 | isLeftHand = !has_usb(); | ||
| 26 | #else | ||
| 27 | isLeftHand = has_usb(); | ||
| 28 | #endif | ||
| 29 | #endif | ||
| 30 | } | ||
| 31 | |||
| 32 | static void keyboard_master_setup(void) { | ||
| 33 | |||
| 34 | #ifdef USE_MATRIX_I2C | ||
| 35 | i2c_master_init(); | ||
| 36 | #else | ||
| 37 | serial_master_init(); | ||
| 38 | #endif | ||
| 39 | } | ||
| 40 | |||
| 41 | static void keyboard_slave_setup(void) { | ||
| 42 | |||
| 43 | #ifdef USE_MATRIX_I2C | ||
| 44 | i2c_slave_init(SLAVE_I2C_ADDRESS); | ||
| 45 | #else | ||
| 46 | serial_slave_init(); | ||
| 47 | #endif | ||
| 48 | } | ||
| 49 | |||
| 50 | bool has_usb(void) { | ||
| 51 | USBCON |= (1 << OTGPADE); //enables VBUS pad | ||
| 52 | _delay_us(5); | ||
| 53 | return (USBSTA & (1<<VBUS)); //checks state of VBUS | ||
| 54 | } | ||
| 55 | |||
| 56 | void split_keyboard_setup(void) { | ||
| 57 | setup_handedness(); | ||
| 58 | |||
| 59 | if (has_usb()) { | ||
| 60 | keyboard_master_setup(); | ||
| 61 | } else { | ||
| 62 | keyboard_slave_setup(); | ||
| 63 | } | ||
| 64 | sei(); | ||
| 65 | } | ||
| 66 | |||
| 67 | // this code runs before the usb and keyboard is initialized | ||
| 68 | void matrix_setup(void) { | ||
| 69 | split_keyboard_setup(); | ||
| 70 | } | ||
