diff --git a/arch/rp2xx0/rp2350.ini b/arch/rp2xx0/rp2350.ini
deleted file mode 100644
index c5849ff2a..000000000
--- a/arch/rp2xx0/rp2350.ini
+++ /dev/null
@@ -1,25 +0,0 @@
-; Common settings for rp2040 Processor based targets
-[rp2350_base]
-platform = https://github.com/maxgerhardt/platform-raspberrypi.git#19e30129fb1428b823be585c787dcb4ac0d9014c ; For arduino-pico >=4.2.1
-extends = arduino_base
-platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git#6024e9a7e82a72e38dd90f42029ba3748835eb2e ; 4.3.0 with fix MDNS
-
-board_build.core = earlephilhower
-board_build.filesystem_size = 0.5m
-build_flags =
- ${arduino_base.build_flags} -Wno-unused-variable
- -Isrc/platform/rp2xx0
- -D__PLAT_RP2040__
-# -D _POSIX_THREADS
-build_src_filter =
- ${arduino_base.build_src_filter} - - - - - - - - -
-
-lib_ignore =
- BluetoothOTA
- lvgl
-
-lib_deps =
- ${arduino_base.lib_deps}
- ${environmental_base.lib_deps}
- ${radiolib_base.lib_deps}
- rweather/Crypto
\ No newline at end of file
diff --git a/src/mesh/api/PacketAPI.cpp b/src/mesh/api/PacketAPI.cpp
index 4942fa2ff..ac99d027f 100644
--- a/src/mesh/api/PacketAPI.cpp
+++ b/src/mesh/api/PacketAPI.cpp
@@ -1,3 +1,5 @@
+#ifdef USE_PACKET_API
+
#include "api/PacketAPI.h"
#include "MeshService.h"
#include "RadioInterface.h"
@@ -73,3 +75,5 @@ bool PacketAPI::checkIsConnected()
isConnected |= server->hasData();
return isConnected && server->available();
}
+
+#endif
\ No newline at end of file
diff --git a/variants/rak4631/platformio.ini b/variants/rak4631/platformio.ini
index ced93df66..69560bc8c 100644
--- a/variants/rak4631/platformio.ini
+++ b/variants/rak4631/platformio.ini
@@ -52,4 +52,4 @@ lib_deps =
upload_protocol = stlink
; eventually use platformio/tool-pyocd@^2.3600.0 instad
;upload_protocol = custom
-;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
\ No newline at end of file
+;upload_command = pyocd flash -t nrf52840 $UPLOADERFLAGS $SOURCE
diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini
index f79173842..ac86d938d 100644
--- a/variants/t-deck/platformio.ini
+++ b/variants/t-deck/platformio.ini
@@ -1,19 +1,101 @@
-; LilyGo T-Deck
-[env:t-deck]
-extends = esp32s3_base
-board = t-deck
-board_check = true
-upload_protocol = esptool
-#upload_port = COM29
+// ST7789 TFT LCD
+#define ST7789_CS 12
+#define ST7789_RS 11 // DC
+#define ST7789_SDA 41 // MOSI
+#define ST7789_SCK 40
+#define ST7789_RESET -1
+#define ST7789_MISO 38
+#define ST7789_BUSY -1
+#define ST7789_BL 42
+#define ST7789_SPI_HOST SPI2_HOST
+#define TFT_BL 42
+#define SPI_FREQUENCY 40000000
+#define SPI_READ_FREQUENCY 16000000
+#define TFT_HEIGHT 320
+#define TFT_WIDTH 240
+#define TFT_OFFSET_X 0
+#define TFT_OFFSET_Y 0
+#define TFT_OFFSET_ROTATION 0
+#define SCREEN_ROTATE
+#define SCREEN_TRANSITION_FRAMERATE 5
+#define BRIGHTNESS_DEFAULT 130 // Medium Low Brightness
-build_flags = ${esp32_base.build_flags}
- -DT_DECK
- -DBOARD_HAS_PSRAM
- -DMAX_THREADS=40
- -DGPS_POWER_TOGGLE
- -Ivariants/t-deck
+#define HAS_TOUCHSCREEN 1
+#define SCREEN_TOUCH_INT 16
+#define TOUCH_I2C_PORT 0
+#define TOUCH_SLAVE_ADDRESS 0x5D // GT911
-lib_deps = ${esp32s3_base.lib_deps}
- lovyan03/LovyanGFX@^1.1.9
- earlephilhower/ESP8266Audio@^1.9.9
- earlephilhower/ESP8266SAM@^1.0.1
+#define SLEEP_TIME 120
+
+#define BUTTON_PIN 0
+// #define BUTTON_NEED_PULLUP
+#define GPS_DEFAULT_NOT_PRESENT 1
+#define GPS_RX_PIN 44
+#define GPS_TX_PIN 43
+
+// Have SPI interface SD card slot
+#define HAS_SDCARD 1
+#define SPI_MOSI (41)
+#define SPI_SCK (40)
+#define SPI_MISO (38)
+#define SPI_CS (39)
+#define SDCARD_CS SPI_CS
+
+#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
+// ratio of voltage divider = 2.0 (RD2=100k, RD3=100k)
+#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
+#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
+
+// keyboard
+#define I2C_SDA 18 // I2C pins for this board
+#define I2C_SCL 8
+#define KB_POWERON 10 // must be set to HIGH
+#define KB_SLAVE_ADDRESS TDECK_KB_ADDR // 0x55
+#define KB_BL_PIN 46 // not used for now
+#define CANNED_MESSAGE_MODULE_ENABLE 1
+
+// trackball
+#define HAS_TRACKBALL 1
+#define TB_UP 3
+#define TB_DOWN 15
+#define TB_LEFT 1
+#define TB_RIGHT 2
+#define TB_PRESS BUTTON_PIN
+
+// microphone
+#define ES7210_SCK 47
+#define ES7210_DIN 14
+#define ES7210_LRCK 21
+#define ES7210_MCLK 48
+
+// dac / amp
+#define HAS_I2S
+#define DAC_I2S_BCK 7
+#define DAC_I2S_WS 5
+#define DAC_I2S_DOUT 6
+#define DAC_I2S_MCLK 21 // GPIO lrck mic
+
+// LoRa
+#define USE_SX1262
+#define USE_SX1268
+
+#define LORA_SCK 40
+#define LORA_MISO 38
+#define LORA_MOSI 41
+#define LORA_CS 9
+
+#define LORA_DIO0 -1 // a No connect on the SX1262 module
+#define LORA_RESET 17
+#define LORA_DIO1 45 // SX1262 IRQ
+#define LORA_DIO2 13 // SX1262 BUSY
+#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
+
+#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead
+#define SX126X_DIO1 LORA_DIO1
+#define SX126X_BUSY LORA_DIO2
+#define SX126X_RESET LORA_RESET
+// Not really an E22 but TTGO seems to be trying to clone that
+#define SX126X_DIO2_AS_RF_SWITCH
+#define SX126X_DIO3_TCXO_VOLTAGE 1.8
+// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface
+// code)