keychron_qmk_firmware/keyboards/handwired/d48
James Young a03aa301de
Remove Full Bootmagic (#13846)
* disambiguate Bootmagic rules in keymaps

The files edited by this commit were added at a point in time where `BOOTMAGIC_ENABLE = yes` enabled full Bootmagic.

This commit edits the files to specify that full Bootmagic is intended.

* remove BOOTMAGIC_ENABLE=full setting

* unify commented BOOTMAGIC_ENABLE rules in keyboards

Explicitly sets `BOOTMAGIC_ENABLE = no` in keyboards where the rule was commented out.

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;#[ \t]*\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-zA-Z]\+\).*;\1 = no       # Virtual DIP switch configuration;g' {} +
```

* remove commented Bootmagic rules from keymap/user level

Command:

```
find keyboards/ layouts/ users/ -type f -name 'rules.mk' -exec sed -i -e '/#.*\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*/d' {} +
```

* update keyboard BOOTMAGIC_ENABLE rule formatting

Sets the formatting of BOOTMAGIC_ENABLE rules to `BOOTMAGIC_ENABLE = [value]`, without the inline comments (which will be replaced later).

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
```

* update keyboards' BOOTMAGIC_ENABLE settings

Updates keyboard `rules.mk` files to use `BOOTMAGIC_ENABLE = lite` where `BOOTMAGIC_ENABLE = full` was being used.

Command:

```
find keyboards/ -type f -name 'rules.mk' -and -not -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = \)full;\1lite;g' '{}' +
```

* update keymap/user BOOTMAGIC_ENABLE settings

Updates keymap/user `rules.mk` files to use `BOOTMAGIC_ENABLE = lite` where `BOOTMAGIC_ENABLE = full` was being used.

Commands:

```
find keyboards/ -type f -name 'rules.mk' -and -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE[ \t=]\+\)full;\1lite;g' '{}' +
find layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE[ \t=]\+\)full;\1lite;g' '{}' +
```

* remove and replace inline comments in keyboards and keymap/user files

Removes and replaces the inline comments, which have been updated to read `Enable Bootmagic Lite`.

Commands:

```
find keyboards/ -type f -name 'rules.mk' -and -path '*/keymaps/*' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
find layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE\)[ \t=]\+\([a-z]\+\).*;\1 = \2;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = lite\);\1     # Enable Bootmagic Lite;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = yes\);\1      # Enable Bootmagic Lite;g' '{}' +
find keyboards/ layouts/community/ users/ -type f -name 'rules.mk' -exec sed -i -e 's;\(BOOTMAGIC_ENABLE = no\);\1       # Enable Bootmagic Lite;g' '{}' +
```

* rename improperly named makefiles

Some files intended to be used as makefiles had improper names causing them to not be used as intended when building.

This commit corrects the filenames of the affected files.

* update renamed file with new rule formatting

* update QMK's template files

Updates QMK's `rules.mk` templates to use the new inline comment.

* update QMK Docs

- remove documentation of full Bootmagic
- update links to Bootmagic Lite doc
- add doc for Magic Keycodes

* rules.mk patch for coarse/ixora and coarse/vinta
2021-08-06 23:59:56 -07:00
..
keymaps 2021 May 29 Breaking Changes Update (#13034) 2021-05-29 14:38:50 -07:00
config.h
d48.c
d48.h
ds1307.c
ds1307.h
glcdfont_d48.c
info.json Add missing info.json files for keyboards (#12239) 2021-03-15 01:06:55 -07:00
readme.md
rules.mk Remove Full Bootmagic (#13846) 2021-08-06 23:59:56 -07:00
taphold.c
taphold.h

D48

Proton C based handwired 40% keyboard

A Proton C based handwired 48 key keyboard with 2 rotary encoders, I2C OLED, WS2812 strip, buzzer & clock!

  • Keyboard Maintainer: Andrew Dunai
  • Hardware Supported: Proton C handwired

Make example for this keyboard (after setting up your build environment):

make handwired/d48:default

Details

  • Proton C based handwired keyboard
  • 2x custom 1.25mm stainless steel plates
  • Kailh Choc White (clicky)
  • 2x rotary encoders
  • 0.91" 128x32 I2C OLED
  • Small buzzer mounted inside (still waiting for the AST1109MLTRQ boys)
  • WS2812 strip (14 LEDs)
  • DS1307 I2C module real-time clock

Build process: album

Pinout

D48 pinout

Challenges

I'm very happy with the result, but at some point Proton C was driving me nuts.

I did a lot of trial and error during assembly & programming. There were a lot of yet undocumented caveats, so I'll outline them here so that you guys can avoid the same issues I had.

Matrix & encoders

Although this is a 48-key board with a 12-col & 4-row matrix, I've decided to add an extra row above the first one to make my matrix 12x5 and wire encoders' push buttons as 2 extra keys, thus making it a total of 50 (12x4 + 2 encoders). I used 2 columns (9 & 12) for those buttons.

So, a first row actually has 2 buttons on columns 9 & 12 (because encoders are located near those columns). Encoders' push buttons are also configured via QMK's keymap.

Check out the d48.h & config.h for pins used & keymap macro definition.

I2C/OLED

Most of the stuff worked out of the box, except me choosing the right pins for my OLED.

On the Proton C pinout, there are 3 labels for I2C and for some reason there are 2 pairs of SDA/SCL for I2C1 channel: B8/B9 (rear left side) and B6/B7 (rear right side). I'm not sure if this is a mistake or if I was doing something wrong. So initially I picked B8/B9 which were not working. When I switched to B6/B7, things worked like a charm. Later I used B9 for matrix row. No issues so far.

Oh, and by the way, while using B8/B9, keyboard was sometimes swallowing quick keypresses. I believe this was due to I(2)C timeouts (because incorrect pins were used for OLED).

Buzzer

It turns out once you switch on AUDIO_ENABLE, you cannot use A4 & A5 because they interfere with the buzzer. My guess is that buzzer uses DAC channels (not sure why both).

I couldn't find this in documentation. Honestly, Proton C has almost zero documentation and this was the biggest challenge. Anyway, apart from almost going crazy from those challenges, I really liked it!

RGB

I used pin A15 for my WS28128 RGB strip.

D1307 real-time clock

Connecting DS1307 RTC was a piece of cake: same I2 pins as OLED (SDA/SCL), GND to GND and power to Proton C VUSB pin (5v).

Other issues

  • B5 could not be used for matrix.
  • TAP_CODE_DELAY had to be increased to 10 to fix tap_code(KC_VOLU/KC_VOLD) calls being swallowed in encoder callback.
  • Be extremely attentive about the pinout: keep in mind that the official Proton C pinout displays the rear of the board, not the front. Being used to front pinouts, I ended up soldering entire matrix to the wrong side, so I had to desolder every wire and connect it to the opposite side.

Conclusion

I had a lot of fun. The layout was inspired by the Planck THK. Feel free to ask any questions!