tidied up, prob broke everything

This commit is contained in:
Gareth Coleman 2024-04-22 16:37:05 +01:00
parent ec2b854ea2
commit 6669b22db3
17 changed files with 67 additions and 43 deletions

View File

@ -29,10 +29,7 @@ const uint32_t g_ADigitalPinMap[] = {
void initVariant() void initVariant()
{ {
// LED1 & LED2 // LED1
pinMode(PIN_LED1, OUTPUT); pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1); ledOff(PIN_LED1);
pinMode(PIN_LED2, OUTPUT);
ledOff(PIN_LED2);
} }

View File

@ -43,24 +43,13 @@ extern "C" {
#define NUM_ANALOG_OUTPUTS (0) #define NUM_ANALOG_OUTPUTS (0)
// LEDs // LEDs
#define PIN_LED1 (0 + 12) // Blue LED P1.12 #define PIN_LED1 (0 + 6) // Built in Green P0.06
#define PIN_LED2 (0 + 6) // Built in Green P0.06 #define RGBLED_RED (0 + 8) // Red of RGB P0.08
#define RGBLED_GREEN (32 + 9) // Green of RGB P1.09
// Green Built in LED1 #define RGBLED_BLUE (0 + 12) // Blue of RGB P0.12
// #define PIN_LED1 (0 + 6) // LED1 P1.15 #define RGBLED_CA // comment out this line if you have a common cathode type, as defined use common anode logic
// RGB NeoPixel LED2
// #define PIN_LED1 (0 + 8) Red
// #define PIN_LED1 (32 + 9) Green
// #define PIN_LED1 (0 + 12) Blue
#define LED_BUILTIN PIN_LED1 #define LED_BUILTIN PIN_LED1
#define LED_CONN PIN_LED2
#define LED_GREEN PIN_LED1
#define LED_BLUE PIN_LED2
#define LED_STATE_ON 0 // State when LED is litted
/* /*
* Buttons * Buttons

View File

@ -15,4 +15,4 @@ upload_protocol = esptool
upload_speed = 460800 upload_speed = 460800
lib_deps = lib_deps =
${esp32_base.lib_deps} ${esp32_base.lib_deps}
makuna/NeoPixelBus@^2.7.1 adafruit/Adafruit NeoPixel @ ^1.12.0

View File

@ -1,5 +1,4 @@
// https://betafpv.com/products/elrs-micro-tx-module // https://betafpv.com/products/elrs-micro-tx-module
#include <NeoPixelBus.h>
// 0.96" OLED // 0.96" OLED
#define I2C_SDA 22 #define I2C_SDA 22
@ -15,7 +14,11 @@
#define LORA_CS 5 #define LORA_CS 5
#define RF95_FAN_EN 17 #define RF95_FAN_EN 17
#define LED_PIN 16 // This is a LED_WS2812 not a standard LED // #define LED_PIN 16 // This is a LED_WS2812 not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 16 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 25 #define BUTTON_PIN 25
#define BUTTON_NEED_PULLUP #define BUTTON_NEED_PULLUP

View File

@ -22,4 +22,4 @@ build_flags = ${esp32_base.build_flags}
lib_deps = ${esp32s3_base.lib_deps} lib_deps = ${esp32s3_base.lib_deps}
zinggjm/GxEPD2@^1.5.3 zinggjm/GxEPD2@^1.5.3
;adafruit/Adafruit NeoPixel@^1.10.7 adafruit/Adafruit NeoPixel @ ^1.12.0

View File

@ -10,6 +10,10 @@
// #define LED_PIN PIN_LED // #define LED_PIN PIN_LED
// Board has RGB LED 21 // Board has RGB LED 21
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 21 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
// The usbPower state is revered ? // The usbPower state is revered ?
// DEBUG | ??:??:?? 365 [Power] Battery: usbPower=0, isCharging=0, batMv=4116, batPct=90 // DEBUG | ??:??:?? 365 [Power] Battery: usbPower=0, isCharging=0, batMv=4116, batPct=90

View File

@ -21,3 +21,4 @@ lib_deps =
${nrf52840_base.lib_deps} ${nrf52840_base.lib_deps}
sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0 sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0
bodmer/TFT_eSPI@^2.4.76 bodmer/TFT_eSPI@^2.4.76
adafruit/Adafruit NeoPixel @ ^1.12.0

View File

@ -44,15 +44,19 @@ extern "C" {
// LEDs // LEDs
#define PIN_LED1 (3) #define PIN_LED1 (3)
#define PIN_LED2 (4) #define PIN_LED2 (4)
#define PIN_NEOPIXEL (8) // #define PIN_NEOPIXEL (8)
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 8 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define LED_BUILTIN PIN_LED1 #define LED_BUILTIN PIN_LED1
#define LED_CONN PIN_LED2 #define PIN_LED2
#define LED_RED PIN_LED1 #define LED_RED PIN_LED1
#define LED_BLUE PIN_LED2 #define LED_BLUE PIN_LED2
#define LED_STATE_ON 1 // State when LED is litted #define 1 // State when LED is litted
/* /*
* Buttons * Buttons

View File

@ -23,3 +23,4 @@ lib_deps =
${nrf52840_base.lib_deps} ${nrf52840_base.lib_deps}
sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0 sparkfun/SparkFun BQ27441 LiPo Fuel Gauge Arduino Library@^1.1.0
bodmer/TFT_eSPI@^2.4.76 bodmer/TFT_eSPI@^2.4.76
adafruit/Adafruit NeoPixel @ ^1.12.0

View File

@ -61,16 +61,21 @@ extern "C" {
// LEDs // LEDs
#define PIN_LED1 (3) #define PIN_LED1 (3)
#define PIN_LED2 (4) #define PIN_LED2 (4)
#define PIN_NEOPIXEL (8) // #define PIN_NEOPIXEL (8)
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 8 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define PIN_BUZZER (40) #define PIN_BUZZER (40)
#define LED_BUILTIN PIN_LED1 #define LED_BUILTIN PIN_LED1
#define LED_CONN PIN_LED2 #define PIN_LED2
#define LED_RED PIN_LED1 #define LED_RED PIN_LED1
#define LED_BLUE PIN_LED2 #define LED_BLUE PIN_LED2
#define LED_STATE_ON 1 // State when LED is litted #define 1 // State when LED is litted
/* /*
* Buttons * Buttons

View File

@ -13,7 +13,7 @@ platform_packages =
lib_deps = lib_deps =
${esp32_base.lib_deps} ${esp32_base.lib_deps}
zinggjm/GxEPD2@^1.5.1 zinggjm/GxEPD2@^1.5.1
adafruit/Adafruit NeoPixel@^1.10.7 adafruit/Adafruit NeoPixel @ ^1.12.0
build_unflags = -DARDUINO_USB_MODE=1 build_unflags = -DARDUINO_USB_MODE=1
build_flags = build_flags =
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink ;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_eink

View File

@ -12,6 +12,10 @@
#define I2C_SCL 17 // 2 #define I2C_SCL 17 // 2
// #define LED_PIN 38 // This is a RGB LED not a standard LED // #define LED_PIN 38 // This is a RGB LED not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // This is the BOOT button #define BUTTON_PIN 0 // This is the BOOT button
#define BUTTON_NEED_PULLUP #define BUTTON_NEED_PULLUP

View File

@ -12,7 +12,7 @@ platform_packages =
tool-esptoolpy@^1.40500.0 tool-esptoolpy@^1.40500.0
lib_deps = lib_deps =
${esp32_base.lib_deps} ${esp32_base.lib_deps}
adafruit/Adafruit NeoPixel@^1.10.7 adafruit/Adafruit NeoPixel @ ^1.12.0
build_unflags = -DARDUINO_USB_MODE=1 build_unflags = -DARDUINO_USB_MODE=1
build_flags = build_flags =
;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled ;${esp32_base.build_flags} -D MY_ESP32S3_DIY -I variants/my_esp32s3_diy_oled

View File

@ -12,6 +12,10 @@
#define I2C_SCL 17 // 2 #define I2C_SCL 17 // 2
// #define LED_PIN 38 // This is a RGB LED not a standard LED // #define LED_PIN 38 // This is a RGB LED not a standard LED
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA 38 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
#define BUTTON_PIN 0 // This is the BOOT button #define BUTTON_PIN 0 // This is the BOOT button
#define BUTTON_NEED_PULLUP #define BUTTON_NEED_PULLUP

View File

@ -13,6 +13,7 @@ build_unflags =
-D ARDUINO_USB_MODE -D ARDUINO_USB_MODE
build_flags = ${esp32_base.build_flags} build_flags = ${esp32_base.build_flags}
-D BOARD_HAS_PSRAM
-D UNPHONE -D UNPHONE
-I variants/unphone -I variants/unphone
-D ARDUINO_USB_MODE=0 -D ARDUINO_USB_MODE=0
@ -28,3 +29,4 @@ build_src_filter = ${esp32_base.build_src_filter} +<../variants/unphone>
lib_deps = ${esp32s3_base.lib_deps} lib_deps = ${esp32s3_base.lib_deps}
lovyan03/LovyanGFX @ ^1.1.8 lovyan03/LovyanGFX @ ^1.1.8
https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic @ ^9.0.0 https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic @ ^9.0.0
adafruit/Adafruit NeoPixel @ ^1.12.0

View File

@ -10,6 +10,7 @@ void initVariant()
unphone.printWakeupReason(); // what woke us up? (stored, not printed :|) unphone.printWakeupReason(); // what woke us up? (stored, not printed :|)
unphone.checkPowerSwitch(); // if power switch is off, shutdown unphone.checkPowerSwitch(); // if power switch is off, shutdown
unphone.backlight(false); // setup backlight and make sure its off unphone.backlight(false); // setup backlight and make sure its off
unphone.expanderPower(true); // enable power to expander / hat / sheild
for (int i = 0; i < 3; i++) { // buzz a bit for (int i = 0; i < 3; i++) { // buzz a bit
unphone.vibe(true); unphone.vibe(true);

View File

@ -1,7 +1,16 @@
// meshtastic/firmware/variants/unphone/variant.h // meshtastic/firmware/variants/unphone/variant.h
#pragma once #pragma once
// RGB LED configuration
#define HAS_NEOPIXEL // Enable the use of neopixels
#define NEOPIXEL_COUNT 1 // How many neopixels are connected
#define NEOPIXEL_DATA A0 // gpio pin used to send data to the neopixels
#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
#define SPI_SCK 39 #define SPI_SCK 39
#define SPI_MOSI 40 #define SPI_MOSI 40
#define SPI_MISO 41 #define SPI_MISO 41
@ -38,7 +47,7 @@
#define SCREEN_TRANSITION_FRAMERATE 5 #define SCREEN_TRANSITION_FRAMERATE 5
#define HAS_TOUCHSCREEN 1 #define HAS_TOUCHSCREEN 1
#define USE_XPT2046 1 #define USE_XPT2046
#define TOUCH_CS 38 #define TOUCH_CS 38
#define HAS_GPS \ #define HAS_GPS \