clean up configuration.h and add support for ttgo-lora-v1 boards

This commit is contained in:
geeksville 2020-03-27 16:55:19 -07:00
parent d1387be015
commit cf2aa37635
3 changed files with 53 additions and 22 deletions

View File

@ -15,6 +15,7 @@ ARCHIVEDIR=release/archive
rm -f $OUTDIR/firmware*
# build the named environment and copy the bins to the release directory
function do_build {
ENV_NAME=$1
echo "Building for $ENV_NAME with $PLATFORMIO_BUILD_FLAGS"
@ -33,6 +34,7 @@ for COUNTRY in $COUNTRIES; do
export PLATFORMIO_BUILD_FLAGS="$COMMONOPTS"
do_build "ttgo-lora32-v1"
do_build "tbeam"
do_build "heltec"
done

View File

@ -17,8 +17,6 @@ hw_version = US
[env]
platform = espressif32
; board = ttgo-t-beam
; board = heltec_wifi_lora_32_V2
framework = arduino
; customize the partition table
@ -79,3 +77,10 @@ lib_deps =
[env:heltec]
;build_type = debug ; to make it possible to step through our jtag debugger
board = heltec_wifi_lora_32_V2
[env:ttgo-lora32-v1]
board = ttgo-lora32-v1
; note: the platformio definition for lora32-v2 seems stale, it is missing a pins_arduino.h file, therefore I don't think it works
; [env:ttgo-lora32-v2]
; board = ttgo-lora32-v2

View File

@ -39,16 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Configuration
// -----------------------------------------------------------------------------
// Select which board is being used. If the outside build environment has sent a choice, just use that
#if !defined(ARDUINO_T_Beam) && !defined(ARDUINO_HELTEC_WIFI_LORA_32_V2)
// The platformio build environment should set this now
// #define ARDUINO_T_Beam // AKA Rev1 (second board released)
// #define ARDUINO_HELTEC_WIFI_LORA_32_V2
#define HW_VERSION_US // We encode the hardware freq range in the hw version string, so sw update can eventually install the
// correct build
#endif
// If we are using the JTAG port for debugging, some pins must be left free for that (and things like GPS have to be disabled)
// we don't support jtag on the ttgo - access to gpio 12 is a PITA
#ifdef ARDUINO_HELTEC_WIFI_LORA_32_V2
@ -108,7 +98,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#if defined(ARDUINO_T_Beam)
// This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "TBEAM"
#define HW_VENDOR "tbeam"
// #define BUTTON_NEED_PULLUP // if set we need to turn on the internal CPU pullup during sleep
@ -129,25 +119,59 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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"
#define HW_VENDOR "heltec"
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4
#ifndef USE_JTAG // gpio15 is TDO for JTAG, so no I2C on this board while doing jtag
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#endif
#define RESET_OLED 16
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 25
#define BUTTON_PIN 0
#define LED_PIN 25 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#ifndef USE_JTAG
#define RESET_GPIO 14
#define RESET_GPIO 14 // If defined, this pin will be used to reset the LORA radio
#endif
#define DIO0_GPIO 26
#define DIO1_GPIO 35
#define DIO2_GPIO 34
#define DIO1_GPIO 35 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#define DIO2_GPIO 34 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#elif defined(ARDUINO_TTGO_LoRa32_V1)
// This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "ttgo-lora32-v1"
#define I2C_SDA 4 // I2C pins for this board
#define I2C_SCL 15
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
// #define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 2 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define RESET_GPIO 23 // If defined, this pin will be used to reset the LORA radio
#define DIO0_GPIO 26 // IRQ line for the LORA radio
#define DIO1_GPIO 35 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#define DIO2_GPIO 34 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#elif defined(ARDUINO_TTGO_LoRa32_V2)
// This string must exactly match the case used in release file names or the android updater won't work
#define HW_VENDOR "ttgo-lora32-v2"
#define I2C_SDA 21 // I2C pins for this board
#define I2C_SCL 22
#define RESET_OLED 16 // If defined, this pin will be used to reset the display controller
#define VEXT_ENABLE 21 // active low, powers the oled display and the lora antenna boost
#define LED_PIN 2 // If defined we will blink this LED
#define BUTTON_PIN 0 // If defined, this will be used for user button presses
#define RESET_GPIO 23 // If defined, this pin will be used to reset the LORA radio
#define DIO0_GPIO 26 // IRQ line for the LORA radio
#define DIO1_GPIO 35 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#define DIO2_GPIO 34 // DIO1 & DIO2 are not currently used, but they must be assigned to a pin number
#endif
// -----------------------------------------------------------------------------