fix the code format by use trunk

Signed-off-by: imliubo <imliubo@makingfun.xyz>
This commit is contained in:
imliubo 2025-02-27 16:19:43 +08:00
parent a981ea5440
commit 3729635ef5
8 changed files with 73 additions and 75 deletions

View File

@ -14,7 +14,7 @@
#ifdef ARCH_PORTDUINO #ifdef ARCH_PORTDUINO
#include "platform/portduino/PortduinoGlue.h" #include "platform/portduino/PortduinoGlue.h"
#endif #endif
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
#include <M5Unified.h> #include <M5Unified.h>
#endif #endif
#define DEBUG_BUTTONS 0 #define DEBUG_BUTTONS 0
@ -372,38 +372,40 @@ void ButtonThread::userButtonPressedLongStop()
} }
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
// Define a constant // Define a constant
const unsigned long LONG_PRESS_THRESHOLD = 5000; // Hold the threshold const unsigned long LONG_PRESS_THRESHOLD = 5000; // Hold the threshold
const unsigned long DOUBLE_CLICK_THRESHOLD = 1000; // Double-click the threshold const unsigned long DOUBLE_CLICK_THRESHOLD = 1000; // Double-click the threshold
const int MAX_CLICKS = 2; // Maximum hits const int MAX_CLICKS = 2; // Maximum hits
// Global variable // Global variable
unsigned long lastClickTime = 0; // The time of the last click unsigned long lastClickTime = 0; // The time of the last click
int clickCount = 0; // Click count int clickCount = 0; // Click count
unsigned long touch_start_time; // Touch start time unsigned long touch_start_time; // Touch start time
bool is_touching = false; // Mark whether you are currently touching bool is_touching = false; // Mark whether you are currently touching
void ScreenTouch(){ void ScreenTouch()
{
M5.update(); M5.update();
auto count = M5.Touch.getCount(); auto count = M5.Touch.getCount();
if (count == 0) return; if (count == 0)
return;
for (std::size_t i = 0; i < count; ++i) { for (std::size_t i = 0; i < count; ++i) {
auto t = M5.Touch.getDetail(i); auto t = M5.Touch.getDetail(i);
// If touch starts // If touch starts
if (t.wasPressed()) { if (t.wasPressed()) {
touch_start_time = millis(); // Record the time when the touch began touch_start_time = millis(); // Record the time when the touch began
is_touching = true; // Set to touch is_touching = true; // Set to touch
} }
//Check the current touch status // Check the current touch status
if (is_touching) { if (is_touching) {
unsigned long duration = millis() - touch_start_time; unsigned long duration = millis() - touch_start_time;
if (duration >= LONG_PRESS_THRESHOLD) { if (duration >= LONG_PRESS_THRESHOLD) {
LOG_INFO("Long Press Detected\n"); LOG_INFO("Long Press Detected\n");
powerFSM.trigger(EVENT_PRESS); powerFSM.trigger(EVENT_PRESS);
screen->startAlert("Shutting down..."); screen->startAlert("Shutting down...");
screen->forceDisplay(true); screen->forceDisplay(true);
// Executive logic, such as shutdown, display menu, etc // Executive logic, such as shutdown, display menu, etc
// To avoid duplicate detection, set is_touching to false here // To avoid duplicate detection, set is_touching to false here
is_touching = false; is_touching = false;
M5.Speaker.tone(3000, 300); M5.Speaker.tone(3000, 300);
delay(1000); delay(1000);
M5.Power.powerOff(); M5.Power.powerOff();
@ -413,13 +415,13 @@ void ScreenTouch(){
if (t.wasReleased()) { if (t.wasReleased()) {
if (is_touching) { if (is_touching) {
unsigned long duration = millis() - touch_start_time; unsigned long duration = millis() - touch_start_time;
if (duration < LONG_PRESS_THRESHOLD) { if (duration < LONG_PRESS_THRESHOLD) {
unsigned long currentTime = millis(); unsigned long currentTime = millis();
// Check whether it is a double click // Check whether it is a double click
if (currentTime - lastClickTime <= DOUBLE_CLICK_THRESHOLD) { if (currentTime - lastClickTime <= DOUBLE_CLICK_THRESHOLD) {
clickCount++; clickCount++;
if (clickCount == MAX_CLICKS) { if (clickCount == MAX_CLICKS) {
LOG_INFO("Double Click Detected\n"); LOG_INFO("Double Click Detected\n");
M5.Speaker.tone(2000, 100); M5.Speaker.tone(2000, 100);
service->refreshLocalMeshNode(); service->refreshLocalMeshNode();
auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true); auto sentPosition = service->trySendPosition(NODENUM_BROADCAST, true);
@ -430,24 +432,23 @@ void ScreenTouch(){
screen->print("Sent ad-hoc nodeinfo\n"); screen->print("Sent ad-hoc nodeinfo\n");
screen->forceDisplay(true); // Force a new UI frame, then force an EInk update screen->forceDisplay(true); // Force a new UI frame, then force an EInk update
} }
clickCount = 0; clickCount = 0;
} }
} else { } else {
clickCount = 1; clickCount = 1;
} }
lastClickTime = currentTime; // Update last click time lastClickTime = currentTime; // Update last click time
} }
} }
// Reset the touch status // Reset the touch status
is_touching = false; is_touching = false;
} }
// You can add more status checks, such as sliding and dragging // You can add more status checks, such as sliding and dragging
if (t.wasFlickStart()) { if (t.wasFlickStart()) {
LOG_INFO("Flick Start Detected\n"); LOG_INFO("Flick Start Detected\n");
M5.Speaker.tone(1000, 100); M5.Speaker.tone(1000, 100);
powerFSM.trigger(EVENT_PRESS); powerFSM.trigger(EVENT_PRESS);
} }
} }
} }

View File

@ -64,15 +64,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "modules/StoreForwardModule.h" #include "modules/StoreForwardModule.h"
#include "platform/portduino/PortduinoGlue.h" #include "platform/portduino/PortduinoGlue.h"
#endif #endif
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
#include "M5Unified.h" #include "M5Unified.h"
#define OLED_BLACK OLEDDISPLAY_COLOR::BLACK #define OLED_BLACK OLEDDISPLAY_COLOR::BLACK
#define OLED_WHITE OLEDDISPLAY_COLOR::WHITE #define OLED_WHITE OLEDDISPLAY_COLOR::WHITE
#else #else
#define OLED_BLACK BLACK #define OLED_BLACK BLACK
#define OLED_WHITE WHITE #define OLED_WHITE WHITE
#endif #endif
extern DataInfo DataRegion; extern DataInfo DataRegion;
using namespace meshtastic; /** @todo remove */ using namespace meshtastic; /** @todo remove */
namespace graphics namespace graphics
@ -956,21 +956,22 @@ bool deltaToTimestamp(uint32_t secondsAgo, uint8_t *hours, uint8_t *minutes, int
validCached = true; validCached = true;
return validCached; return validCached;
} }
static void drawLoraMessage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y){ static void drawLoraMessage(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
{
display->drawString(x + 0, y + 0, myRegion->name); display->drawString(x + 0, y + 0, myRegion->name);
display->setFont(FONT_MEDIUM); display->setFont(FONT_MEDIUM);
display->drawString(x + 10, y + 30,"channel: "+String(DataRegion.lora_channel_num+1)); display->drawString(x + 10, y + 30, "channel: " + String(DataRegion.lora_channel_num + 1));
display->drawString(x + 10, y + 60,"bw: "+ String(DataRegion.lora_bw)); display->drawString(x + 10, y + 60, "bw: " + String(DataRegion.lora_bw));
display->drawString(x + SCREEN_WIDTH/2+10, y+30,"freq: "+String(DataRegion.lora_freq)); display->drawString(x + SCREEN_WIDTH / 2 + 10, y + 30, "freq: " + String(DataRegion.lora_freq));
display->drawString(x + SCREEN_WIDTH/2+10, y+60,"power: "+ String(DataRegion.lora_power_output)); display->drawString(x + SCREEN_WIDTH / 2 + 10, y + 60, "power: " + String(DataRegion.lora_power_output));
display->drawString(x + 10, y + 90,"sf: "+String(DataRegion.lora_sf)); display->drawString(x + 10, y + 90, "sf: " + String(DataRegion.lora_sf));
display->drawString(x + SCREEN_WIDTH/2+10, y+90,"cr: 4/:"+ String(DataRegion.lora_cr)); display->drawString(x + SCREEN_WIDTH / 2 + 10, y + 90, "cr: 4/:" + String(DataRegion.lora_cr));
display->setTextAlignment(TEXT_ALIGN_LEFT); display->setTextAlignment(TEXT_ALIGN_LEFT);
const char *title = "LoRa"; const char *title = "LoRa";
display->drawString(x + SCREEN_WIDTH/2-20, y +0, title); display->drawString(x + SCREEN_WIDTH / 2 - 20, y + 0, title);
display->setFont(FONT_SMALL); display->setFont(FONT_SMALL);
display->setTextAlignment(TEXT_ALIGN_RIGHT); display->setTextAlignment(TEXT_ALIGN_RIGHT);
display->drawString(x + SCREEN_WIDTH, y,String(DataRegion.lora_channel_name)); display->drawString(x + SCREEN_WIDTH, y, String(DataRegion.lora_channel_name));
display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code display->setTextAlignment(TEXT_ALIGN_LEFT); // Restore left align, just to be kind to any other unsuspecting code
} }
/// Draw the last text message we received /// Draw the last text message we received
@ -991,7 +992,7 @@ static void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state
display->setFont(FONT_SMALL); display->setFont(FONT_SMALL);
if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) { if (config.display.displaymode == meshtastic_Config_DisplayConfig_DisplayMode_INVERTED) {
display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL); display->fillRect(0 + x, 0 + y, x + display->getWidth(), y + FONT_HEIGHT_SMALL);
display->setColor(OLED_BLACK); display->setColor(OLED_BLACK);
} }
// For time delta // For time delta
@ -1659,9 +1660,9 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
pinMode(TFT_BL, OUTPUT); pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, HIGH); digitalWrite(TFT_BL, HIGH);
#endif #endif
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
M5.Power.Axp192.setDCDC3(1000); M5.Power.Axp192.setDCDC3(1000);
M5.Display.setBrightness(130); M5.Display.setBrightness(130);
#endif #endif
enabled = true; enabled = true;
setInterval(0); // Draw ASAP setInterval(0); // Draw ASAP
@ -1678,7 +1679,7 @@ void Screen::handleSetOn(bool on, FrameCallback einkScreensaver)
pinMode(TFT_BL, OUTPUT); pinMode(TFT_BL, OUTPUT);
digitalWrite(TFT_BL, LOW); digitalWrite(TFT_BL, LOW);
#endif #endif
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
M5.Power.Axp192.setDCDC3(0); M5.Power.Axp192.setDCDC3(0);
#endif #endif
#ifdef USE_ST7789 #ifdef USE_ST7789
@ -2512,7 +2513,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
} }
} }
#endif #endif
display->setColor(OLED_WHITE); display->setColor(OLED_WHITE);
// Draw the channel name // Draw the channel name
display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr); display->drawString(x, y + FONT_HEIGHT_SMALL, channelStr);
// Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo // Draw our hardware ID to assist with bluetooth pairing. Either prefix with Info or S&F Logo
@ -2605,7 +2606,7 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i
} }
} }
display->setColor(OLED_WHITE); display->setColor(OLED_WHITE);
/* /*
- WL_CONNECTED: assigned when connected to a WiFi network; - WL_CONNECTED: assigned when connected to a WiFi network;

View File

@ -310,9 +310,9 @@ class LGFX : public lgfx::LGFX_Device
cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read cfg.dummy_read_bits = 1; // Number of bits for dummy read before non-pixel data read
cfg.readable = true; // Set to true if data can be read cfg.readable = true; // Set to true if data can be read
#if defined(M5STACK_COREBASIC) #if defined(M5STACK_COREBASIC)
cfg.invert = true; // Set to true if the light/darkness of the panel is reversed cfg.invert = true; // Set to true if the light/darkness of the panel is reversed
#else #else
cfg.invert = false; // Set to true if the light/darkness of the panel is reversed cfg.invert = false; // Set to true if the light/darkness of the panel is reversed
#endif #endif
cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped
cfg.dlen_16bit = cfg.dlen_16bit =
@ -332,9 +332,9 @@ class LGFX : public lgfx::LGFX_Device
auto cfg = _light_instance.config(); // Gets a structure for backlight settings. auto cfg = _light_instance.config(); // Gets a structure for backlight settings.
#if !defined(M5STACK_CORE2) #if !defined(M5STACK_CORE2)
cfg.pin_bl = TFT_BL; // Pin number to which the backlight is connected cfg.pin_bl = TFT_BL; // Pin number to which the backlight is connected
#endif #endif
cfg.invert = false; // true to invert the brightness of the backlight cfg.invert = false; // true to invert the brightness of the backlight
// cfg.freq = 44100; // PWM frequency of backlight // cfg.freq = 44100; // PWM frequency of backlight
// cfg.pwm_channel = 1; // PWM channel number to use // cfg.pwm_channel = 1; // PWM channel number to use
@ -747,7 +747,8 @@ void TFTDisplay::sendCommand(uint8_t com)
unphone.backlight(true); // using unPhone library unphone.backlight(true); // using unPhone library
#endif #endif
#ifdef RAK14014 #ifdef RAK14014
#elif !defined(M5STACK) && !defined(ST7789_CS) && !defined(M5STACK_COREBASIC) && !defined(M5STACK_CORE2)// T-Deck gets brightness set in Screen.cpp in the handleSetOn function #elif !defined(M5STACK) && !defined(ST7789_CS) && !defined(M5STACK_COREBASIC) && \
!defined(M5STACK_CORE2) // T-Deck gets brightness set in Screen.cpp in the handleSetOn function
tft->setBrightness(172); tft->setBrightness(172);
#endif #endif
break; break;
@ -857,7 +858,7 @@ bool TFTDisplay::connect()
tft->init(); tft->init();
#endif #endif
#if defined(M5STACK) || defined(M5STACK_COREBASIC) || defined(M5STACK_CORE2) #if defined(M5STACK) || defined(M5STACK_COREBASIC) || defined(M5STACK_CORE2)
tft->setRotation(0); tft->setRotation(0);
#elif defined(RAK14014) #elif defined(RAK14014)
tft->setRotation(1); tft->setRotation(1);

View File

@ -115,11 +115,10 @@ AccelerometerThread *accelerometerThread = nullptr;
AudioThread *audioThread = nullptr; AudioThread *audioThread = nullptr;
#endif #endif
#if defined(TCXO_OPTIONAL) #if defined(TCXO_OPTIONAL)
float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; // if TCXO is optional, put this here so it can be changed further down. float tcxoVoltage = SX126X_DIO3_TCXO_VOLTAGE; // if TCXO is optional, put this here so it can be changed further down.
#endif #endif
#if defined(M5STACK_COREBASIC) || defined(M5STACK_CORE2) #if defined(M5STACK_COREBASIC) || defined(M5STACK_CORE2)
#include <M5Unified.h> #include <M5Unified.h>
#endif #endif
@ -1234,6 +1233,5 @@ void loop()
#if defined(M5STACK_CORE2) #if defined(M5STACK_CORE2)
ScreenTouch(); ScreenTouch();
#endif #endif
} }
#endif #endif

View File

@ -39,14 +39,13 @@ extern bool pmu_found;
extern bool isCharging; extern bool isCharging;
extern bool isUSBPowered; extern bool isUSBPowered;
struct DataInfo { struct DataInfo {
int lora_channel_num; int lora_channel_num;
double lora_freq; double lora_freq;
const char* lora_channel_name; const char *lora_channel_name;
int lora_power_output; int lora_power_output;
float lora_bw; float lora_bw;
int lora_sf; int lora_sf;
int lora_cr; int lora_cr;
}; };

View File

@ -12,7 +12,7 @@
#include <pb_decode.h> #include <pb_decode.h>
#include <pb_encode.h> #include <pb_encode.h>
DataInfo DataRegion; DataInfo DataRegion;
#define RDEF(name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, frequency_switching, wide_lora) \ #define RDEF(name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, frequency_switching, wide_lora) \
{ \ { \
meshtastic_Config_LoRaConfig_RegionCode_##name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, \ meshtastic_Config_LoRaConfig_RegionCode_##name, freq_start, freq_end, duty_cycle, spacing, power_limit, audio_permitted, \
@ -213,8 +213,8 @@ uint32_t RadioInterface::getPacketTime(uint32_t pl)
float tPacket = tPreamble + tPayload; float tPacket = tPreamble + tPayload;
uint32_t msecs = tPacket * 1000; uint32_t msecs = tPacket * 1000;
DataRegion.lora_sf=sf; DataRegion.lora_sf = sf;
DataRegion.lora_cr=cr; DataRegion.lora_cr = cr;
LOG_DEBUG("(bw=%d, sf=%d, cr=4/%d) packet symLen=%d ms, payloadSize=%u, time %d ms\n", (int)bw, sf, cr, (int)(tSym * 1000), LOG_DEBUG("(bw=%d, sf=%d, cr=4/%d) packet symLen=%d ms, payloadSize=%u, time %d ms\n", (int)bw, sf, cr, (int)(tSym * 1000),
pl, msecs); pl, msecs);
return msecs; return msecs;
@ -574,11 +574,11 @@ void RadioInterface::applyModemConfig()
preambleTimeMsec = getPacketTime((uint32_t)0); preambleTimeMsec = getPacketTime((uint32_t)0);
maxPacketTimeMsec = getPacketTime(meshtastic_Constants_DATA_PAYLOAD_LEN + sizeof(PacketHeader)); maxPacketTimeMsec = getPacketTime(meshtastic_Constants_DATA_PAYLOAD_LEN + sizeof(PacketHeader));
DataRegion.lora_channel_num=channel_num; DataRegion.lora_channel_num = channel_num;
DataRegion.lora_freq=getFreq(); DataRegion.lora_freq = getFreq();
DataRegion.lora_channel_name=channelName; DataRegion.lora_channel_name = channelName;
DataRegion.lora_power_output=power; DataRegion.lora_power_output = power;
DataRegion.lora_bw=bw; DataRegion.lora_bw = bw;
LOG_INFO("Radio freq=%.3f, config.lora.frequency_offset=%.3f\n", freq, loraConfig.frequency_offset); LOG_INFO("Radio freq=%.3f, config.lora.frequency_offset=%.3f\n", freq, loraConfig.frequency_offset);
LOG_INFO("Set radio: region=%s, name=%s, config=%u, ch=%d, power=%d\n", myRegion->name, channelName, loraConfig.modem_preset, LOG_INFO("Set radio: region=%s, name=%s, config=%u, ch=%d, power=%d\n", myRegion->name, channelName, loraConfig.modem_preset,
channel_num, power); channel_num, power);

View File

@ -1,14 +1,13 @@
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep // #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
// #define BUTTON_PIN 39 // 38, 37 // #define BUTTON_PIN 39 // 38, 37
// #define BUTTON_PIN 0 // #define BUTTON_PIN 0
#define BUTTON_NEED_PULLUP #define BUTTON_NEED_PULLUP
// #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin. // #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Plugin.
//#define BUTTON_PIN // #define BUTTON_PIN
//#define PIN_BUZZER 25 // #define PIN_BUZZER 25
#undef LORA_SCK #undef LORA_SCK
#undef LORA_MISO #undef LORA_MISO
#undef LORA_MOSI #undef LORA_MOSI
@ -17,11 +16,11 @@
#define LORA_SCK 18 #define LORA_SCK 18
#define LORA_MISO 38 #define LORA_MISO 38
#define LORA_MOSI 23 #define LORA_MOSI 23
#define LORA_CS 33 //NSS #define LORA_CS 33 // NSS
#define USE_RF95 #define USE_RF95
#define RF95_MAX_POWER 17 #define RF95_MAX_POWER 17
#define LORA_DIO0 35 // IRQ #define LORA_DIO0 35 // IRQ
#define LORA_RESET 19 #define LORA_RESET 19
#define LORA_DIO1 RADIOLIB_NC // Not really used #define LORA_DIO1 RADIOLIB_NC // Not really used
#define LORA_DIO2 RADIOLIB_NC // Not really used #define LORA_DIO2 RADIOLIB_NC // Not really used
@ -41,5 +40,5 @@
// LCD screens are slow, so slowdown the wipe so it looks better // LCD screens are slow, so slowdown the wipe so it looks better
#define SCREEN_TRANSITION_FRAMERATE 30 // fps #define SCREEN_TRANSITION_FRAMERATE 30 // fps
// Picomputer gets a white on black display // Picomputer gets a white on black display
#define TFT_MESH COLOR565 (0xA0, 0xFF, 0x00)//(0x94, 0xEA, 0x67) #define TFT_MESH COLOR565(0xA0, 0xFF, 0x00) //(0x94, 0xEA, 0x67)
#define ILI9341_SPI_HOST VSPI_HOST // VSPI_HOST or HSPI_HOST #define ILI9341_SPI_HOST VSPI_HOST // VSPI_HOST or HSPI_HOST

View File

@ -20,12 +20,12 @@
#define LORA_SCK 18 #define LORA_SCK 18
#define LORA_MISO 19 #define LORA_MISO 19
#define LORA_MOSI 23 #define LORA_MOSI 23
#define LORA_CS 5 //NSS #define LORA_CS 5 // NSS
#define USE_RF95 #define USE_RF95
#define RF95_MAX_POWER 17 #define RF95_MAX_POWER 17
#define LORA_DIO0 35 // IRQ #define LORA_DIO0 35 // IRQ
#define LORA_RESET 13 // RST #define LORA_RESET 13 // RST
#define LORA_DIO1 RADIOLIB_NC // Not really used #define LORA_DIO1 RADIOLIB_NC // Not really used
#define LORA_DIO2 RADIOLIB_NC // Not really used #define LORA_DIO2 RADIOLIB_NC // Not really used
@ -35,10 +35,9 @@
#define GPS_RX_PIN 16 #define GPS_RX_PIN 16
#define GPS_TX_PIN 17 #define GPS_TX_PIN 17
// Note: If you use corebasic version 2.7 or later,
//Note: If you use corebasic version 2.7 or later, // you need to go to the src>graphics>TFTDisplay.cpp file to change the value of cfg.invert,
//you need to go to the src>graphics>TFTDisplay.cpp file to change the value of cfg.invert, // this one is to set the color inversion
//this one is to set the color inversion
#define TFT_HEIGHT 240 #define TFT_HEIGHT 240
#define TFT_WIDTH 320 #define TFT_WIDTH 320
#define TFT_OFFSET_X 0 #define TFT_OFFSET_X 0