firmware/src/platform/extra_variants
Manuel b3525c2569
T-Deck Pro support (#6936)
* initial draft

* fix touchscreen

* fix touchscreen

* optimize GPS

* battery management

* cleanup comments

* enable vibration motor

* refactored TCA8418Keyboard

* update HW_VENDOR id

* manual fixes after merge

* fix keyboard/BQ27220 detection

* add BQ27220

* modify charge voltage and current

* update XpowerLib

* design capacity

* try-fix charge behavior

* improve Vbus detection

* moved variant into esp32s3 folder

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2025-07-21 19:33:24 +02:00
..
heltec_wireless_tracker remove newline from logging statements. (#5022) 2024-10-14 15:11:43 +11:00
t_deck_pro T-Deck Pro support (#6936) 2025-07-21 19:33:24 +02:00
README.md add lateInitVariant() as a concept. see below for docs 2024-08-28 11:25:54 -07:00

About extra_variants

This directory tree is designed to solve two problems.

  • The ESP32 arduino/platformio project doesn't support the nice "if initVariant() is found, call that after init" behavior of the nrf52 builds (they use initVariant() internally).
  • Over the years a lot of 'board specific' init code has been added to init() in main.cpp. It would be great to have a general/clean mechanism to allow developers to specify board specific/unique code in a clean fashion without mucking in main.

So we are borrowing the initVariant() ideas here (by using weak gcc references). You can now define lateInitVariant() if your board needs it.

If you'd like a board specific variant to be run, add the variant.cpp file to an appropriately named subdirectory and check for _VARIANT_boardname in the cpp file (so that your code is only built for your board). You'll need to define _VARIANT_boardname in your corresponding variant.h file. See existing boards for examples.

This approach has no added runtime cost.