manual merge of changes from Master

This commit is contained in:
Thomas Göttgens 2022-11-04 19:56:44 +01:00
parent 20686cc66a
commit 09cdc20440
6 changed files with 133 additions and 17 deletions

View File

@ -37,7 +37,7 @@
#include "nimble/NimbleBluetooth.h" #include "nimble/NimbleBluetooth.h"
#endif #endif
#if HAS_WIFI || defined(ARCH_PORTDUINO) #if HAS_WIFI
#include "mesh/wifi/WiFiServerAPI.h" #include "mesh/wifi/WiFiServerAPI.h"
#include "mqtt/MQTT.h" #include "mqtt/MQTT.h"
#endif #endif
@ -293,6 +293,10 @@ void setup()
* Boards with an PMU need to be powered on to correctly scan to the device address, such as t-beam-s3-core * Boards with an PMU need to be powered on to correctly scan to the device address, such as t-beam-s3-core
*/ */
scanI2Cdevice(); scanI2Cdevice();
// fixed screen override?
if (config.display.oled != Config_DisplayConfig_OledType_OLED_AUTO)
screen_model = config.display.oled;
// Init our SPI controller (must be before screen and lora) // Init our SPI controller (must be before screen and lora)
initSPI(); initSPI();

View File

@ -29,8 +29,8 @@ bool FloodingRouter::shouldFilterReceived(MeshPacket *p)
void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c) void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c)
{ {
PacketId ackId = ((c && c->error_reason == Routing_Error_NONE) || !c) ? p->decoded.request_id : 0; bool isAck = ((c && c->error_reason == Routing_Error_NONE)); // consider only ROUTING_APP message without error as ACK
if (ackId && p->to != getNodeNum()) { if (isAck && p->to != getNodeNum()) {
// do not flood direct message that is ACKed // do not flood direct message that is ACKed
DEBUG_MSG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n"); DEBUG_MSG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n");
Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM

View File

@ -116,9 +116,6 @@ ExternalNotificationModule::ExternalNotificationModule()
: SinglePortModule("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread( : SinglePortModule("ExternalNotificationModule", PortNum_TEXT_MESSAGE_APP), concurrency::OSThread(
"ExternalNotificationModule") "ExternalNotificationModule")
{ {
// restrict to the admin channel for rx
boundChannel = Channels::gpioChannel;
/* /*
Uncomment the preferences below if you want to use the module Uncomment the preferences below if you want to use the module
without having to configure it from the PythonAPI or WebUI. without having to configure it from the PythonAPI or WebUI.
@ -131,6 +128,11 @@ ExternalNotificationModule::ExternalNotificationModule()
// moduleConfig.external_notification.alert_bell = 1; // moduleConfig.external_notification.alert_bell = 1;
// moduleConfig.external_notification.output_ms = 1000; // moduleConfig.external_notification.output_ms = 1000;
// moduleConfig.external_notification.output = 13; // moduleConfig.external_notification.output = 13;
if (moduleConfig.external_notification.alert_message) {
// restrict to the gpio channel for rx
boundChannel = Channels::gpioChannel;
}
if (moduleConfig.external_notification.enabled) { if (moduleConfig.external_notification.enabled) {

View File

@ -2,7 +2,7 @@
[env:feather_diy] [env:feather_diy]
extends = nrf52840_base extends = nrf52840_base
board = adafruit_feather_nrf52840 board = adafruit_feather_nrf52840
build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -D feather_diy build_flags = ${nrf52840_base.build_flags} -Ivariants/feather_diy -Dfeather_diy
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy> build_src_filter = ${nrf52_base.build_src_filter} +<../variants/feather_diy>
lib_deps = lib_deps =
${nrf52840_base.lib_deps} ${nrf52840_base.lib_deps}

View File

@ -0,0 +1,24 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
#include "nrf.h"
#include "wiring_constants.h"
#include "wiring_digital.h"

View File

@ -1,19 +1,95 @@
// For OLED LCD /*
#define I2C_SDA 22 Copyright (c) 2014-2015 Arduino LLC. All right reserved.
#define I2C_SCL 23 Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2018, Adafruit Industries (adafruit.com)
#define BUTTON_PIN 7 This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_FEATHER_DIY_
#define _VARIANT_FEATHER_DIY_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
#define USE_LFXO // Board uses 32khz crystal for LF
// define USE_LFRC // Board uses RC for LF
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Number of pins defined in PinDescription array
#define PINS_COUNT (48)
#define NUM_DIGITAL_PINS (48)
#define NUM_ANALOG_INPUTS (6)
#define NUM_ANALOG_OUTPUTS (0)
#define WIRE_INTERFACES_COUNT 1
#define PIN_WIRE_SDA (0 + 12) //P0.12 22
#define PIN_WIRE_SCL (0 + 11) //P0.12 23
#define PIN_LED1 (32 + 15) //P1.15 3
#define PIN_LED2 (32 + 10) //P1.10 4
#define LED_BUILTIN PIN_LED1
#define LED_GREEN PIN_LED2 // Actually red
#define LED_BLUE PIN_LED1
#define LED_STATE_ON 1 // State when LED is litted
#define BUTTON_PIN (32 + 2) //P1.02 7
/*
* Serial interfaces
*/
#define PIN_SERIAL1_RX (0 + 24) //P0.24 1
#define PIN_SERIAL1_TX (0 + 25) //P0.25 0
#define PIN_SERIAL2_RX (-1)
#define PIN_SERIAL2_TX (-1)
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (0 + 15) //P0.15 24
#define PIN_SPI_MOSI (0 + 13) //P0.13 25
#define PIN_SPI_SCK (0 + 14) //P0.14 26
#define SS 2
#define LORA_DIO0 -1 // a No connect on the SX1262/SX1268 module #define LORA_DIO0 -1 // a No connect on the SX1262/SX1268 module
#define LORA_RESET 13 // RST for SX1276, and for SX1262/SX1268 #define LORA_RESET (32 + 9) //P1.09 13 // RST for SX1276, and for SX1262/SX1268
#define LORA_DIO1 11 // IRQ for SX1262/SX1268 #define LORA_DIO1 (0 + 6) //P0.06 11 // IRQ for SX1262/SX1268
#define LORA_DIO2 12 // BUSY for SX1262/SX1268 #define LORA_DIO2 (0 + 8) //P0.08 12 // BUSY for SX1262/SX1268
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled #define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262/SX1268, if DIO3 is high the TXCO is enabled
#define RF95_SCK SCK #define RF95_SCK SCK
#define RF95_MISO MI #define RF95_MISO MI
#define RF95_MOSI MO #define RF95_MOSI MO
#define RF95_NSS D2 #define RF95_NSS SS
// enables 3.3V periphery like GPS or IO Module
#define PIN_3V3_EN (-1)
#undef USE_EINK
// supported modules list // supported modules list
#define USE_SX1262 #define USE_SX1262
@ -23,11 +99,21 @@
#define SX126X_DIO1 LORA_DIO1 #define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2 #define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET #define SX126X_RESET LORA_RESET
#define SX126X_RXEN 10 #define SX126X_RXEN (0 + 27) //P0.27 10
#define SX126X_TXEN 9 #define SX126X_TXEN (0 + 26) //P0.26 9
#ifdef EBYTE_E22 #ifdef EBYTE_E22
// Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch // Internally the TTGO module hooks the SX126x-DIO2 in to control the TX/RX switch
// (which is the default for the sx1262interface code) // (which is the default for the sx1262interface code)
#define SX126X_E22 #define SX126X_E22
#endif #endif
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif