Fix openCom XL compilation

This commit is contained in:
jacob.eva 2024-10-16 21:24:18 +01:00
parent 17ff4b0496
commit 18780131d8
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
5 changed files with 14 additions and 12 deletions

View File

@ -94,7 +94,7 @@ void busyCallback(const void* p) {
#define SCL_OLED 17 #define SCL_OLED 17
#define SDA_OLED 18 #define SDA_OLED 18
#endif #endif
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
#if DISPLAY == OLED #if DISPLAY == OLED
// RAK1921/SSD1306 // RAK1921/SSD1306
#define DISP_RST -1 #define DISP_RST -1
@ -135,7 +135,7 @@ void busyCallback(const void* p) {
#include "Graphics.h" #include "Graphics.h"
#if BOARD_MODEL == BOARD_RAK4631 #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
#if DISPLAY == EINK_BW #if DISPLAY == EINK_BW
GxEPD2_BW<DISPLAY_MODEL, DISPLAY_MODEL::HEIGHT> display(DISPLAY_MODEL(pin_disp_cs, pin_disp_dc, pin_disp_reset, pin_disp_busy)); GxEPD2_BW<DISPLAY_MODEL, DISPLAY_MODEL::HEIGHT> display(DISPLAY_MODEL(pin_disp_cs, pin_disp_dc, pin_disp_reset, pin_disp_busy));
float disp_target_fps = 0.2; float disp_target_fps = 0.2;
@ -316,7 +316,7 @@ bool display_init() {
// waiting for the display to update, it will poll the serial buffer to // waiting for the display to update, it will poll the serial buffer to
// check for any commands from the host. // check for any commands from the host.
display.epd2.setBusyCallback(busyCallback); display.epd2.setBusyCallback(busyCallback);
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
#if DISPLAY == OLED #if DISPLAY == OLED
#elif DISPLAY == EINK_BW || DISPLAY == EINK_3C #elif DISPLAY == EINK_BW || DISPLAY == EINK_3C
pinMode(pin_disp_en, INPUT_PULLUP); pinMode(pin_disp_en, INPUT_PULLUP);
@ -386,7 +386,7 @@ bool display_init() {
#elif BOARD_MODEL == BOARD_HELTEC32_V2 #elif BOARD_MODEL == BOARD_HELTEC32_V2
disp_mode = DISP_MODE_PORTRAIT; disp_mode = DISP_MODE_PORTRAIT;
display.setRotation(1); display.setRotation(1);
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
#if DISPLAY == OLED #if DISPLAY == OLED
#elif DISPLAY == EINK_BW || DISPLAY == EINK_3C #elif DISPLAY == EINK_BW || DISPLAY == EINK_3C
disp_mode = DISP_MODE_PORTRAIT; disp_mode = DISP_MODE_PORTRAIT;
@ -397,7 +397,7 @@ bool display_init() {
#elif BOARD_MODEL == BOARD_HELTEC32_V3 #elif BOARD_MODEL == BOARD_HELTEC32_V3
disp_mode = DISP_MODE_PORTRAIT; disp_mode = DISP_MODE_PORTRAIT;
display.setRotation(1); display.setRotation(1);
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
disp_mode = DISP_MODE_LANDSCAPE; disp_mode = DISP_MODE_LANDSCAPE;
display.setRotation(0); display.setRotation(0);
#elif BOARD_MODEL == BOARD_TDECK #elif BOARD_MODEL == BOARD_TDECK

View File

@ -62,7 +62,7 @@
bool bat_voltage_dropping = false; bool bat_voltage_dropping = false;
float bat_delay_v = 0; float bat_delay_v = 0;
float bat_state_change_v = 0; float bat_state_change_v = 0;
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
#include "nrfx_power.h" #include "nrfx_power.h"
#define BAT_C_SAMPLES 7 #define BAT_C_SAMPLES 7
#define BAT_D_SAMPLES 2 #define BAT_D_SAMPLES 2
@ -291,7 +291,7 @@ void measure_battery() {
battery_ready = false; battery_ready = false;
} }
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
battery_installed = true; battery_installed = true;
battery_indeterminate = false; battery_indeterminate = false;

View File

@ -19,7 +19,7 @@
#if MCU_VARIANT == MCU_NRF52 #if MCU_VARIANT == MCU_NRF52
#define INTERFACE_SPI #define INTERFACE_SPI
#if BOARD_MODEL == BOARD_RAK4631 #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
// Required because on RAK4631, non-default SPI pins must be initialised when class is declared. // Required because on RAK4631, non-default SPI pins must be initialised when class is declared.
SPIClass interface_spi[1] = { SPIClass interface_spi[1] = {
// SX1262 // SX1262

View File

@ -740,7 +740,7 @@ void sx126x::sleep()
void sx126x::enableTCXO() { void sx126x::enableTCXO() {
if (_tcxo) { if (_tcxo) {
#if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_HELTEC32_V3 #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL || BOARD_MODEL == BOARD_HELTEC32_V3
uint8_t buf[4] = {MODE_TCXO_3_3V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_3_3V_6X, 0x00, 0x00, 0xFF};
#elif BOARD_MODEL == BOARD_TBEAM #elif BOARD_MODEL == BOARD_TBEAM
uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF};
@ -2240,7 +2240,7 @@ void sx128x::disableTCXO() {
void sx128x::setTxPower(int level, int outputPin) { void sx128x::setTxPower(int level, int outputPin) {
uint8_t tx_buf[2]; uint8_t tx_buf[2];
#if BOARD_VARIANT == MODEL_13 #if BOARD_VARIANT == MODEL_13 || BOARD_VARIANT == MODEL_21
// RAK4631 with WisBlock SX1280 module (LIBSYS002) // RAK4631 with WisBlock SX1280 module (LIBSYS002)
if (level > 27) { if (level > 27) {
level = 27; level = 27;

View File

@ -236,7 +236,7 @@ uint8_t boot_vector = 0x00;
void led_tx_off() { digitalWrite(pin_led_tx, LOW); } void led_tx_off() { digitalWrite(pin_led_tx, LOW); }
#endif #endif
#elif MCU_VARIANT == MCU_NRF52 #elif MCU_VARIANT == MCU_NRF52
#if BOARD_MODEL == BOARD_RAK4631 #if BOARD_MODEL == BOARD_RAK4631 || BOARD_MODEL == BOARD_OPENCOM_XL
void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } void led_rx_on() { digitalWrite(pin_led_rx, HIGH); }
void led_rx_off() { digitalWrite(pin_led_rx, LOW); } void led_rx_off() { digitalWrite(pin_led_rx, LOW); }
void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } void led_tx_on() { digitalWrite(pin_led_tx, HIGH); }
@ -1427,7 +1427,9 @@ bool eeprom_model_valid() {
#elif BOARD_MODEL == BOARD_HELTEC32_V3 #elif BOARD_MODEL == BOARD_HELTEC32_V3
if (model == MODEL_C5 || model == MODEL_CA) { if (model == MODEL_C5 || model == MODEL_CA) {
#elif BOARD_MODEL == BOARD_RAK4631 #elif BOARD_MODEL == BOARD_RAK4631
if (model == MODEL_11 || model == MODEL_12 || model == MODEL_13 || model == MODEL_14 || model == MODEL_21) { if (model == MODEL_11 || model == MODEL_12 || model == MODEL_13 || model == MODEL_14) {
#elif BOARD_MODEL == BOARD_OPENCOM_XL
if (model == MODEL_21) {
#elif BOARD_MODEL == BOARD_HUZZAH32 #elif BOARD_MODEL == BOARD_HUZZAH32
if (model == MODEL_FF) { if (model == MODEL_FF) {
#elif BOARD_MODEL == BOARD_HMBRW #elif BOARD_MODEL == BOARD_HMBRW