Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Lily58 to use split_common #6260

Merged
merged 29 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
073b9ef
Refactor core keyboard files to use split_common
yyc Jul 5, 2019
0808bfa
Refactor OLED libs for compatibility with split_common
yyc Jul 5, 2019
43207e9
Override default glcd font to get lily58 logo
yyc Jul 5, 2019
3d6ae58
Switch to OLED library, clean up references to SSD1306OLED, and updat…
yyc Jul 5, 2019
651463b
Remove duplicated #define tapping_term
yyc Jul 5, 2019
279b482
Add in logo_reader that was accidentally deleted
yyc Jul 5, 2019
4c154e2
fix yuchi keymap as well to get CI passing
yyc Jul 5, 2019
ee19c87
remove serial_config
yyc Jul 6, 2019
8627e43
Merge branch 'master' into lily58_refactor
drashna Aug 8, 2019
761afad
keyboards/lily58/lib/layer_state_reader.c
yyc Sep 22, 2019
a037c2e
incorporate layer changes
yyc Sep 22, 2019
4243763
add my own lily58 keymap
yyc Sep 22, 2019
20abc71
Merge branch 'lily58_refactor' of github.com:yyc/qmk_firmware into li…
yyc Sep 22, 2019
5c8404a
incorporate suggestions and fix CI warnings
yyc Sep 22, 2019
a75158d
Merge branch 'master' of github.com:qmk/qmk_firmware into lily58_refa…
yyc Sep 22, 2019
a815bbb
Remove reference to SSD1306OLED in @ninjonas' build
yyc Sep 22, 2019
b6c1a0f
Merge branch 'master' into lily58_refactor
yyc Oct 21, 2019
e3c1f54
Update ninjonas.c
yyc Oct 21, 2019
9fa6a46
Merge branch 'master' of github.com:qmk/qmk_firmware into lily58_refa…
yyc Nov 4, 2019
8647d94
fix build/import issues
yyc Nov 4, 2019
24d5a56
update km
yyc Jan 31, 2020
a100f39
update debounce
yyc Apr 21, 2020
2173803
Merge branch 'master' of github.com:qmk/qmk_firmware into lily58_refa…
yyc Apr 21, 2020
d1060ba
update DIODE_DIRECTION
yyc Apr 21, 2020
27ae28b
address comments
yyc Apr 21, 2020
ff4e47b
Merge branch 'future' of github.com:qmk/qmk_firmware into lily58_refa…
yyc May 3, 2020
4ac3106
address comments
yyc May 3, 2020
ba60bfb
add Changelog
yyc May 3, 2020
45a8c23
Apply suggestions
yyc May 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/ChangeLog/20200530/PR6260.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Migrating Lily58 to use split_common

[#6260](https://github.com/qmk/qmk_firmware/pull/6260) Modifies the default firmware for Lily58 to use the `split_common` library, instead of including and depending on its own set of libraries for the following functionality:
- SSD1306 display
- i2c for OLED
- Serial Communication

This allows current lily58 firmware to advance with updates to the `split_common` library, which is shared with many other split keyboards.

## To migrate existing Lily58 firmware:

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


[Changes to `keymap.c`](https://github.com/qmk/qmk_firmware/pull/6260/files#diff-20943ea59856e9bdf3d99ecb2eee40b7):
- 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)
- Alternatively, if you did not change the OLED code from that in `default`, you may find it easier to simply copy the [relevant section](https://github.com/qmk/qmk_firmware/blob/4ac310668501ae6786c711ecc8f01f62ddaa1c0b/keyboards/lily58/keymaps/default/keymap.c#L138-L172). Otherwise, the changes you need to make are as follows (sample change [here](https://github.com/qmk/qmk_firmware/pull/6260/files#diff-20943ea59856e9bdf3d99ecb2eee40b7R138-R173))
- [Remove](https://github.com/qmk/qmk_firmware/pull/6260/files#diff-20943ea59856e9bdf3d99ecb2eee40b7L138-L141) 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 functions `matrix_scan_user`, `matrix_update` and `iota_gfx_task_user`
- Find/Replace `matrix_render_user(struct CharacterMatrix *matrix)` with `iota_gfx_task_user(void)`
- Find/Replace `is_master` with `is_keyboard_master()`
- For each instance of `matrix_write_ln(matrix, display_fn())`, rewrite it as `oled_write_ln(read_layer_state(), false);`
- For each instance of `matrix_write(matrix, read_logo());`, replace with `oled_write(read_logo(), false);`
12 changes: 9 additions & 3 deletions keyboards/lily58/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once

#include "config_common.h"
#include <serial_config.h>

#define USE_I2C
#define USE_SERIAL
#ifndef SOFT_SERIAL_PIN
#define SOFT_SERIAL_PIN D2
#define SERIAL_USE_MULTI_TRANSACTION
#endif

#if !defined(NO_ACTION_MACRO)
#define NO_ACTION_MACRO
#endif
#if !defined(NO_ACTION_FUNCTION)
#define NO_ACTION_FUNCTION
#endif

#define DIODE_DIRECTION COL2ROW

// Use the lily version to get the Lily58 logo instead of the qmk logo
#define OLED_FONT_H "lib/glcdfont_lily.c"
162 changes: 0 additions & 162 deletions keyboards/lily58/i2c.c

This file was deleted.

46 changes: 0 additions & 46 deletions keyboards/lily58/i2c.h

This file was deleted.

64 changes: 64 additions & 0 deletions keyboards/lily58/keymaps/chuan/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
This is the c configuration file for the keymap

Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

// #define USE_MATRIX_I2C

// #define USE_I2C

/* Select hand configuration */

#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS

// #define SSD1306OLED

#define USE_SERIAL_PD2

#define TAPPING_FORCE_HOLD

/* define tapping term */
#define TAPPING_TERM 200


#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 27
#define RGBLIGHT_LIMIT_VAL 120
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17

#define ENCODERS_PAD_A { F4 }
#define ENCODERS_PAD_B { F5 }


/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

// Underglow
/*
#undef RGBLED_NUM
#define RGBLED_NUM 14 // Number of LEDs
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SLEEP
*/
Loading