qmk_firmware icon indicating copy to clipboard operation
qmk_firmware copied to clipboard

[WIP] Refactor CTPC logic to allow future converters

Open zvecr opened this issue 3 years ago • 0 comments

Description

Initial steps at supporting additional converters.

Overall goals

  • [x] Introduce consistent convention to be followed
  • [x] Avoid pin_defs.h from becoming a dumping ground
    • Split out into their own files
  • [x] Validate converter can be applied to a given board
    • Something along the lines of adding PIN_COMPATIBLE = promicro and rules to only allow CTPC when compatible
    • This will block invalid conversion attempts, such as make xd48pro CTPC=yes
  • [x] Introduction of "promicro" "elite c" "blackpill" presets?
    • would set mcu, bootloader, and conversion compatibility
  • [ ] Refactor existing boards to use presets or manually define PIN_COMPATIBLE
  • [x] Consistent handling of hardware config
    • currently fragmented between common_features.mk and convert_to_proton_c.mk
  • [ ] Consistent handling of config.h/rules.mk config defaulting
    • rgb/i2c config for dma/pwm/etc
  • [x] Config of additional hardware
    • CTPC audio
    • bonsai flash/fram
  • [x] ~~allow more shorthand along the lines of CTPC = yes?~~
    • current view is to remove shorthand
  • [x] keymap.json specify converter
  • [ ] Tighter control of interface?
    • Intermediate stage could map arduino pin names?
  • [ ] data driven?
  • [ ] definition of optional pins ?
    • allow converted target to configure additional features without using low level gpio defines
  • [ ] alias system to allow reuse of converter for compatible designs - #19533

Notes

  • ~~Include path is not consistent enough to have the same header name for converted pin defs~~
    • Fixed up enough that VPATH modified early in the build process is enough
  • ~~How to infer the conversion makefile if located platforms/chibios/boards/QMK_PROTON_C?~~
    • Solved with relocation and glob
  • platform board files inheriting from other platform board files?

Types of Changes

  • [x] Core
  • [ ] Bugfix
  • [ ] New feature
  • [x] Enhancement/optimization
  • [ ] Keyboard (addition or update)
  • [ ] Keymap/layout/userspace (addition or update)
  • [ ] Documentation

Issues Fixed or Closed by This PR

Checklist

  • [x] My code follows the code style of this project: C, Python
  • [x] I have read the PR Checklist document and have made the appropriate changes.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [x] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

zvecr avatar Mar 09 '22 19:03 zvecr