Skip to content

Commit

Permalink
Refactor and updates to TKC1800 code (#8472)
Browse files Browse the repository at this point in the history
* TKC1800: updated to support QMK-DFU bootloader

* TKC1800: updated to support QMK-DFU bootloader

* TKC1800: Updated to utilize common I2C and OLED code

* Refactor OLED code in VIA keymap

* Fix for screen disconnected error.

* Added changelog for breaking change process
  • Loading branch information
TerryMathews authored and noroadsleft committed May 15, 2020
1 parent a823d80 commit 70ac431
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 683 deletions.
42 changes: 42 additions & 0 deletions docs/ChangeLog/20200530/PR8472.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Refactor of TKC1800 to use common OLED code

[#8472](https://github.com/qmk/qmk_firmware/pull/8472) Modifies the default firmware for TKC1800 to use the in-built I2C and OLED drivers, instead of including and depending on its own set of libraries for the following functionality:
- SSD1306 display
- i2c for OLED

This allows current TKC1800 firmware to advance with updates to those drivers, which are shared with other keyboards.

## To migrate existing TKC1800 firmware:

[Changes to `config.h`](https://github.com/qmk/qmk_firmware/pull/8472/files#diff-d10b26e676b4a55cbb00d71955116526):
- Remove `#define SSD1306OLED` from config.h

[Changes to `tkc1800.c`](https://github.com/qmk/qmk_firmware/pull/8472/files#diff-3b35bd30abe89c8110717c6972cd2cc5):
- Add the following to avoid debug errors on HID_listen if the screen is not present
```c
void keyboard_pre_init_kb(void) {
setPinInputHigh(D0);
setPinInputHigh(D1);

keyboard_pre_init_user();
}
```
[Changes to `keymap.c`](https://github.com/qmk/qmk_firmware/pull/8472/files#diff-05a2a344ce27e4d045fe68520ccd4771):
- Find/Replace each instance of `#ifdef SSD1306OLED` with `#ifdef OLED_DRIVER_ENABLE`
- The following changes are for compatibility with the OLED driver. If you don't use the OLED driver you may safely delete [this section](https://github.com/qmk/qmk_firmware/blob/e6b9980bd45c186f7360df68c24b6e05a80c10dc/keyboards/lily58/keymaps/default/keymap.c#L144-L190)
- [Remove](https://github.com/qmk/qmk_firmware/pull/6260/files#diff-20943ea59856e9bdf3d99ecb2eee40b7L91-L158) the block
```c
#ifdef SSD1306OLED
iota_gfx_init(!has_usb()); // turns on the display
#endif
```
- Within the block bounded by `#ifdef OLED_DRIVER_ENABLE` and `#endif // OLED_DRIVER_ENABLE`, add the following block to ensure that your two OLEDs are rotated correctly across the left and right sides:
```c
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master())
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
return rotation;
}
```
- Remove the function `iota_gfx_task_user`
5 changes: 5 additions & 0 deletions keyboards/tkc1800/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

#define QMK_ESC_OUTPUT A0 // usually COL
#define QMK_ESC_INPUT F4 // usually ROW
#define QMK_LED D2 // NumLock on TKC1800
//#define QMK_SPEAKER C6

/*
* Force NKRO
*
Expand Down
166 changes: 0 additions & 166 deletions keyboards/tkc1800/i2c.c

This file was deleted.

49 changes: 0 additions & 49 deletions keyboards/tkc1800/i2c.h

This file was deleted.

24 changes: 0 additions & 24 deletions keyboards/tkc1800/keymaps/default/config.h

This file was deleted.

Loading

0 comments on commit 70ac431

Please sign in to comment.