mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-29 21:22:03 +00:00
I thought git would be smart enough to understand all the whitespace changes but even with all the flags I know to make it ignore theses it still blows up if there are identical changes on both sides.
I have a solution but it require creating a new commit at the merge base for each conflicting PR and merging it into develop.
I don't think blowing up all PRs is worth for now, maybe if we can coordinate this for V3 let's say.
This reverts commit 0d11331d18.
This commit is contained in:
@@ -7,33 +7,34 @@
|
||||
#include "graphics/TFTDisplay.h"
|
||||
|
||||
// Heltec tracker specific init
|
||||
void lateInitVariant() {
|
||||
// LOG_DEBUG("Heltec tracker initVariant");
|
||||
void lateInitVariant()
|
||||
{
|
||||
// LOG_DEBUG("Heltec tracker initVariant");
|
||||
|
||||
#ifndef MESHTASTIC_EXCLUDE_GPS
|
||||
GpioVirtPin *virtGpsEnable = gps ? gps->enablePin : new GpioVirtPin();
|
||||
GpioVirtPin *virtGpsEnable = gps ? gps->enablePin : new GpioVirtPin();
|
||||
#else
|
||||
GpioVirtPin *virtGpsEnable = new GpioVirtPin();
|
||||
GpioVirtPin *virtGpsEnable = new GpioVirtPin();
|
||||
#endif
|
||||
|
||||
#ifndef MESHTASTIC_EXCLUDE_SCREEN
|
||||
// On this board we are actually using the backlightEnable signal to already be controlling a physical enable to the
|
||||
// display controller. But we'd _ALSO_ like to have that signal drive a virtual GPIO. So nest it as needed.
|
||||
GpioVirtPin *virtScreenEnable = new GpioVirtPin();
|
||||
if (TFTDisplay::backlightEnable) {
|
||||
GpioPin *physScreenEnable = TFTDisplay::backlightEnable;
|
||||
GpioPin *splitter = new GpioSplitter(virtScreenEnable, physScreenEnable);
|
||||
TFTDisplay::backlightEnable = splitter;
|
||||
// On this board we are actually using the backlightEnable signal to already be controlling a physical enable to the
|
||||
// display controller. But we'd _ALSO_ like to have that signal drive a virtual GPIO. So nest it as needed.
|
||||
GpioVirtPin *virtScreenEnable = new GpioVirtPin();
|
||||
if (TFTDisplay::backlightEnable) {
|
||||
GpioPin *physScreenEnable = TFTDisplay::backlightEnable;
|
||||
GpioPin *splitter = new GpioSplitter(virtScreenEnable, physScreenEnable);
|
||||
TFTDisplay::backlightEnable = splitter;
|
||||
|
||||
// Assume screen is initially powered
|
||||
splitter->set(true);
|
||||
}
|
||||
// Assume screen is initially powered
|
||||
splitter->set(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(VEXT_ENABLE) && (!defined(MESHTASTIC_EXCLUDE_GPS) || !defined(MESHTASTIC_EXCLUDE_SCREEN))
|
||||
// If either the GPS or the screen is on, turn on the external power regulator
|
||||
GpioPin *hwEnable = new GpioHwPin(VEXT_ENABLE);
|
||||
new GpioBinaryTransformer(virtGpsEnable, virtScreenEnable, hwEnable, GpioBinaryTransformer::Or);
|
||||
// If either the GPS or the screen is on, turn on the external power regulator
|
||||
GpioPin *hwEnable = new GpioHwPin(VEXT_ENABLE);
|
||||
new GpioBinaryTransformer(virtGpsEnable, virtScreenEnable, hwEnable, GpioBinaryTransformer::Or);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -8,19 +8,21 @@
|
||||
|
||||
CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, CST328_PIN_INT);
|
||||
|
||||
bool readTouch(int16_t *x, int16_t *y) {
|
||||
if (tsPanel.getTouches()) {
|
||||
*x = tsPanel.getPoint(0).x;
|
||||
*y = tsPanel.getPoint(0).y;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
if (tsPanel.getTouches()) {
|
||||
*x = tsPanel.getPoint(0).x;
|
||||
*y = tsPanel.getPoint(0).y;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// T-Deck Pro specific init
|
||||
void lateInitVariant() {
|
||||
tsPanel.begin();
|
||||
touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
void lateInitVariant()
|
||||
{
|
||||
tsPanel.begin();
|
||||
touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
}
|
||||
#endif
|
||||
@@ -8,19 +8,20 @@ DriverPins PinsAudioBoardES8311;
|
||||
AudioBoard board(AudioDriverES8311, PinsAudioBoardES8311);
|
||||
|
||||
// TLora Pager specific init
|
||||
void lateInitVariant() {
|
||||
// AudioDriverLogger.begin(Serial, AudioDriverLogLevel::Debug);
|
||||
// I2C: function, scl, sda
|
||||
PinsAudioBoardES8311.addI2C(PinFunction::CODEC, Wire);
|
||||
// I2S: function, mclk, bck, ws, data_out, data_in
|
||||
PinsAudioBoardES8311.addI2S(PinFunction::CODEC, DAC_I2S_MCLK, DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_DIN);
|
||||
void lateInitVariant()
|
||||
{
|
||||
// AudioDriverLogger.begin(Serial, AudioDriverLogLevel::Debug);
|
||||
// I2C: function, scl, sda
|
||||
PinsAudioBoardES8311.addI2C(PinFunction::CODEC, Wire);
|
||||
// I2S: function, mclk, bck, ws, data_out, data_in
|
||||
PinsAudioBoardES8311.addI2S(PinFunction::CODEC, DAC_I2S_MCLK, DAC_I2S_BCK, DAC_I2S_WS, DAC_I2S_DOUT, DAC_I2S_DIN);
|
||||
|
||||
// configure codec
|
||||
CodecConfig cfg;
|
||||
cfg.input_device = ADC_INPUT_LINE1;
|
||||
cfg.output_device = DAC_OUTPUT_ALL;
|
||||
cfg.i2s.bits = BIT_LENGTH_16BITS;
|
||||
cfg.i2s.rate = RATE_44K;
|
||||
board.begin(cfg);
|
||||
// configure codec
|
||||
CodecConfig cfg;
|
||||
cfg.input_device = ADC_INPUT_LINE1;
|
||||
cfg.output_device = DAC_OUTPUT_ALL;
|
||||
cfg.i2s.bits = BIT_LENGTH_16BITS;
|
||||
cfg.i2s.rate = RATE_44K;
|
||||
board.begin(cfg);
|
||||
}
|
||||
#endif
|
||||
@@ -10,32 +10,34 @@ TouchDrvCSTXXX tsPanel;
|
||||
static constexpr uint8_t PossibleAddresses[2] = {CST328_ADDR, CST226SE_ADDR_ALT};
|
||||
uint8_t i2cAddress = 0;
|
||||
|
||||
bool readTouch(int16_t *x, int16_t *y) {
|
||||
int16_t x_array[1], y_array[1];
|
||||
uint8_t touched = tsPanel.getPoint(x_array, y_array, 1);
|
||||
if (touched > 0) {
|
||||
*y = x_array[0];
|
||||
*x = (TFT_WIDTH - y_array[0]);
|
||||
// Check bounds
|
||||
if (*x < 0 || *x >= TFT_WIDTH || *y < 0 || *y >= TFT_HEIGHT) {
|
||||
return false;
|
||||
bool readTouch(int16_t *x, int16_t *y)
|
||||
{
|
||||
int16_t x_array[1], y_array[1];
|
||||
uint8_t touched = tsPanel.getPoint(x_array, y_array, 1);
|
||||
if (touched > 0) {
|
||||
*y = x_array[0];
|
||||
*x = (TFT_WIDTH - y_array[0]);
|
||||
// Check bounds
|
||||
if (*x < 0 || *x >= TFT_WIDTH || *y < 0 || *y >= TFT_HEIGHT) {
|
||||
return false;
|
||||
}
|
||||
return true; // Valid touch detected
|
||||
}
|
||||
return true; // Valid touch detected
|
||||
}
|
||||
return false; // No valid touch data
|
||||
return false; // No valid touch data
|
||||
}
|
||||
|
||||
void lateInitVariant() {
|
||||
tsPanel.setTouchDrvModel(TouchDrv_CST226);
|
||||
for (uint8_t addr : PossibleAddresses) {
|
||||
if (tsPanel.begin(Wire, addr, I2C_SDA, I2C_SCL)) {
|
||||
i2cAddress = addr;
|
||||
LOG_DEBUG("CST226SE init OK at address 0x%02X", addr);
|
||||
touchScreenImpl1 = new TouchScreenImpl1(TFT_WIDTH, TFT_HEIGHT, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
return;
|
||||
void lateInitVariant()
|
||||
{
|
||||
tsPanel.setTouchDrvModel(TouchDrv_CST226);
|
||||
for (uint8_t addr : PossibleAddresses) {
|
||||
if (tsPanel.begin(Wire, addr, I2C_SDA, I2C_SCL)) {
|
||||
i2cAddress = addr;
|
||||
LOG_DEBUG("CST226SE init OK at address 0x%02X", addr);
|
||||
touchScreenImpl1 = new TouchScreenImpl1(TFT_WIDTH, TFT_HEIGHT, readTouch);
|
||||
touchScreenImpl1->init();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_ERROR("CST226SE init failed at all known addresses");
|
||||
LOG_ERROR("CST226SE init failed at all known addresses");
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user