Commit Graph

23 Commits

Author SHA1 Message Date
Kevin Hester
cdafa87cef add lateInitVariant() as a concept. see below for docs
(from src/extra_variants/README.md)

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.
2024-08-28 11:25:54 -07:00
Kevin Hester
5ccb6df142 Remove all sorts of redundant VEXT_ENABLE ifdefs 2024-08-22 09:28:41 -07:00
Kevin Hester
3ae8aadaf0 Merge the three redundant backlight enables into the single TFT_BL flag 2024-08-22 09:15:59 -07:00
Kevin Hester
7fb9b094d5 Remove redundant ST7735_BL variant defs.
No need for _V05 and _V03 definitions - I think there was a slight misunderstanding
on how variant files are supposed to _decrease_ #ifdef code in the cpp files.
2024-08-22 08:59:46 -07:00
Kevin Hester
d017fc7a5d for #4154 use internal pull-ups to power ADC_Ctrl
* Currently only on heltec tracker, but could use ADC_USE_PULLUP on other boards that could benefit
* Thanks @todd-herbert and @StevenCellist for the instructions ;-)
* Remove nasty Heltec_wireless #ifdefs that got somehow added to Power.cpp, instead use proper variant defs
* Cleanup adc enable/disable code a bit for less copy-paste cruft
2024-08-21 16:53:12 -07:00
Tom Fifield
316928deb0
Cleanup GPS, add UC6580 autodetect (#4319)
* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Only run speedSelect skip the first time

* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Cleanup GPS, add UC6580 autodetect

Our GPS code autodetects devices by default. Previously UC6580 was
statically assigned, and had its own baudrate configuration inside
the GPS code.

This change adds autodetect functionality for the UC6580 and moves
any 'special' GPS baud rate requirements for a variant out into the
variant configuration. Thereby cleaning up core GPS code a little,
saving the whales, and curing global warming.

New Functionality:
* If GPS_BAUDRATE is defined in variant.h, GPS autodetection will
try that baudrate first.
* UC6580 GPS chips are now automatically detected

* Remove Airoha baud rate code

It's no longer needed.
2024-07-23 06:18:27 -05:00
Mike G
0dd363fa98
Use upload_protocol = esptool as with the other heltec devices instead of esp-builtin (#4151) 2024-06-20 20:01:36 -05:00
Ben Meadors
4fa2427b8c Trunk variants 2024-05-31 11:18:06 -05:00
jonagnew
953aa4d091
Tracker v1.1 - fix pin 3 description in variant.h (#3990)
Schematic shows the following:
Pin 3 is Vext on v1.1 - HIGH enables LDO for Vext rail which goes to:
 GPS UC6580: GPS V_DET(8), VDD_IO(7), DCDC_IN(21), pulls up RESETN(17), D_SEL(33) and BOOT_MODE(34) through 10kR 
GPS LNA SW7125DE: VCC(4), pulls up SHDN(5) through 10kR
OLED: VDD, LEDA (through diode)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-05-31 10:55:20 -05:00
Aaron.Lee
b9edc7563b
Update the Heltec board battery level read accuracy. (#3955)
* Update variant.h

Update the Heltec board battery voltage read parameter.

* Update variant.h

Update the Heltec board battery voltage read parameter.

* Update variant.h

Update the Heltec board battery voltage read parameter.

* Update variant.h

Update the Heltec board battery voltage read parameter.
2024-05-31 10:55:05 -05:00
Mike
0c9da9aec7
Update platformio/espressif32 to the latest 6.7.0 (#3899)
* Bump platfomio/espressif32 version to latest 6.7.0

* Fix deprecated constants

* Remove pin defs already defined by the framework

* ESP_EXT1_WAKEUP_ALL_LOW is deprecated for any target except esp32

* Enable LTO and use newlib nano flavor

* Make trunk happy

* Respect build_unflags of base env

* Recover float printfing

* Disable BLE_SM_PAIR_AUTHREQ_SC

* Distribute BLE_SM_PAIR_KEY_DIST_ID too

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-05-21 21:02:09 -05:00
Gabriele Russo
0bfac7b5f9
Fixes [3074] Heltec Tracker Screen issues + minor fixes (#3213)
* Fix Heltec Tracker Screen issues

Fix Heltec Tracker Screen issues like wrong offsets, display size and screen not shutting down.

Divides board into two different envs for 1.0 and 1.1 version PCB

* Helteck wireless tracker default version V1_1

* rename heltec tracker 1.1 - trunk fmt

rename varian of heltec tracker 1.1 to "heltec tracker" to be retro-compatible.

Trunk formatting.

* Heltec Tracker increase Screen update to 3Hz

Heltec Tracker increase Screen update to 3Hz from 1Hz
2024-02-20 07:27:48 -06:00
Gabriele Russo
7c9d1b0abf
Battery level with proportional filter and lookup table (#3216)
* Add battery level with lookup table

now uses a lookup table to better calculate battery level of different cells

* LifePo4 and PB battery table - added voltage filter

removed delay from adc reading, added a software filter to smooth out voltage readings. In those applications battery would last hours to days, no sudden change should be expected so a less frequent voltage reading or a more aggressive filtering could be done.
Note: to speed up convergence i initiliazied the last value to the minimum voltage, there are other and better ways to init the filter.

Added LiFePO4 and PB  open circuit volta battery tables,

* Fixed ADC_CTRL , Checks for valid ADC readings

line 230/386 For heltec v3 and heltec tracker a different approach was used with the ADC_CTRL pin, now is more uniform using the same code for the 3 boards.

line 236 Check if the raw reading we are getting is Valid or not, count only the valid readings. This could lead to a division by 0 (improbable) so that's why at line 258 there is a check for that.

* updated OCV values

updated value to not OCV but to very low current, almost the same anyway

* Added Alkaline/Nimh voltage curve

Added Alkaline/Nimh voltage curve for AA/AAA and similar cells

* updates variants for new capacity measurement

* trunk reformatting

* trunk fmt

* Add LTO chemistry

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: code8buster <20384924+code8buster@users.noreply.github.com>
2024-02-16 06:09:57 -06:00
S5NC
18cf8ca4fa
Generalise SPI pin names (#2970)
* Generalise SPI pin names

* CS not NSS

* trunk fmt

* Update variant.h

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2023-11-29 15:51:05 -06:00
Thomas Göttgens
fc06754e1f
Possibly fix #2704 "Heltec Wireless Tracker screen doesn't display anything" (#2749)
* fix #2704


Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
2023-10-04 22:24:25 -05:00
S5NC
4e3576ae48
Simplify SX126x variant configuration (#2813)
* Update SX126xInterface.cpp

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update SX126xInterface.cpp

* Update SX126xInterface.cpp

* Update variant.h

* Update variant.h

* trunk fmt

* trunk fmt

* Update variant.h

* trunk fmt

* trunk fmt

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update pins_arduino.h

* Update pins_arduino.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* trunk fmt

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* trunk fmt

* trunk fmt

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

Specify behavior

* Update variant.h

Maintain behavior

* trunk fmt

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

* Update variant.h

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2023-09-27 16:01:40 -05:00
Jonathan Bennett
1a2c7f00e1
Gps cleanup and powersave (#2807)
* Refactor GPS to not probe if pins not defined

* Use Named Constructor to clean up code

* Move doGPSPowerSave to GPS class

* Make sure to set GPS awake on triple-click

* Cleanup and remove dead code

* Rename GPS_PIN_WAKE to GPS_PIN_STANDBY

* Actually put GPS to sleep between fixes

* add GPS_POWER_TOGGLE for heltec-tracker and t-deck

* Change GPS_THREAD_INTERVAL to 200 ms

* More dead code, compiler warnings, and add returns

* Add Number of sats to log output

* Add pgs enable and triple-click config

* Track average GPS fix time to judge low-power time

* Feed PositionModule on GPS fix

* Don't turn off the 3v3_s line on RAK4631
when the rotary is present.

* Add GPS power standbyOnly option

* Delay setting time currentQuality
to avoid strange log message.

* Typos, comments, and remove unused variable

* Short-circuit the setAwake logic on GPS disable

* heltec-tracker 0.3 GPS power saving

* set en_gpio to defined state

* Fix fixed_position logic with GPS disabled

* Don't process GPS serial when not isAwake

* Add quirk for Heltec Tracker GPS powersave

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: mverch67 <manuel.verch@gmx.de>
Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com>
2023-09-23 23:45:35 -05:00
Thomas Göttgens
684cce7640 trunk fmt 2023-08-06 16:53:37 +02:00
Thomas Göttgens
4e54bec525
Force small fonts on Low DPI screens, no matter what the driver default uses. Up till now we assumed large fonts on E-Paper and TFT Screens. (#2677) 2023-08-03 06:58:19 -05:00
Manuel
541291cc70
resolve heltec-wireless-tracker serial issue (#2621)
* add hwid for auto-detection

* fix: heltec-wireless-tracker USB serial
2023-07-17 13:06:34 -05:00
Manuel
ab32503601
Heltec-Tracker: GPS support (#2615)
* Heltec-Tracker: GPS support

* trunk fmt

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2023-07-16 16:57:14 -05:00
Manuel
c75965480f
Heltec-Tracker: TFT LCD support (#2612)
* Heltec-Tracker: TFT LCD support

* trunk fmt

* backwards compatibility  with ST7735 devices

* trunk fmt
2023-07-15 08:53:26 -05:00
Ben Meadors
4ace59fc18
Partial Heltec Wireless Paper and Wireless Tracker support (#2594)
* WIP

* Comment

* WIP

* TFT_CTRL

* Update platformio.ini

update to current latest version available

* Update EInkDisplay2.cpp

Is the e-ink Display a DEPG0213BN ?

* Logging

* trunk fmt

---------

Co-authored-by: Mark Trevor Birss <markbirss@gmail.com>
2023-07-14 16:12:30 -05:00