diff options
| author | Andrew Kannan <andrew.kannan@gmail.com> | 2019-04-27 23:35:31 -0400 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-04-27 20:35:31 -0700 |
| commit | b23c3b0fd61c311b429fb1b3391248bf9df2e25d (patch) | |
| tree | 270025b6cd716797d2aea173c104008a62f9e27d | |
| parent | 53c51f1d16b40fdd3e68a6afc5844917d3d58640 (diff) | |
| download | qmk_firmware-b23c3b0fd61c311b429fb1b3391248bf9df2e25d.tar.gz qmk_firmware-b23c3b0fd61c311b429fb1b3391248bf9df2e25d.zip | |
[Keyboard] Satisfaction75 i2c fix and VIA layout (#5726)
4 files changed, 56 insertions, 17 deletions
diff --git a/keyboards/cannonkeys/satisfaction75/config.h b/keyboards/cannonkeys/satisfaction75/config.h index e3d44990e..092b37257 100644 --- a/keyboards/cannonkeys/satisfaction75/config.h +++ b/keyboards/cannonkeys/satisfaction75/config.h | |||
| @@ -76,7 +76,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 76 | // Bump this every time we change what we store | 76 | // Bump this every time we change what we store |
| 77 | // This will automatically reset the EEPROM with defaults | 77 | // This will automatically reset the EEPROM with defaults |
| 78 | // and avoid loading invalid data from the EEPROM | 78 | // and avoid loading invalid data from the EEPROM |
| 79 | #define EEPROM_VERSION 0x0F | 79 | #define EEPROM_VERSION 0x01 |
| 80 | #define EEPROM_VERSION_ADDR 34 | 80 | #define EEPROM_VERSION_ADDR 34 |
| 81 | 81 | ||
| 82 | // Dynamic keymap starts after EEPROM version | 82 | // Dynamic keymap starts after EEPROM version |
diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c index ce0e0a7ba..56e810d32 100644 --- a/keyboards/cannonkeys/satisfaction75/i2c_master.c +++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c | |||
| @@ -42,8 +42,8 @@ static const I2CConfig i2cconfig = { | |||
| 42 | 0 | 42 | 0 |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | static i2c_status_t chibios_to_qmk(const msg_t* status) { | 45 | static i2c_status_t chibios_to_qmk(const msg_t status) { |
| 46 | switch (*status) { | 46 | switch (status) { |
| 47 | case I2C_NO_ERROR: | 47 | case I2C_NO_ERROR: |
| 48 | return I2C_STATUS_SUCCESS; | 48 | return I2C_STATUS_SUCCESS; |
| 49 | case I2C_TIMEOUT: | 49 | case I2C_TIMEOUT: |
| @@ -83,7 +83,7 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, | |||
| 83 | i2cAcquireBus(&I2C_DRIVER); | 83 | i2cAcquireBus(&I2C_DRIVER); |
| 84 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); | 84 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); |
| 85 | i2cReleaseBus(&I2C_DRIVER); | 85 | i2cReleaseBus(&I2C_DRIVER); |
| 86 | return chibios_to_qmk(&status); | 86 | return chibios_to_qmk(status); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) | 89 | i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) |
| @@ -91,7 +91,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 | |||
| 91 | i2c_address = address; | 91 | i2c_address = address; |
| 92 | i2cStart(&I2C_DRIVER, &i2cconfig); | 92 | i2cStart(&I2C_DRIVER, &i2cconfig); |
| 93 | msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); | 93 | msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); |
| 94 | return chibios_to_qmk(&status); | 94 | return chibios_to_qmk(status); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) | 97 | i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) |
| @@ -107,7 +107,7 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, | |||
| 107 | complete_packet[0] = regaddr; | 107 | complete_packet[0] = regaddr; |
| 108 | 108 | ||
| 109 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); | 109 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); |
| 110 | return chibios_to_qmk(&status); | 110 | return chibios_to_qmk(status); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) | 113 | i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) |
| @@ -115,7 +115,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint1 | |||
| 115 | i2c_address = devaddr; | 115 | i2c_address = devaddr; |
| 116 | i2cStart(&I2C_DRIVER, &i2cconfig); | 116 | i2cStart(&I2C_DRIVER, &i2cconfig); |
| 117 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); | 117 | msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); |
| 118 | return chibios_to_qmk(&status); | 118 | return chibios_to_qmk(status); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | void i2c_stop(void) | 121 | void i2c_stop(void) |
diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c new file mode 100644 index 000000000..733ba8cd6 --- /dev/null +++ b/keyboards/cannonkeys/satisfaction75/keymaps/jae/keymap.c | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012,2013 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include QMK_KEYBOARD_H | ||
| 19 | |||
| 20 | const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 21 | [0] = LAYOUT_all( | ||
| 22 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, | ||
| 23 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS, | ||
| 24 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP, | ||
| 25 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGDN, | ||
| 26 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), | ||
| 27 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 28 | ), | ||
| 29 | [1] = LAYOUT_all( | ||
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, OLED_TOGG, | ||
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, | ||
| 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 36 | ) | ||
| 37 | }; | ||
diff --git a/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c index e76c79a71..296fd7da6 100644 --- a/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c +++ b/keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c | |||
| @@ -17,25 +17,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 17 | 17 | ||
| 18 | #include QMK_KEYBOARD_H | 18 | #include QMK_KEYBOARD_H |
| 19 | 19 | ||
| 20 | |||
| 20 | const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 21 | const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 21 | [0] = LAYOUT_default( | 22 | [0] = LAYOUT_all( |
| 22 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, | 23 | KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, |
| 23 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, ENC_PRESS, | 24 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS, |
| 24 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, | 25 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, |
| 25 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, KC_PGUP, | 26 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGUP, |
| 26 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, | 27 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, |
| 27 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | 28 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT |
| 28 | ), | 29 | ), |
| 29 | [1] = LAYOUT_default( | 30 | [1] = LAYOUT_all( |
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 31 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, | 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, |
| 32 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, | 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, |
| 33 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 34 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
| 35 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | 36 | RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
| 36 | ) | 37 | ) |
| 37 | }; | 38 | }; |
| 38 | 39 | ||
| 40 | |||
| 39 | void matrix_init_user(void) { | 41 | void matrix_init_user(void) { |
| 40 | //user initialization | 42 | //user initialization |
| 41 | } | 43 | } |
