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

[WIP] Refactor CTPC logic to allow future converters #16598

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Mar 9, 2022

Description

Initial steps at supporting additional converters.

Overall goals

  • Introduce consistent convention to be followed
  • Avoid pin_defs.h from becoming a dumping ground
    • Split out into their own files
  • 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
  • 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 - Remove converter assumption that everything is a promicro #20330
  • 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
  • Config of additional hardware
    • CTPC audio
    • bonsai flash/fram
  • allow more shorthand along the lines of CTPC = yes?
    • current view is to remove shorthand
  • 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 - Add alias support for converters #19563
  • qmk info -f json -kb <keyboard> -km <keymap_with_convert_to> shows pre-converted info (incorrect mcu/bootloader/protocol/etc)

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

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

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • 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.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Mar 9, 2022
@zvecr zvecr changed the title Move converted pindefs separate file Refactor CTPC logic to allow future converters Mar 9, 2022
@github-actions github-actions bot added cli qmk cli command python labels Mar 10, 2022
@zvecr zvecr mentioned this pull request Mar 10, 2022
14 tasks
@zvecr zvecr force-pushed the feature/converters1 branch 2 times, most recently from 707a7a9 to 4fe1a5a Compare March 11, 2022 19:01
@zvecr zvecr changed the title Refactor CTPC logic to allow future converters [WIP] Refactor CTPC logic to allow future converters Mar 11, 2022
@zvecr zvecr force-pushed the feature/converters1 branch from 1a3e6cc to 0d59bc6 Compare April 3, 2022 18:14
@github-actions github-actions bot removed core cli qmk cli command python labels Apr 3, 2022
@zvecr zvecr force-pushed the feature/converters1 branch from 0d59bc6 to 41d0041 Compare April 3, 2022 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant