diff --git a/bin/build-all.sh b/bin/build-all.sh
index f8eadba91..2c3f1dd92 100755
--- a/bin/build-all.sh
+++ b/bin/build-all.sh
@@ -33,6 +33,7 @@ for COUNTRY in $COUNTRIES; do
export PLATFORMIO_BUILD_FLAGS="$COMMONOPTS"
+ do_build "tbeam0.7"
do_build "ttgo-lora32-v2"
do_build "ttgo-lora32-v1"
do_build "tbeam"
diff --git a/platformio.ini b/platformio.ini
index 0d6e5f9c4..d66f86de3 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -68,11 +68,20 @@ lib_deps =
https://github.com/meshtastic/arduino-fsm.git
https://github.com/meshtastic/SparkFun_Ublox_Arduino_Library.git
+; The 1.0 release of the TBEAM board
[env:tbeam]
board = ttgo-t-beam
lib_deps =
${env.lib_deps}
AXP202X_Library
+build_flags =
+ ${env.build_flags} -D TBEAM_V10
+
+; The original TBEAM board without the AXP power chip and a few other changes
+[env:tbeam0.7]
+board = ttgo-t-beam
+build_flags =
+ ${env.build_flags} -D TBEAM_V07
[env:heltec]
;build_type = debug ; to make it possible to step through our jtag debugger
diff --git a/src/configuration.h b/src/configuration.h
index 12d7a3810..44f627391 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -96,7 +96,7 @@ along with this program. If not, see .
#define MOSI_GPIO 27
#define NSS_GPIO 18
-#if defined(ARDUINO_T_Beam)
+#if defined(TBEAM_V10)
// This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "tbeam"
@@ -117,6 +117,30 @@ along with this program. If not, see .
// Leave undefined to disable our PMU IRQ handler
#define PMU_IRQ 35
+#elif defined(TBEAM_V07)
+// This string must exactly match the case used in release file names or the android updater won't work
+#define HW_VENDOR "tbeam0.7"
+
+// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
+
+#define I2C_SDA 21
+#define I2C_SCL 22
+
+#define BUTTON_PIN 39
+
+#ifndef USE_JTAG
+#define RESET_GPIO 23
+#endif
+#define DIO0_GPIO 26
+#define DIO1_GPIO 33 // Note: not really used on this board
+#define DIO2_GPIO 32 // Note: not really used on this board
+
+// This board has different GPS pins than all other boards
+#undef GPS_RX_PIN
+#undef GPS_TX_PIN
+#define GPS_RX_PIN 12
+#define GPS_TX_PIN 15
+
#elif defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
// This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "heltec"
diff --git a/src/main.cpp b/src/main.cpp
index f1965fbac..794020f75 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,7 +39,7 @@
#include
#include
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
#include "axp20x.h"
AXP20X_Class axp;
bool pmu_irq = false;
@@ -81,7 +81,7 @@ void scanI2Cdevice(void)
ssd1306_found = true;
DEBUG_MSG("ssd1306 display found\n");
}
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
if (addr == AXP192_SLAVE_ADDRESS) {
axp192_found = true;
DEBUG_MSG("axp192 PMU found\n");
@@ -97,7 +97,7 @@ void scanI2Cdevice(void)
DEBUG_MSG("done\n");
}
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
/// Reads power status to powerStatus singleton.
//
// TODO(girts): move this and other axp stuff to power.h/power.cpp.
@@ -110,7 +110,7 @@ void readPowerStatus()
powerStatus.usb = axp.isVBUSPlug();
powerStatus.charging = axp.isChargeing();
}
-#endif // ARDUINO_T_Beam
+#endif // TBEAM_V10
/**
* Init the power manager chip
@@ -123,7 +123,7 @@ void readPowerStatus()
*/
void axp192Init()
{
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
if (axp192_found) {
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
DEBUG_MSG("AXP192 Begin PASS\n");
diff --git a/src/sleep.cpp b/src/sleep.cpp
index 9894e6299..8326f572c 100644
--- a/src/sleep.cpp
+++ b/src/sleep.cpp
@@ -14,7 +14,7 @@
#include
#include
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
#include "axp20x.h"
extern AXP20X_Class axp;
#endif
@@ -48,7 +48,7 @@ void setLed(bool ledOn)
digitalWrite(LED_PIN, ledOn);
#endif
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
if (axp192_found) {
// blink the axp led
axp.setChgLEDMode(ledOn ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
@@ -60,7 +60,7 @@ void setGPSPower(bool on)
{
DEBUG_MSG("Setting GPS power=%d\n", on);
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
if (axp192_found)
axp.setPowerOutPut(AXP192_LDO3, on ? AXP202_ON : AXP202_OFF); // GPS main power
#endif
@@ -124,7 +124,7 @@ void doDeepSleep(uint64_t msecToWake)
setLed(false);
-#ifdef ARDUINO_T_Beam
+#ifdef TBEAM_V10
if (axp192_found) {
// No need to turn this off if the power draw in sleep mode really is just 0.2uA and turning it off would
// leave floating input for the IRQ line
@@ -159,8 +159,9 @@ void doDeepSleep(uint64_t msecToWake)
/* 14, */ /* 15, */
#endif
/* 25, */ 26, /* 27, */
- 32, 33, 34, 35, 36, 37,
- /* 38, */ 39};
+ 32, 33, 34, 35,
+ 36, 37
+ /* 38, 39 */};
for (int i = 0; i < sizeof(rtcGpios); i++)
rtc_gpio_isolate((gpio_num_t)rtcGpios[i]);