Compare commits

..

58 Commits

Author SHA1 Message Date
Thomas Göttgens
b97ca2c834 Merge branch 'master' into apollo 2024-11-24 15:53:58 +01:00
Thomas Göttgens
b78978156e Merge branch 'master' into apollo 2024-11-11 16:06:48 +01:00
Thomas Göttgens
6860717c68 fix RP2040 builds 2024-11-03 15:08:01 +01:00
Thomas Göttgens
7d9b2ef3c4 Merge branch 'master' into apollo 2024-11-02 16:44:21 +01:00
Thomas Göttgens
7a3f30f99e Merge branch 'master' into apollo 2024-10-26 12:21:55 +02:00
Thomas Göttgens
02e258d5e9 Merge branch 'master' into apollo 2024-10-16 12:38:14 +02:00
Thomas Göttgens
19bcb60120 woopsie 2024-10-08 13:53:51 +02:00
Thomas Göttgens
f0c97b8806 Merge branch 'master' into apollo
# Conflicts:
#	arch/esp32/esp32.ini
#	arch/nrf52/nrf52.ini
#	arch/portduino/portduino.ini
#	arch/stm32/stm32.ini
#	protobufs
#	src/gps/GPS.cpp
#	src/main.cpp
#	src/mesh/StreamAPI.cpp
#	src/modules/ExternalNotificationModule.h
#	src/modules/NeighborInfoModule.cpp
2024-10-08 13:45:56 +02:00
Thomas Göttgens
047b8a587d Merge branch 'master' into apollo 2024-09-04 14:39:57 +02:00
Thomas Göttgens
c1a493fb35 update apollo toolchain 2024-09-02 17:16:51 +02:00
Thomas Göttgens
0e93470e34 Merge remote-tracking branch 'remotes/origin/master' into apollo 2024-09-02 17:00:03 +02:00
Thomas Göttgens
074ccbaa0c Merge branch 'master' into apollo 2024-06-19 21:38:29 +02:00
Andrew Litt
3765b9f3af Get apollo3 building again (#4141) 2024-06-19 11:22:35 -05:00
Thomas Göttgens
652441fcc0 Merge branch 'master' into apollo 2024-06-16 11:54:32 +02:00
Thomas Göttgens
688385fd75 Merge branch 'master' into apollo 2024-06-13 22:22:58 +02:00
Thomas Göttgens
f2116a06a7 Merge branch 'master' into apollo 2024-05-27 08:42:25 +02:00
Thomas Göttgens
7cbf66949b Merge branch 'master' into apollo 2024-05-18 15:36:50 +02:00
Thomas Göttgens
ed9bdf0e05 Merge branch 'master' into apollo 2024-05-17 11:49:28 +02:00
Thomas Göttgens
011cff2fe1 Merge branch 'master' into apollo 2024-04-23 13:01:08 +02:00
Thomas Göttgens
f50f61a52d Merge branch 'master' into apollo 2024-03-28 15:29:55 +01:00
Thomas Göttgens
72664b04f1 add FS macro guards 2024-03-18 15:09:23 +01:00
Thomas Göttgens
9be3b7bdc5 make apollo decent again 2024-03-18 15:02:23 +01:00
Thomas Göttgens
93d7f24d74 Merge branch 'master' into apollo 2024-03-18 12:03:44 +01:00
Thomas Göttgens
a7c0109349 trunk fmt 2024-03-08 13:22:06 +01:00
Thomas Göttgens
a9fc31c026 Merge branch 'master' into apollo 2024-03-05 10:09:45 +01:00
Thomas Göttgens
4996e2aace Merge branch 'master' into apollo 2024-02-23 11:03:38 +01:00
Ben Meadors
b2a313780f Merge branch 'master' into apollo 2023-12-12 17:39:18 -06:00
Thomas Göttgens
55a75d2f58 Making progress with OSFS, still WIP 2023-12-08 15:38:50 +01:00
Thomas Göttgens
dcae45d287 Merge remote-tracking branch 'remotes/origin/master' into apollo
# Conflicts:
#	arch/nrf52/nrf52.ini
#	arch/portduino/portduino.ini
#	arch/rp2040/rp2040.ini
#	arch/stm32/stm32wl5e.ini
2023-12-04 09:02:48 +01:00
Thomas Göttgens
7d5716d3af trunk fmt 2023-12-01 21:25:24 +01:00
Thomas Göttgens
81a783291d Merge branch 'master' into apollo 2023-12-01 18:28:00 +01:00
Thomas Göttgens
47b522fae4 Merge branch 'master' into apollo 2023-11-16 15:09:26 +01:00
Thomas Göttgens
c29b49f320 Merge branch 'master' into apollo 2023-10-31 14:10:07 +01:00
Thomas Göttgens
71645c029f Merge branch 'master' into apollo 2023-09-28 09:30:09 +02:00
Ben Meadors
acbbc95ebf Merge branch 'master' into apollo 2023-08-31 08:31:26 -05:00
Thomas Göttgens
a7bf7f47b5 trunk fmt 2023-08-17 12:24:43 +02:00
Thomas Göttgens
2b074e60d9 Merge branch 'master' into apollo 2023-08-17 10:06:19 +02:00
Ben Meadors
c31476d3e8 Merge branch 'master' into apollo 2023-08-08 06:27:45 -05:00
Ben Meadors
b6b52d89df Merge branch 'master' into apollo 2023-07-31 18:58:53 -05:00
Thomas Göttgens
534845450b Merge branch 'apollo' of github.com:meshtastic/firmware into apollo 2023-07-31 22:44:56 +02:00
Thomas Göttgens
7e2d729434 revert overcommit 2023-07-31 22:44:43 +02:00
Thomas Göttgens
de21b31ab0 Merge branch 'master' into apollo 2023-07-31 22:41:44 +02:00
Thomas Göttgens
db9cb3325f Merge branch 'apollo' of github.com:meshtastic/firmware into apollo 2023-07-31 22:35:39 +02:00
Thomas Göttgens
b8965d27bb Apollo3 WIP 2023-07-31 22:30:53 +02:00
Thomas Göttgens
72b1fa3889 Merge branch 'master' into apollo 2023-07-31 22:18:02 +02:00
Ben Meadors
ed432749e2 Merge branch 'master' into apollo 2023-07-30 07:54:27 -05:00
Thomas Göttgens
1369630292 Merge branch 'master' into apollo 2023-07-24 10:59:50 +02:00
Thomas Göttgens
b467ee09b8 Merge branch 'master' into apollo 2023-07-01 12:32:11 +02:00
Ben Meadors
8e088df363 Merge branch 'master' into apollo 2023-06-25 08:17:54 -05:00
Thomas Göttgens
9a79d34bce Merge branch 'master' into apollo 2023-06-12 15:33:20 +02:00
Thomas Göttgens
784381bae8 Merge branch 'master' into apollo 2023-05-10 17:12:50 +02:00
Thomas Göttgens
f826a85b0a Merge branch 'master' into apollo 2023-05-08 10:32:16 +02:00
Thomas Göttgens
a54ad6ba75 update apollo platform files and exclude from building other platforms 2023-04-24 17:09:47 +02:00
Thomas Göttgens
4b053ddd73 Merge branch 'apollo' of github.com:meshtastic/firmware into apollo 2023-04-24 16:43:02 +02:00
Ben Meadors
681377cc97 Moar 2023-04-24 14:57:56 +02:00
Ben Meadors
1eff8fdba8 WIP scaffolding 2023-04-24 14:57:56 +02:00
Ben Meadors
516fc5ceed Moar 2023-04-15 09:16:18 +02:00
Ben Meadors
a7f9e5ddb4 WIP scaffolding 2023-04-15 09:16:18 +02:00
80 changed files with 1808 additions and 2046 deletions

View File

@@ -58,7 +58,7 @@ jobs:
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
cp release/meshtasticd_linux_x86_64 .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/

View File

@@ -58,7 +58,7 @@ jobs:
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
cp release/meshtasticd_linux_aarch64 .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/

View File

@@ -58,7 +58,7 @@ jobs:
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then mv .debpkg/usr/share/doc/meshtasticd/web/build/* .debpkg/usr/share/doc/meshtasticd/web/; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/build ]; then rmdir .debpkg/usr/share/doc/meshtasticd/web/build; fi
if [ -d .debpkg/usr/share/doc/meshtasticd/web/.DS_Store]; then rm -f .debpkg/usr/share/doc/meshtasticd/web/.DS_Store; fi
gunzip .debpkg/usr/share/doc/meshtasticd/web/ -r
gunzip .debpkg/usr/share/doc/meshtasticd/web/*.gz
cp release/meshtasticd_linux_armv7l .debpkg/usr/sbin/meshtasticd
cp bin/config-dist.yaml .debpkg/etc/meshtasticd/config.yaml
cp bin/config.d/* .debpkg/etc/meshtasticd/available.d/

View File

@@ -2,9 +2,8 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
"ms-vscode.cpptools",
"platformio.platformio-ide",
"trunk.io"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -1,4 +1,4 @@
# Contributor Covenant Code of Conduct
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
The Meshtastic Firmware project is subject to the code of conduct for the parent project, which can be found here:
https://meshtastic.org/docs/legal/conduct/

33
arch/apollo3/apollo3.ini Normal file
View File

@@ -0,0 +1,33 @@
[apollo3_base]
extends = arduino_base
platform = https://github.com/nigelb/platform-apollo3blue.git#2e8a9895cf82f2836c483885e6f89b3f83d3ade4
platform_packages=framework-arduinoapollo3@https://github.com/sparkfun/Arduino_Apollo3#a0d99c5fc9b1112d46a9d11c1339898d01e586c9
build_type = debug
build_flags =
${arduino_base.build_flags}
-Isrc/platform/apollo3 -g
-I"${platformio.packages_dir}/framework-arduinoapollo3/libraries/SPI/src"
-DRADIOLIB_EEPROM_UNSUPPORTED
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
build_src_filter =
${arduino_base.build_src_filter}
-<platform/nrf52>
-<platform/esp32/>
-<platform/rp2040>
-<platform/portduino>
-<platform/stm32wl>
-<nimble/>
-<mesh/api/>
-<mesh/http/>
-<mesh/wifi/>
-<modules/esp32>
-<mesh/eth/>
-<input>
-<buzz>
-<modules/Telemetry>
lib_deps =
${env.lib_deps}
charlesbaynham/OSFS@^1.2.3
rweather/Crypto
lib_ignore =
mathertel/OneButton

View File

@@ -5,7 +5,13 @@ custom_esp32_kind = esp32
platform = platformio/espressif32@6.9.0
build_src_filter =
${arduino_base.build_src_filter} -<platform/nrf52/> -<platform/stm32wl> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
${arduino_base.build_src_filter}
-<platform/nrf52/>
-<platform/stm32wl>
-<platform/rp2xx0>
-<platform/apollo3>
-<mesh/eth/>
-<mesh/raspihttp>
upload_speed = 921600
debug_init_break = tbreak setup

View File

@@ -1,5 +1,6 @@
[esp32c3_base]
extends = esp32_base
custom_esp32_kind = esp32c3
monitor_speed = 115200

View File

@@ -1,6 +1,6 @@
[esp32s3_base]
extends = esp32_base
custom_esp32_kind = esp32s3
monitor_speed = 115200

View File

@@ -19,7 +19,18 @@ build_flags =
-DMAX_NUM_NODES=80
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<platform/stm32wl> -<nimble/> -<mesh/wifi/> -<mesh/api/> -<mesh/http/> -<modules/esp32> -<platform/rp2xx0> -<mesh/eth/> -<mesh/raspihttp>
${arduino_base.build_src_filter}
-<platform/esp32/>
-<platform/stm32wl>
-<nimble/>
-<mesh/wifi/>
-<mesh/api/>
-<mesh/http/>
-<modules/esp32>
-<platform/rp2xx0>
-<mesh/eth/>
-<mesh/raspihttp>
-<platform/apollo3>
lib_deps=
${arduino_base.lib_deps}

View File

@@ -10,6 +10,7 @@ build_src_filter =
-<platform/nrf52/>
-<platform/stm32wl/>
-<platform/rp2xx0>
-<platform/apollo3>
-<mesh/wifi/>
-<mesh/http/>
+<mesh/raspihttp/>
@@ -36,4 +37,4 @@ build_flags =
-lstdc++fs
-lbluetooth
-lgpiod
-lyaml-cpp
-lyaml-cpp

View File

@@ -14,7 +14,7 @@ build_flags =
-D__PLAT_RP2040__
# -D _POSIX_THREADS
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/apollo3> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
lib_ignore =
BluetoothOTA

View File

@@ -12,7 +12,17 @@ build_flags =
-D__PLAT_RP2040__
# -D _POSIX_THREADS
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<modules/esp32> -<platform/nrf52/> -<platform/stm32wl> -<mesh/eth/> -<mesh/wifi/> -<mesh/http/> -<mesh/raspihttp>
${arduino_base.build_src_filter}
-<platform/esp32/>
-<nimble/>
-<modules/esp32>
-<platform/nrf52/>
-<platform/stm32wl>
-<mesh/eth/>
-<mesh/wifi/>
-<mesh/http/>
-<platform/apollo3>
-<mesh/raspihttp>
lib_ignore =
BluetoothOTA

View File

@@ -22,7 +22,7 @@ build_flags =
-fdata-sections
build_src_filter =
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<mesh/raspihttp>
${arduino_base.build_src_filter} -<platform/esp32/> -<nimble/> -<mesh/api/> -<mesh/wifi/> -<mesh/http/> -<modules/esp32> -<mesh/eth/> -<input> -<buzz> -<modules/RemoteHardwareModule.cpp> -<platform/nrf52> -<platform/portduino> -<platform/rp2xx0> -<platform/apollo3> -<mesh/raspihttp>
board_upload.offset_address = 0x08000000
upload_protocol = stlink

View File

@@ -0,0 +1,45 @@
{
"build": {
"cpu": "cortex-m4",
"f_cpu": "48000000L",
"mcu": "AMA3B1KK",
"part": "apollo3",
"fabi": "hard",
"specs": "nosys.specs",
"framework": {
"arduino": {
"v1": {
"variant": "artemis",
"extra_flags": "-DSFE_ARTEMIS"
},
"v2": {
"variant": "rak11720",
"extra_flags": "-DARDUINO_RAK_11720_MODULE"
}
},
"ambiqsdk-sfe": {
"variant": ["boards_sfe", "artemis_module"],
"extra_flags": "",
"variant_lib_src_filter": ""
}
}
},
"debug": {
"jlink_device": "AMA3B1KK-KBR",
"svd_path": "apollo3.svd",
"swo_freq": 12000000,
"init": {
"break": "tbreak setup"
}
},
"frameworks": ["arduino", "ambiqsdk-sfe"],
"name": "WisCore RAK11720 Board",
"upload": {
"maximum_ram_size": 393216,
"maximum_size": 983040,
"protocol": "svl",
"protocols": ["svl", "asb", "jlink"]
},
"url": "https://www.rakwireless.com",
"vendor": "RAKwireless"
}

View File

@@ -34,6 +34,7 @@ default_envs = tbeam
;default_envs = radiomaster_900_bandit_nano
;default_envs = radiomaster_900_bandit_micro
;default_envs = radiomaster_900_bandit
;default_envs = heltec_capsule_sensor_v3
;default_envs = heltec_vision_master_t190
;default_envs = heltec_vision_master_e213
;default_envs = heltec_vision_master_e290
@@ -109,6 +110,7 @@ framework = arduino
lib_deps =
${env.lib_deps}
end2endzone/NonBlockingRTTTL@1.3.0
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
build_flags = ${env.build_flags} -Os
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
@@ -159,4 +161,4 @@ lib_deps =
https://github.com/KodinLanewave/INA3221@1.0.1
mprograms/QMC5883LCompass@1.2.3
dfrobot/DFRobot_RTU@1.0.3
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d

View File

@@ -24,11 +24,16 @@ SPIClass SPI1(HSPI);
#endif // HAS_SDCARD
#if defined(ARCH_STM32WL)
#if defined(ARCH_APOLLO3)
// Apollo series 2 Kbytes (8 rows of 256 bytes)
uint16_t OSFS::startOfEEPROM = 1;
uint16_t OSFS::endOfEEPROM = 2048;
// Useful consts
const OSFS::result noerr = OSFS::result::NO_ERROR;
const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND;
// 3) How do I read from the medium?
void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output)
{
@@ -66,7 +71,7 @@ extern "C" void lfs_assert(const char *reason)
*/
bool copyFile(const char *from, const char *to)
{
#ifdef ARCH_STM32WL
#if defined(ARCH_STM32WL) || defined(ARCH_APOLLO3)
unsigned char cbuffer[2048];
// Var to hold the result of actions
@@ -129,7 +134,7 @@ bool copyFile(const char *from, const char *to)
*/
bool renameFile(const char *pathFrom, const char *pathTo)
{
#ifdef ARCH_STM32WL
#if defined(ARCH_STM32WL) || defined(ARCH_APOLLO3)
if (copyFile(pathFrom, pathTo) && (OSFS::deleteFile(pathFrom) == OSFS::result::NO_ERROR)) {
return true;
} else {

View File

@@ -24,6 +24,25 @@ const OSFS::result noerr = OSFS::result::NO_ERROR;
const OSFS::result notfound = OSFS::result::FILE_NOT_FOUND;
#endif
#if defined(ARCH_APOLLO3)
// Apollo series 2 Kbytes (8 rows of 256 bytes)
#include <EEPROM.h>
#include <OSFS.h>
extern uint16_t OSFS::startOfEEPROM;
extern uint16_t OSFS::endOfEEPROM;
// Useful consts
extern const OSFS::result noerr;
extern const OSFS::result notfound;
// 3) How do I read from the medium?
void OSFS::readNBytes(uint16_t address, unsigned int num, byte *output);
// 4) How to I write to the medium?
void OSFS::writeNBytes(uint16_t address, unsigned int num, const byte *input);
#endif
#if defined(ARCH_RP2040)
// RP2040
#include "LittleFS.h"

View File

@@ -19,10 +19,6 @@
#include "sleep.h"
#include "target_specific.h"
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
#include "mesh/wifi/WiFiAPClient.h"
#endif
#ifndef SLEEP_TIME
#define SLEEP_TIME 30
#endif
@@ -381,9 +377,9 @@ void PowerFSM_setup()
// We never enter light-sleep or NB states on NRF52 (because the CPU uses so little power normally)
#ifdef ARCH_ESP32
// See: https://github.com/meshtastic/firmware/issues/1071
// Don't add power saving transitions if we are a power saving tracker or sensor or have Wifi enabled. Sleep will be initiated
// through the modules
if ((isRouter || config.power.is_power_saving) && !isWifiAvailable() && !isTrackerOrSensor) {
// Don't add power saving transitions if we are a power saving tracker or sensor. Sleep will be initiated through the
// modules
if ((isRouter || config.power.is_power_saving) && !isTrackerOrSensor) {
powerFSM.add_timed_transition(&stateNB, &stateLS,
Default::getConfiguredOrDefaultMs(config.power.min_wake_secs, default_min_wake_secs), NULL,
"Min wake timeout");

View File

@@ -1,8 +1,8 @@
#include "RedirectablePrint.h"
#include "NodeDB.h"
#include "RTC.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/generated/meshtastic/mesh.pb.h"
#include <assert.h>

View File

@@ -171,6 +171,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------
// Security
// -----------------------------------------------------------------------------
#define ATECC608B_ADDR 0x35
// -----------------------------------------------------------------------------
// IO Expander
@@ -361,4 +362,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
#include "DebugConfiguration.h"
#include "RF95Configuration.h"
#include "RF95Configuration.h"

View File

@@ -12,6 +12,7 @@ class ScanI2C
SCREEN_SH1106,
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
SCREEN_ST7567,
ATECC608B,
RTC_RV3028,
RTC_PCF8563,
CARDKB,

View File

@@ -7,6 +7,7 @@
#include "linux/LinuxHardwareI2C.h"
#endif
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
#include "main.h" // atecc
#include "meshUtils.h" // vformat
#endif
@@ -71,10 +72,10 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
r &= 0x0f;
if (r == 0x08 || r == 0x00) {
logFoundDevice("SH1106", (uint8_t)addr.address);
LOG_INFO("sh1106 display found");
o_probe = SCREEN_SH1106; // SH1106
} else if (r == 0x03 || r == 0x04 || r == 0x06 || r == 0x07) {
logFoundDevice("SSD1306", (uint8_t)addr.address);
LOG_INFO("ssd1306 display found");
o_probe = SCREEN_SSD1306; // SSD1306
}
c++;
@@ -83,6 +84,40 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
return o_probe;
}
void ScanI2CTwoWire::printATECCInfo() const
{
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
atecc.readConfigZone(false);
std::string atecc_numbers = "ATECC608B Serial Number: ";
for (int i = 0; i < 9; i++) {
atecc_numbers += vformat("%02x", atecc.serialNumber[i]);
}
atecc_numbers += ", Rev Number: ";
for (int i = 0; i < 4; i++) {
atecc_numbers += vformat("%02x", atecc.revisionNumber[i]);
}
LOG_DEBUG(atecc_numbers.c_str());
LOG_DEBUG("ATECC608B Config %s, Data %s, Slot 0 %s", atecc.configLockStatus ? "Locked" : "Unlocked",
atecc.dataOTPLockStatus ? "Locked" : "Unlocked", atecc.slot0LockStatus ? "Locked" : "Unlocked");
std::string atecc_publickey = "";
if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) {
if (atecc.generatePublicKey() == false) {
atecc_publickey += "ATECC608B Error generating public key";
} else {
atecc_publickey += "ATECC608B Public Key: ";
for (int i = 0; i < 64; i++) {
atecc_publickey += vformat("%02x", atecc.publicKey64Bytes[i]);
}
}
LOG_DEBUG(atecc_publickey.c_str());
}
#endif
}
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation &registerLocation,
ScanI2CTwoWire::ResponseWidth responseWidth) const
{
@@ -94,6 +129,7 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation
i2cBus->endTransmission();
delay(20);
i2cBus->requestFrom(registerLocation.i2cAddress.address, responseWidth);
LOG_DEBUG("Wire.available() = %d", i2cBus->available());
if (i2cBus->available() == 2) {
// Read MSB, then LSB
value = (uint16_t)i2cBus->read() << 8;
@@ -106,7 +142,7 @@ uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation
#define SCAN_SIMPLE_CASE(ADDR, T, ...) \
case ADDR: \
logFoundDevice(__VA_ARGS__); \
LOG_INFO(__VA_ARGS__); \
type = T; \
break;
@@ -148,9 +184,9 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
for (addr.address = 8; addr.address < 120; addr.address++) {
if (asize != 0) {
if (!in_array(address, asize, (uint8_t)addr.address))
if (!in_array(address, asize, addr.address))
continue;
LOG_DEBUG("Scan address 0x%x", (uint8_t)addr.address);
LOG_DEBUG("Scan address 0x%x", addr.address);
}
i2cBus->beginTransmission(addr.address);
#ifdef ARCH_PORTDUINO
@@ -163,16 +199,35 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
#endif
type = NONE;
if (err == 0) {
LOG_DEBUG("I2C device found at address 0x%x", addr.address);
switch (addr.address) {
case SSD1306_ADDRESS:
type = probeOLED(addr);
break;
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
case ATECC608B_ADDR:
#ifdef RP2040_SLOW_CLOCK
if (atecc.begin(addr.address, Wire, Serial2) == true)
#else
if (atecc.begin(addr.address) == true)
#endif
{
LOG_INFO("ATECC608B initialized");
} else {
LOG_WARN("ATECC608B initialization failed");
}
printATECCInfo();
break;
#endif
#ifdef RV3028_RTC
case RV3028_RTC:
// foundDevices[addr] = RTC_RV3028;
type = RTC_RV3028;
logFoundDevice("RV3028", (uint8_t)addr.address);
LOG_INFO("RV3028 RTC found");
rtc.initI2C(*i2cBus);
rtc.writeToRegister(0x35, 0x07); // no Clkout
rtc.writeToRegister(0x37, 0xB4);
@@ -180,7 +235,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
#endif
#ifdef PCF8563_RTC
SCAN_SIMPLE_CASE(PCF8563_RTC, RTC_PCF8563, "PCF8563", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(PCF8563_RTC, RTC_PCF8563, "PCF8563 RTC found")
#endif
case CARDKB_ADDR:
@@ -188,50 +243,50 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x04), 1);
if (registerValue == 0x02) {
// KEYPAD_VERSION
logFoundDevice("RAK14004", (uint8_t)addr.address);
LOG_INFO("RAK14004 found");
type = RAK14004;
} else {
logFoundDevice("M5 cardKB", (uint8_t)addr.address);
LOG_INFO("m5 cardKB found");
type = CARDKB;
}
break;
SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TDECK_KB_ADDR, TDECKKB, "T-Deck keyboard found");
SCAN_SIMPLE_CASE(BBQ10_KB_ADDR, BBQ10KB, "BB Q10 keyboard found");
SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "ST7567", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(ST7567_ADDRESS, SCREEN_ST7567, "st7567 display found");
#ifdef HAS_NCP5623
SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(NCP5623_ADDR, NCP5623, "NCP5623 RGB LED found");
#endif
#ifdef HAS_PMU
SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "AXP192/AXP2101", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(XPOWERS_AXP192_AXP2101_ADDRESS, PMU_AXP192_AXP2101, "axp192/axp2101 PMU found")
#endif
case BME_ADDR:
case BME_ADDR_ALTERNATE:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
switch (registerValue) {
case 0x61:
logFoundDevice("BME680", (uint8_t)addr.address);
LOG_INFO("BME-680 sensor found at address 0x%x", (uint8_t)addr.address);
type = BME_680;
break;
case 0x60:
logFoundDevice("BME280", (uint8_t)addr.address);
LOG_INFO("BME-280 sensor found at address 0x%x", (uint8_t)addr.address);
type = BME_280;
break;
case 0x55:
logFoundDevice("BMP085/BMP180", (uint8_t)addr.address);
LOG_INFO("BMP-085 or BMP-180 sensor found at address 0x%x", (uint8_t)addr.address);
type = BMP_085;
break;
default:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1); // GET_ID
switch (registerValue) {
case 0x50: // BMP-388 should be 0x50
logFoundDevice("BMP-388", (uint8_t)addr.address);
LOG_INFO("BMP-388 sensor found at address 0x%x", (uint8_t)addr.address);
type = BMP_3XX;
break;
case 0x58: // BMP-280 should be 0x58
default:
logFoundDevice("BMP-280", (uint8_t)addr.address);
LOG_INFO("BMP-280 sensor found at address 0x%x", (uint8_t)addr.address);
type = BMP_280;
break;
}
@@ -240,7 +295,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
break;
#ifndef HAS_NCP5623
case AHT10_ADDR:
logFoundDevice("AHT10", (uint8_t)addr.address);
LOG_INFO("AHT10 sensor found at address 0x%x", (uint8_t)addr.address);
type = AHT10;
break;
#endif
@@ -250,10 +305,10 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
LOG_DEBUG("Register MFG_UID: 0x%x", registerValue);
if (registerValue == 0x5449) {
logFoundDevice("INA260", (uint8_t)addr.address);
LOG_INFO("INA260 sensor found at address 0x%x", (uint8_t)addr.address);
type = INA260;
} else { // Assume INA219 if INA260 ID is not found
logFoundDevice("INA219", (uint8_t)addr.address);
LOG_INFO("INA219 sensor found at address 0x%x", (uint8_t)addr.address);
type = INA219;
}
break;
@@ -261,7 +316,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFE), 2);
LOG_DEBUG("Register MFG_UID FE: 0x%x", registerValue);
if (registerValue == 0x5449) {
logFoundDevice("INA3221", (uint8_t)addr.address);
LOG_INFO("INA3221 sensor found at address 0x%x", (uint8_t)addr.address);
type = INA3221;
} else {
/* check the first 2 bytes of the 6 byte response register
@@ -276,7 +331,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x05), 2);
LOG_DEBUG("Register MFG_UID 05: 0x%x", registerValue);
if (registerValue == 0x5305) {
logFoundDevice("DFRobot Lark", (uint8_t)addr.address);
LOG_INFO("DFRobot Lark weather station found at address 0x%x", (uint8_t)addr.address);
type = DFROBOT_LARK;
}
// else: probably a RAK12500/UBLOX GPS on I2C
@@ -291,7 +346,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 2);
if (registerValue == 0x8700) {
type = STK8BAXX;
logFoundDevice("STK8BAXX", (uint8_t)addr.address);
LOG_INFO("STK8BAXX accelerometer found");
break;
}
#endif
@@ -300,7 +355,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x07), 2);
if (registerValue == 0x0400) {
type = MCP9808;
logFoundDevice("MCP9808", (uint8_t)addr.address);
LOG_INFO("MCP9808 sensor found");
break;
}
@@ -308,7 +363,7 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2);
if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333
type = LIS3DH;
logFoundDevice("LIS3DH", (uint8_t)addr.address);
LOG_INFO("LIS3DH accelerometer found");
}
break;
}
@@ -316,92 +371,93 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x89), 2);
if (registerValue == 0x11a2 || registerValue == 0x11da || registerValue == 0xe9c) {
type = SHT4X;
logFoundDevice("SHT4X", (uint8_t)addr.address);
LOG_INFO("SHT4X sensor found");
} else if (getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x7E), 2) == 0x5449) {
type = OPT3001;
logFoundDevice("OPT3001", (uint8_t)addr.address);
LOG_INFO("OPT3001 light sensor found");
} else {
type = SHT31;
logFoundDevice("SHT31", (uint8_t)addr.address);
LOG_INFO("SHT31 sensor found");
}
break;
SCAN_SIMPLE_CASE(SHTC3_ADDR, SHTC3, "SHTC3", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(SHTC3_ADDR, SHTC3, "SHTC3 sensor found")
case RCWL9620_ADDR:
// get MAX30102 PARTID
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xFF), 1);
if (registerValue == 0x15) {
type = MAX30102;
logFoundDevice("MAX30102", (uint8_t)addr.address);
LOG_INFO("MAX30102 Health sensor found");
break;
} else {
type = RCWL9620;
logFoundDevice("RCWL9620", (uint8_t)addr.address);
LOG_INFO("RCWL9620 sensor found");
}
break;
case LPS22HB_ADDR_ALT:
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(QMC6310_ADDR, QMC6310, "QMC6310", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(LPS22HB_ADDR, LPS22HB, "LPS22HB sensor found")
SCAN_SIMPLE_CASE(QMC6310_ADDR, QMC6310, "QMC6310 Highrate 3-Axis magnetic sensor found")
case QMI8658_ADDR:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0A), 1); // get ID
if (registerValue == 0xC0) {
type = BQ24295;
logFoundDevice("BQ24295", (uint8_t)addr.address);
LOG_INFO("BQ24295 PMU found");
break;
}
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 1); // get ID
if (registerValue == 0x6A) {
type = LSM6DS3;
logFoundDevice("LSM6DS3", (uint8_t)addr.address);
LOG_INFO("LSM6DS3 accelerometer found at address 0x%x", (uint8_t)addr.address);
} else {
type = QMI8658;
logFoundDevice("QMI8658", (uint8_t)addr.address);
LOG_INFO("QMI8658 Highrate 6-Axis inertial measurement sensor found");
}
break;
SCAN_SIMPLE_CASE(QMC5883L_ADDR, QMC5883L, "QMC5883L", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(HMC5883L_ADDR, HMC5883L, "HMC5883L", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(QMC5883L_ADDR, QMC5883L, "QMC5883L Highrate 3-Axis magnetic sensor found")
SCAN_SIMPLE_CASE(HMC5883L_ADDR, HMC5883L, "HMC5883L 3-Axis digital compass found")
#ifdef HAS_QMA6100P
SCAN_SIMPLE_CASE(QMA6100P_ADDR, QMA6100P, "QMA6100P", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(QMA6100P_ADDR, QMA6100P, "QMA6100P accelerometer found")
#else
SCAN_SIMPLE_CASE(PMSA0031_ADDR, PMSA0031, "PMSA0031", (uint8_t)addr.address)
SCAN_SIMPLE_CASE(PMSA0031_ADDR, PMSA0031, "PMSA0031 air quality sensor found")
#endif
case BMA423_ADDR: // this can also be LIS3DH_ADDR_ALT
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0F), 2);
if (registerValue == 0x3300 || registerValue == 0x3333) { // RAK4631 WisBlock has LIS3DH register at 0x3333
type = LIS3DH;
logFoundDevice("LIS3DH", (uint8_t)addr.address);
LOG_INFO("LIS3DH accelerometer found");
} else {
type = BMA423;
logFoundDevice("BMA423", (uint8_t)addr.address);
LOG_INFO("BMA423 accelerometer found");
}
break;
SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TSL25911_ADDR, TSL2591, "TSL2591", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(OPT3001_ADDR, OPT3001, "OPT3001", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(MLX90632_ADDR, MLX90632, "MLX90632", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(LSM6DS3_ADDR, LSM6DS3, "LSM6DS3 accelerometer found at address 0x%x", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TCA9535_ADDR, TCA9535, "TCA9535 I2C expander found");
SCAN_SIMPLE_CASE(TCA9555_ADDR, TCA9555, "TCA9555 I2C expander found");
SCAN_SIMPLE_CASE(VEML7700_ADDR, VEML7700, "VEML7700 light sensor found");
SCAN_SIMPLE_CASE(TSL25911_ADDR, TSL2591, "TSL2591 light sensor found");
SCAN_SIMPLE_CASE(OPT3001_ADDR, OPT3001, "OPT3001 light sensor found");
SCAN_SIMPLE_CASE(MLX90632_ADDR, MLX90632, "MLX90632 IR temp sensor found");
SCAN_SIMPLE_CASE(NAU7802_ADDR, NAU7802, "NAU7802 based scale found");
SCAN_SIMPLE_CASE(FT6336U_ADDR, FT6336U, "FT6336U touchscreen found");
SCAN_SIMPLE_CASE(MAX1704X_ADDR, MAX17048, "MAX17048 lipo fuel gauge found");
#ifdef HAS_TPS65233
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233", (uint8_t)addr.address);
SCAN_SIMPLE_CASE(TPS65233_ADDR, TPS65233, "TPS65233 BIAS-T found");
#endif
case MLX90614_ADDR_DEF:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0e), 1);
if (registerValue == 0x5a) {
type = MLX90614;
logFoundDevice("MLX90614", (uint8_t)addr.address);
LOG_INFO("MLX90614 IR temp sensor found");
} else {
type = MPR121KB;
logFoundDevice("MPR121KB", (uint8_t)addr.address);
LOG_INFO("MPR121KB keyboard found");
}
break;
@@ -410,15 +466,15 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
if (registerValue == 0xEA) {
type = ICM20948;
logFoundDevice("ICM20948", (uint8_t)addr.address);
LOG_INFO("ICM20948 9-dof motion processor found");
break;
} else if (addr.address == BMX160_ADDR) {
type = BMX160;
logFoundDevice("BMX160", (uint8_t)addr.address);
LOG_INFO("BMX160 accelerometer found");
break;
} else {
type = MPU6050;
logFoundDevice("MPU6050", (uint8_t)addr.address);
LOG_INFO("MPU6050 accelerometer found");
break;
}
break;
@@ -428,16 +484,16 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
if (registerValue == 0x7D) {
type = CGRADSENS;
logFoundDevice("ClimateGuard RadSens", (uint8_t)addr.address);
LOG_INFO("ClimateGuard RadSens Geiger-Muller Sensor found");
break;
}
break;
default:
LOG_INFO("Device found at address 0x%x was not able to be enumerated", (uint8_t)addr.address);
LOG_INFO("Device found at address 0x%x was not able to be enumerated", addr.address);
}
} else if (err == 4) {
LOG_ERROR("Unknown error at address 0x%x", (uint8_t)addr.address);
LOG_ERROR("Unknown error at address 0x%x", addr.address);
}
// Check if a type was found for the enumerated device - save, if so
@@ -470,9 +526,4 @@ size_t ScanI2CTwoWire::countDevices() const
{
return foundDevices.size();
}
void ScanI2CTwoWire::logFoundDevice(const char *device, uint8_t address)
{
LOG_INFO("%s found at address 0x%x", device, address);
}
#endif

View File

@@ -53,10 +53,10 @@ class ScanI2CTwoWire : public ScanI2C
concurrency::Lock lock;
void printATECCInfo() const;
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
static void logFoundDevice(const char *device, uint8_t address);
};
#endif

View File

@@ -28,43 +28,29 @@
#define GPS_RESET_MODE HIGH
#endif
// Not all platforms have std::size().
template <typename T, std::size_t N> std::size_t array_count(const T (&)[N])
{
return N;
}
#if defined(NRF52840_XXAA) || defined(NRF52833_XXAA) || defined(ARCH_ESP32) || defined(ARCH_PORTDUINO)
HardwareSerial *GPS::_serial_gps = &Serial1;
#elif defined(ARCH_RP2040)
SerialUART *GPS::_serial_gps = &Serial1;
#else
HardwareSerial *GPS::_serial_gps = nullptr;
HardwareSerial *GPS::_serial_gps = NULL;
#endif
GPS *gps = nullptr;
static const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
static GPSUpdateScheduling scheduling;
GPSUpdateScheduling scheduling;
/// Multiple GPS instances might use the same serial port (in sequence), but we can
/// only init that port once.
static bool didSerialInit;
static struct uBloxGnssModelInfo {
char swVersion[30];
char hwVersion[10];
uint8_t extensionNo;
char extension[10][30];
uint8_t protocol_version;
} ublox_info;
struct uBloxGnssModelInfo info;
uint8_t uBloxProtocolVersion;
#define GPS_SOL_EXPIRY_MS 5000 // in millis. give 1 second time to combine different sentences. NMEA Frequency isn't higher anyway
#define NMEA_MSG_GXGSA "GNGSA" // GSA message (GPGSA, GNGSA etc)
// For logging
static const char *getGPSPowerStateString(GPSPowerState state)
const char *getGPSPowerStateString(GPSPowerState state)
{
switch (state) {
case GPS_ACTIVE:
@@ -83,7 +69,7 @@ static const char *getGPSPowerStateString(GPSPowerState state)
}
}
static void UBXChecksum(uint8_t *message, size_t length)
void GPS::UBXChecksum(uint8_t *message, size_t length)
{
uint8_t CK_A = 0, CK_B = 0;
@@ -99,7 +85,7 @@ static void UBXChecksum(uint8_t *message, size_t length)
}
// Calculate the checksum for a CAS packet
static void CASChecksum(uint8_t *message, size_t length)
void GPS::CASChecksum(uint8_t *message, size_t length)
{
uint32_t cksum = ((uint32_t)message[5] << 24); // Message ID
cksum += ((uint32_t)message[4]) << 16; // Class
@@ -424,15 +410,6 @@ int GPS::getACK(uint8_t *buffer, uint16_t size, uint8_t requestedClass, uint8_t
return 0;
}
#if GPS_BAUDRATE_FIXED
// if GPS_BAUDRATE is specified in variant, only try that.
static const int serialSpeeds[1] = {GPS_BAUDRATE};
static const int rareSerialSpeeds[1] = {GPS_BAUDRATE};
#else
static const int serialSpeeds[3] = {9600, 115200, 38400};
static const int rareSerialSpeeds[3] = {4800, 57600, GPS_BAUDRATE};
#endif
/**
* @brief Setup the GPS based on the model detected.
* We detect the GPS by cycling through a set of baud rates, first common then rare.
@@ -442,6 +419,7 @@ static const int rareSerialSpeeds[3] = {4800, 57600, GPS_BAUDRATE};
*/
bool GPS::setup()
{
if (!didSerialInit) {
int msglen = 0;
if (tx_gpio && gnssModel == GNSS_MODEL_UNKNOWN) {
@@ -449,7 +427,7 @@ bool GPS::setup()
LOG_DEBUG("Probe for GPS at %d", serialSpeeds[speedSelect]);
gnssModel = probe(serialSpeeds[speedSelect]);
if (gnssModel == GNSS_MODEL_UNKNOWN) {
if (++speedSelect == array_count(serialSpeeds)) {
if (++speedSelect == sizeof(serialSpeeds) / sizeof(int)) {
speedSelect = 0;
++probeTries;
}
@@ -460,7 +438,7 @@ bool GPS::setup()
LOG_DEBUG("Probe for GPS at %d", rareSerialSpeeds[speedSelect]);
gnssModel = probe(rareSerialSpeeds[speedSelect]);
if (gnssModel == GNSS_MODEL_UNKNOWN) {
if (++speedSelect == array_count(rareSerialSpeeds)) {
if (++speedSelect == sizeof(rareSerialSpeeds) / sizeof(int)) {
LOG_WARN("Give up on GPS probe and set to %d", GPS_BAUDRATE);
return true;
}
@@ -656,7 +634,7 @@ bool GPS::setup()
SEND_UBX_PACKET(0x06, 0x01, _message_RMC, "enable NMEA RMC", 500);
SEND_UBX_PACKET(0x06, 0x01, _message_GGA, "enable NMEA GGA", 500);
if (ublox_info.protocol_version >= 18) {
if (uBloxProtocolVersion >= 18) {
clearBuffer();
SEND_UBX_PACKET(0x06, 0x86, _message_PMS, "enable powersave for GPS", 500);
SEND_UBX_PACKET(0x06, 0x3B, _message_CFG_PM2, "enable powersave details for GPS", 500);
@@ -740,7 +718,6 @@ GPS::~GPS()
// we really should unregister our sleep observer
notifyDeepSleepObserver.unobserve(&notifyDeepSleep);
}
// Put the GPS hardware into a specified state
void GPS::setPowerState(GPSPowerState newState, uint32_t sleepTime)
{
@@ -905,17 +882,17 @@ void GPS::setPowerUBLOX(bool on, uint32_t sleepMs)
if (gnssModel != GNSS_MODEL_UBLOX10) {
// Encode the sleep time in millis into the packet
for (int i = 0; i < 4; i++)
_message_PMREQ[0 + i] = sleepMs >> (i * 8);
gps->_message_PMREQ[0 + i] = sleepMs >> (i * 8);
// Record the message length
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ), _message_PMREQ);
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ), gps->_message_PMREQ);
} else {
// Encode the sleep time in millis into the packet
for (int i = 0; i < 4; i++)
_message_PMREQ_10[4 + i] = sleepMs >> (i * 8);
gps->_message_PMREQ_10[4 + i] = sleepMs >> (i * 8);
// Record the message length
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ_10), _message_PMREQ_10);
msglen = gps->makeUBXPacket(0x02, 0x41, sizeof(_message_PMREQ_10), gps->_message_PMREQ_10);
}
// Send the UBX packet
@@ -1122,23 +1099,21 @@ int GPS::prepareDeepSleep(void *unused)
return 0;
}
static const char *PROBE_MESSAGE = "Trying %s (%s)...";
static const char *DETECTED_MESSAGE = "%s detected, using %s Module";
const char *PROBE_MESSAGE = "Trying %s (%s)...";
const char *DETECTED_MESSAGE = "%s detected, using %s Module";
#define PROBE_SIMPLE(CHIP, TOWRITE, RESPONSE, DRIVER, TIMEOUT, ...) \
do { \
LOG_DEBUG(PROBE_MESSAGE, TOWRITE, CHIP); \
clearBuffer(); \
_serial_gps->write(TOWRITE "\r\n"); \
if (getACK(RESPONSE, TIMEOUT) == GNSS_RESPONSE_OK) { \
LOG_INFO(DETECTED_MESSAGE, CHIP, #DRIVER); \
return DRIVER; \
} \
} while (0)
LOG_DEBUG(PROBE_MESSAGE, TOWRITE, CHIP); \
clearBuffer(); \
_serial_gps->write(TOWRITE "\r\n"); \
if (getACK(RESPONSE, TIMEOUT) == GNSS_RESPONSE_OK) { \
LOG_INFO(DETECTED_MESSAGE, CHIP, #DRIVER); \
return DRIVER; \
}
GnssModel_t GPS::probe(int serialSpeed)
{
#if defined(ARCH_NRF52) || defined(ARCH_PORTDUINO) || defined(ARCH_STM32WL)
#if defined(ARCH_NRF52) || defined(ARCH_PORTDUINO) || defined(ARCH_STM32WL) || defined(ARCH_APOLLO3)
_serial_gps->end();
_serial_gps->begin(serialSpeed);
#elif defined(ARCH_RP2040)
@@ -1152,7 +1127,7 @@ GnssModel_t GPS::probe(int serialSpeed)
}
#endif
memset(&ublox_info, 0, sizeof(ublox_info));
memset(&info, 0, sizeof(struct uBloxGnssModelInfo));
uint8_t buffer[768] = {0};
delay(100);
@@ -1219,64 +1194,64 @@ GnssModel_t GPS::probe(int serialSpeed)
if (len) {
uint16_t position = 0;
for (int i = 0; i < 30; i++) {
ublox_info.swVersion[i] = buffer[position];
info.swVersion[i] = buffer[position];
position++;
}
for (int i = 0; i < 10; i++) {
ublox_info.hwVersion[i] = buffer[position];
info.hwVersion[i] = buffer[position];
position++;
}
while (len >= position + 30) {
for (int i = 0; i < 30; i++) {
ublox_info.extension[ublox_info.extensionNo][i] = buffer[position];
info.extension[info.extensionNo][i] = buffer[position];
position++;
}
ublox_info.extensionNo++;
if (ublox_info.extensionNo > 9)
info.extensionNo++;
if (info.extensionNo > 9)
break;
}
LOG_DEBUG("Module Info : ");
LOG_DEBUG("Soft version: %s", ublox_info.swVersion);
LOG_DEBUG("Hard version: %s", ublox_info.hwVersion);
LOG_DEBUG("Extensions:%d", ublox_info.extensionNo);
for (int i = 0; i < ublox_info.extensionNo; i++) {
LOG_DEBUG(" %s", ublox_info.extension[i]);
LOG_DEBUG("Soft version: %s", info.swVersion);
LOG_DEBUG("Hard version: %s", info.hwVersion);
LOG_DEBUG("Extensions:%d", info.extensionNo);
for (int i = 0; i < info.extensionNo; i++) {
LOG_DEBUG(" %s", info.extension[i]);
}
memset(buffer, 0, sizeof(buffer));
// tips: extensionNo field is 0 on some 6M GNSS modules
for (int i = 0; i < ublox_info.extensionNo; ++i) {
if (!strncmp(ublox_info.extension[i], "MOD=", 4)) {
strncpy((char *)buffer, &(ublox_info.extension[i][4]), sizeof(buffer));
} else if (!strncmp(ublox_info.extension[i], "PROTVER", 7)) {
for (int i = 0; i < info.extensionNo; ++i) {
if (!strncmp(info.extension[i], "MOD=", 4)) {
strncpy((char *)buffer, &(info.extension[i][4]), sizeof(buffer));
} else if (!strncmp(info.extension[i], "PROTVER", 7)) {
char *ptr = nullptr;
memset(buffer, 0, sizeof(buffer));
strncpy((char *)buffer, &(ublox_info.extension[i][8]), sizeof(buffer));
strncpy((char *)buffer, &(info.extension[i][8]), sizeof(buffer));
LOG_DEBUG("Protocol Version:%s", (char *)buffer);
if (strlen((char *)buffer)) {
ublox_info.protocol_version = strtoul((char *)buffer, &ptr, 10);
LOG_DEBUG("ProtVer=%d", ublox_info.protocol_version);
uBloxProtocolVersion = strtoul((char *)buffer, &ptr, 10);
LOG_DEBUG("ProtVer=%d", uBloxProtocolVersion);
} else {
ublox_info.protocol_version = 0;
uBloxProtocolVersion = 0;
}
}
}
if (strncmp(ublox_info.hwVersion, "00040007", 8) == 0) {
if (strncmp(info.hwVersion, "00040007", 8) == 0) {
LOG_INFO(DETECTED_MESSAGE, "U-blox 6", "6");
return GNSS_MODEL_UBLOX6;
} else if (strncmp(ublox_info.hwVersion, "00070000", 8) == 0) {
} else if (strncmp(info.hwVersion, "00070000", 8) == 0) {
LOG_INFO(DETECTED_MESSAGE, "U-blox 7", "7");
return GNSS_MODEL_UBLOX7;
} else if (strncmp(ublox_info.hwVersion, "00080000", 8) == 0) {
} else if (strncmp(info.hwVersion, "00080000", 8) == 0) {
LOG_INFO(DETECTED_MESSAGE, "U-blox 8", "8");
return GNSS_MODEL_UBLOX8;
} else if (strncmp(ublox_info.hwVersion, "00190000", 8) == 0) {
} else if (strncmp(info.hwVersion, "00190000", 8) == 0) {
LOG_INFO(DETECTED_MESSAGE, "U-blox 9", "9");
return GNSS_MODEL_UBLOX9;
} else if (strncmp(ublox_info.hwVersion, "000A0000", 8) == 0) {
} else if (strncmp(info.hwVersion, "000A0000", 8) == 0) {
LOG_INFO(DETECTED_MESSAGE, "U-blox 10", "10");
return GNSS_MODEL_UBLOX10;
}
@@ -1750,4 +1725,4 @@ void GPS::toggleGpsMode()
enable();
}
}
#endif // Exclude GPS
#endif // Exclude GPS

View File

@@ -16,6 +16,13 @@
#define GPS_EN_ACTIVE 1
#endif
struct uBloxGnssModelInfo {
char swVersion[30];
char hwVersion[10];
uint8_t extensionNo;
char extension[10][30];
};
typedef enum {
GNSS_MODEL_ATGM336H,
GNSS_MODEL_MTK,
@@ -47,6 +54,9 @@ enum GPSPowerState : uint8_t {
GPS_OFF // Powered off indefinitely
};
// Generate a string representation of DOP
const char *getDOPString(uint32_t dop);
/**
* A gps class that only reads from the GPS periodically and keeps the gps powered down except when reading
*
@@ -112,9 +122,7 @@ class GPS : private concurrency::OSThread
// Let the GPS hardware save power between updates
void down();
private:
GPS() : concurrency::OSThread("GPS") {}
protected:
/// Record that we have a GPS
void setConnected();
@@ -142,6 +150,9 @@ class GPS : private concurrency::OSThread
GnssModel_t gnssModel = GNSS_MODEL_UNKNOWN;
private:
GPS() : concurrency::OSThread("GPS") {}
TinyGPSPlus reader;
uint8_t fixQual = 0; // fix quality from GPGGA
uint32_t lastChecksumFailCount = 0;
@@ -153,13 +164,21 @@ class GPS : private concurrency::OSThread
TinyGPSCustom gsapdop; // custom extract PDOP from GPGSA
uint8_t fixType = 0; // fix type from GPGSA
#endif
#if GPS_BAUDRATE_FIXED
// if GPS_BAUDRATE is specified in variant, only try that.
const int serialSpeeds[1] = {GPS_BAUDRATE};
const int rareSerialSpeeds[1] = {GPS_BAUDRATE};
#else
const int serialSpeeds[3] = {9600, 115200, 38400};
const int rareSerialSpeeds[3] = {4800, 57600, GPS_BAUDRATE};
#endif
uint32_t lastWakeStartMsec = 0, lastSleepStartMsec = 0, lastFixStartMsec = 0;
uint32_t rx_gpio = 0;
uint32_t tx_gpio = 0;
uint8_t speedSelect = 0;
uint8_t probeTries = 0;
int speedSelect = 0;
int probeTries = 0;
/**
* hasValidLocation - indicates that the position variables contain a complete
@@ -188,6 +207,52 @@ class GPS : private concurrency::OSThread
#else
static HardwareSerial *_serial_gps;
#endif
static uint8_t _message_PMREQ[];
static uint8_t _message_PMREQ_10[];
static const uint8_t _message_CFG_RXM_PSM[];
static const uint8_t _message_CFG_RXM_ECO[];
static const uint8_t _message_CFG_PM2[];
static const uint8_t _message_GNSS_7[];
static const uint8_t _message_GNSS_8[];
static const uint8_t _message_JAM_6_7[];
static const uint8_t _message_JAM_8[];
static const uint8_t _message_NAVX5[];
static const uint8_t _message_NAVX5_8[];
static const uint8_t _message_NMEA[];
static const uint8_t _message_DISABLE_TXT_INFO[];
static const uint8_t _message_1HZ[];
static const uint8_t _message_GLL[];
static const uint8_t _message_GSA[];
static const uint8_t _message_GSV[];
static const uint8_t _message_VTG[];
static const uint8_t _message_RMC[];
static const uint8_t _message_AID[];
static const uint8_t _message_GGA[];
static const uint8_t _message_PMS[];
static const uint8_t _message_SAVE[];
static const uint8_t _message_SAVE_10[];
// VALSET Commands for M10
static const uint8_t _message_VALSET_PM[];
static const uint8_t _message_VALSET_PM_RAM[];
static const uint8_t _message_VALSET_PM_BBR[];
static const uint8_t _message_VALSET_ITFM_RAM[];
static const uint8_t _message_VALSET_ITFM_BBR[];
static const uint8_t _message_VALSET_DISABLE_NMEA_RAM[];
static const uint8_t _message_VALSET_DISABLE_NMEA_BBR[];
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_RAM[];
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_BBR[];
static const uint8_t _message_VALSET_ENABLE_NMEA_RAM[];
static const uint8_t _message_VALSET_ENABLE_NMEA_BBR[];
static const uint8_t _message_VALSET_DISABLE_SBAS_RAM[];
static const uint8_t _message_VALSET_DISABLE_SBAS_BBR[];
// CASIC commands for ATGM336H
static const uint8_t _message_CAS_CFG_RST_FACTORY[];
static const uint8_t _message_CAS_CFG_NAVX_CONF[];
static const uint8_t _message_CAS_CFG_RATE_1HZ[];
const char *ACK_SUCCESS_MESSAGE = "Get ack success!";
// Create a ublox packet for editing in memory
uint8_t makeUBXPacket(uint8_t class_id, uint8_t msg_id, uint8_t payload_size, const uint8_t *msg);
@@ -208,6 +273,10 @@ class GPS : private concurrency::OSThread
/// always returns 0 to indicate okay to sleep
int prepareDeepSleep(void *unused);
// Calculate checksum
void UBXChecksum(uint8_t *message, size_t length);
void CASChecksum(uint8_t *message, size_t length);
/** Set power with EN pin, if relevant
*/
void writePinEN(bool on);
@@ -236,7 +305,9 @@ class GPS : private concurrency::OSThread
// delay counter to allow more sats before fixed position stops GPS thread
uint8_t fixeddelayCtr = 0;
const char *powerStateToString();
};
extern GPS *gps;
#endif // Exclude GPS
#endif // Exclude GPS

View File

@@ -574,23 +574,3 @@ const char *GeoCoord::degreesToBearing(unsigned int degrees)
else
return "N";
}
double GeoCoord::pow_neg(double base, double exponent)
{
if (exponent == 0) {
return 1;
} else if (exponent > 0) {
return pow(base, exponent);
}
return 1 / pow(base, -exponent);
}
double GeoCoord::toRadians(double deg)
{
return deg * PI / 180;
}
double GeoCoord::toDegrees(double r)
{
return r * 180 / PI;
}

View File

@@ -13,6 +13,28 @@
#define OLC_CODE_LEN 11
#define DEG_CONVERT (180 / PI)
// Helper functions
// Raises a number to an exponent, handling negative exponents.
static inline double pow_neg(double base, double exponent)
{
if (exponent == 0) {
return 1;
} else if (exponent > 0) {
return pow(base, exponent);
}
return 1 / pow(base, -exponent);
}
static inline double toRadians(double deg)
{
return deg * PI / 180;
}
static inline double toDegrees(double r)
{
return r * 180 / PI;
}
// GeoCoord structs/classes
// A struct to hold the data for a DMS coordinate.
struct DMS {
@@ -98,11 +120,6 @@ class GeoCoord
static unsigned int bearingToDegrees(const char *bearing);
static const char *degreesToBearing(unsigned int degrees);
// Raises a number to an exponent, handling negative exponents.
static double pow_neg(double base, double exponent);
static double toRadians(double deg);
static double toDegrees(double r);
// Point to point conversions
int32_t distanceTo(const GeoCoord &pointB);
int32_t bearingTo(const GeoCoord &pointB);
@@ -145,4 +162,4 @@ class GeoCoord
// OLC getter
void getOLCCode(char *code) { strncpy(code, _olc.code, OLC_CODE_LEN + 1); } // +1 for null termination
};
};

View File

@@ -21,7 +21,7 @@
// CFG-RST (0x06, 0x02)
// Factory reset
static const uint8_t _message_CAS_CFG_RST_FACTORY[] = {
const uint8_t GPS::_message_CAS_CFG_RST_FACTORY[] = {
0xFF, 0x03, // Fields to clear
0x01, // Reset Mode: Controlled Software reset
0x03 // Startup Mode: Factory
@@ -30,7 +30,7 @@ static const uint8_t _message_CAS_CFG_RST_FACTORY[] = {
// CFG_RATE (0x06, 0x01)
// 1HZ update rate, this should always be the case after
// factory reset but update it regardless
static const uint8_t _message_CAS_CFG_RATE_1HZ[] = {
const uint8_t GPS::_message_CAS_CFG_RATE_1HZ[] = {
0xE8, 0x03, // Update Rate: 0x03E8 = 1000ms
0x00, 0x00 // Reserved
};
@@ -39,7 +39,7 @@ static const uint8_t _message_CAS_CFG_RATE_1HZ[] = {
// Initial ATGM33H-5N configuration, Updates for Dynamic Mode, Fix Mode, and SV system
// Qwirk: The ATGM33H-5N-31 should only support GPS+BDS, however it will happily enable
// and use GPS+BDS+GLONASS iff the correct CFG_NAVX command is used.
static const uint8_t _message_CAS_CFG_NAVX_CONF[] = {
const uint8_t GPS::_message_CAS_CFG_NAVX_CONF[] = {
0x03, 0x01, 0x00, 0x00, // Update Mask: Dynamic Mode, Fix Mode, Nav Settings
0x03, // Dynamic Mode: Automotive
0x03, // Fix Mode: Auto 2D/3D
@@ -60,4 +60,4 @@ static const uint8_t _message_CAS_CFG_NAVX_CONF[] = {
0x00, 0x00, 0x00, 0x00, // Position Accuracy Max
0x00, 0x00, 0x00, 0x00, // Time Accuracy Max
0x00, 0x00, 0x00, 0x00 // Static Hold Threshold
};
};

View File

@@ -1,22 +1,20 @@
static const char *failMessage = "Unable to %s";
const char *failMessage = "Unable to %s";
#define SEND_UBX_PACKET(TYPE, ID, DATA, ERRMSG, TIMEOUT) \
do { \
msglen = makeUBXPacket(TYPE, ID, sizeof(DATA), DATA); \
_serial_gps->write(UBXscratch, msglen); \
if (getACK(TYPE, ID, TIMEOUT) != GNSS_RESPONSE_OK) { \
LOG_WARN(failMessage, #ERRMSG); \
} \
} while (0)
msglen = makeUBXPacket(TYPE, ID, sizeof(DATA), DATA); \
_serial_gps->write(UBXscratch, msglen); \
if (getACK(TYPE, ID, TIMEOUT) != GNSS_RESPONSE_OK) { \
LOG_WARN(failMessage, #ERRMSG); \
}
// Power Management
static uint8_t _message_PMREQ[] PROGMEM = {
uint8_t GPS::_message_PMREQ[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, // 4 bytes duration of request task (milliseconds)
0x02, 0x00, 0x00, 0x00 // Bitfield, set backup = 1
};
static uint8_t _message_PMREQ_10[] PROGMEM = {
uint8_t GPS::_message_PMREQ_10[] PROGMEM = {
0x00, // version (0 for this version)
0x00, 0x00, 0x00, // Reserved 1
0x00, 0x00, 0x00, 0x00, // 4 bytes duration of request task (milliseconds)
@@ -24,18 +22,18 @@ static uint8_t _message_PMREQ_10[] PROGMEM = {
0x08, 0x00, 0x00, 0x00 // wakeupSources Wake on uartrx
};
static const uint8_t _message_CFG_RXM_PSM[] PROGMEM = {
const uint8_t GPS::_message_CFG_RXM_PSM[] PROGMEM = {
0x08, // Reserved
0x01 // Power save mode
};
// only for Neo-6
static const uint8_t _message_CFG_RXM_ECO[] PROGMEM = {
const uint8_t GPS::_message_CFG_RXM_ECO[] PROGMEM = {
0x08, // Reserved
0x04 // eco mode
};
static const uint8_t _message_CFG_PM2[] PROGMEM = {
const uint8_t GPS::_message_CFG_PM2[] PROGMEM = {
0x01, // version
0x00, // Reserved 1, set to 0x06 by u-Center
0x00, // Reserved 2
@@ -60,7 +58,7 @@ static const uint8_t _message_CFG_PM2[] PROGMEM = {
// Constallation setup, none required for Neo-6
// For Neo-7 GPS & SBAS
static const uint8_t _message_GNSS_7[] = {
const uint8_t GPS::_message_GNSS_7[] = {
0x00, // msgVer (0 for this version)
0x00, // numTrkChHw (max number of hardware channels, read only, so it's always 0)
0xff, // numTrkChUse (max number of channels to use, 0xff = max available)
@@ -78,7 +76,7 @@ static const uint8_t _message_GNSS_7[] = {
// There is also a possibility that the module may be GPS-only.
// For M8 GPS, GLONASS, Galileo, SBAS, QZSS
static const uint8_t _message_GNSS_8[] = {
const uint8_t GPS::_message_GNSS_8[] = {
0x00, // msgVer (0 for this version)
0x00, // numTrkChHw (max number of hardware channels, read only, so it's always 0)
0xff, // numTrkChUse (max number of channels to use, 0xff = max available)
@@ -92,7 +90,7 @@ static const uint8_t _message_GNSS_8[] = {
};
/*
// For M8 GPS, GLONASS, BeiDou, SBAS, QZSS
static const uint8_t _message_GNSS_8_B[] = {
const uint8_t GPS::_message_GNSS_8_B[] = {
0x00, // msgVer (0 for this version)
0x00, // numTrkChHw (max number of hardware channels, read only, so it's always 0)
0xff, // numTrkChUse (max number of channels to use, 0xff = max available) read only for protocol >23
@@ -107,7 +105,7 @@ static const uint8_t _message_GNSS_8_B[] = {
*/
// For M8 we want to enable NMEA version 4.10 messages to allow for Galileo and or BeiDou
static const uint8_t _message_NMEA[]{
const uint8_t GPS::_message_NMEA[]{
0x00, // filter flags
0x41, // NMEA Version
0x00, // Max number of SVs to report per TaklerId
@@ -123,13 +121,13 @@ static const uint8_t _message_NMEA[]{
// Enable jamming/interference monitor
// For Neo-6, Max-7 and Neo-7
static const uint8_t _message_JAM_6_7[] = {
const uint8_t GPS::_message_JAM_6_7[] = {
0xf3, 0xac, 0x62, 0xad, // config1 bbThreshold = 3, cwThreshold = 15, enable = 1, reserved bits 0x16B156
0x1e, 0x03, 0x00, 0x00 // config2 antennaSetting Unknown = 0, reserved 3, = 0x00,0x00, reserved 2 = 0x31E
};
// For M8
static const uint8_t _message_JAM_8[] = {
const uint8_t GPS::_message_JAM_8[] = {
0xf3, 0xac, 0x62, 0xad, // config1 bbThreshold = 3, cwThreshold = 15, enable1 = 1, reserved bits 0x16B156
0x1e, 0x43, 0x00, 0x00 // config2 antennaSetting Unknown = 0, enable2 = 1, generalBits = 0x31E
};
@@ -139,7 +137,7 @@ static const uint8_t _message_JAM_8[] = {
// ToDo: check UBX-MON-VER for module type and protocol version
// For the Neo-6
static const uint8_t _message_NAVX5[] = {
const uint8_t GPS::_message_NAVX5[] = {
0x00, 0x00, // msgVer (0 for this version)
0x4c, 0x66, // mask1
0x00, 0x00, 0x00, 0x00, // Reserved 0
@@ -168,7 +166,7 @@ static const uint8_t _message_NAVX5[] = {
0x00, 0x00, 0x00, 0x00 // Reserved 4
};
// For the M8
static const uint8_t _message_NAVX5_8[] = {
const uint8_t GPS::_message_NAVX5_8[] = {
0x02, 0x00, // msgVer (2 for this version)
0x4c, 0x66, // mask1
0x00, 0x00, 0x00, 0x00, // mask2
@@ -199,7 +197,7 @@ static const uint8_t _message_NAVX5_8[] = {
// Additionally, for some new modules like the M9/M10, an update rate lower than 5Hz
// is recommended to avoid a known issue with satellites disappearing.
// The module defaults for M8, M9, M10 are the same as we use here so no update is necessary
static const uint8_t _message_1HZ[] = {
const uint8_t GPS::_message_1HZ[] = {
0xE8, 0x03, // Measurement Rate (1000ms for 1Hz)
0x01, 0x00, // Navigation rate, always 1 in GPS mode
0x01, 0x00 // Time reference
@@ -207,7 +205,7 @@ static const uint8_t _message_1HZ[] = {
// Disable GLL. GLL - Geographic position (latitude and longitude), which provides the current geographical
// coordinates.
static const uint8_t _message_GLL[] = {
const uint8_t GPS::_message_GLL[] = {
0xF0, 0x01, // NMEA ID for GLL
0x00, // Rate for DDC
0x00, // Rate for UART1
@@ -219,7 +217,7 @@ static const uint8_t _message_GLL[] = {
// Disable GSA. GSA - GPS DOP and active satellites, used for detailing the satellites used in the positioning and
// the DOP (Dilution of Precision)
static const uint8_t _message_GSA[] = {
const uint8_t GPS::_message_GSA[] = {
0xF0, 0x02, // NMEA ID for GSA
0x00, // Rate for DDC
0x00, // Rate for UART1
@@ -230,7 +228,7 @@ static const uint8_t _message_GSA[] = {
};
// Disable GSV. GSV - Satellites in view, details the number and location of satellites in view.
static const uint8_t _message_GSV[] = {
const uint8_t GPS::_message_GSV[] = {
0xF0, 0x03, // NMEA ID for GSV
0x00, // Rate for DDC
0x00, // Rate for UART1
@@ -242,7 +240,7 @@ static const uint8_t _message_GSV[] = {
// Disable VTG. VTG - Track made good and ground speed, which provides course and speed information relative to
// the ground.
static const uint8_t _message_VTG[] = {
const uint8_t GPS::_message_VTG[] = {
0xF0, 0x05, // NMEA ID for VTG
0x00, // Rate for DDC
0x00, // Rate for UART1
@@ -253,7 +251,7 @@ static const uint8_t _message_VTG[] = {
};
// Enable RMC. RMC - Recommended Minimum data, the essential gps pvt (position, velocity, time) data.
static const uint8_t _message_RMC[] = {
const uint8_t GPS::_message_RMC[] = {
0xF0, 0x04, // NMEA ID for RMC
0x00, // Rate for DDC
0x01, // Rate for UART1
@@ -264,7 +262,7 @@ static const uint8_t _message_RMC[] = {
};
// Enable GGA. GGA - Global Positioning System Fix Data, which provides 3D location and accuracy data.
static const uint8_t _message_GGA[] = {
const uint8_t GPS::_message_GGA[] = {
0xF0, 0x00, // NMEA ID for GGA
0x00, // Rate for DDC
0x01, // Rate for UART1
@@ -276,7 +274,7 @@ static const uint8_t _message_GGA[] = {
// Disable UBX-AID-ALPSRV as it may confuse TinyGPS. The Neo-6 seems to send this message
// whether the AID Autonomous is enabled or not
static const uint8_t _message_AID[] = {
const uint8_t GPS::_message_AID[] = {
0x0B, 0x32, // NMEA ID for UBX-AID-ALPSRV
0x00, // Rate for DDC
0x00, // Rate for UART1
@@ -289,7 +287,7 @@ static const uint8_t _message_AID[] = {
// Turn off TEXT INFO Messages for all but M10 series
// B5 62 06 02 0A 00 01 00 00 00 03 03 00 03 03 00 1F 20
static const uint8_t _message_DISABLE_TXT_INFO[] = {
const uint8_t GPS::_message_DISABLE_TXT_INFO[] = {
0x01, // Protocol ID for NMEA
0x00, 0x00, 0x00, // Reserved
0x03, // I2C
@@ -312,7 +310,7 @@ static const uint8_t _message_DISABLE_TXT_INFO[] = {
// and must be smaller than the period. It is only valid when the powerSetupValue is set to Interval; otherwise,
// it must be set to '0'.
// This command applies to M8 products
static const uint8_t _message_PMS[] = {
const uint8_t GPS::_message_PMS[] = {
0x00, // Version (0)
0x03, // Power setup value 3 = Agresssive 1Hz
0x00, 0x00, // period: not applicable, set to 0
@@ -320,14 +318,14 @@ static const uint8_t _message_PMS[] = {
0x00, 0x00 // reserved, generated by u-center
};
static const uint8_t _message_SAVE[] = {
const uint8_t GPS::_message_SAVE[] = {
0x00, 0x00, 0x00, 0x00, // clearMask: no sections cleared
0xFF, 0xFF, 0x00, 0x00, // saveMask: save all sections
0x00, 0x00, 0x00, 0x00, // loadMask: no sections loaded
0x17 // deviceMask: BBR, Flash, EEPROM, and SPI Flash
};
static const uint8_t _message_SAVE_10[] = {
const uint8_t GPS::_message_SAVE_10[] = {
0x00, 0x00, 0x00, 0x00, // clearMask: no sections cleared
0xFF, 0xFF, 0x00, 0x00, // saveMask: save all sections
0x00, 0x00, 0x00, 0x00, // loadMask: no sections loaded
@@ -377,12 +375,12 @@ LIMITPEAKCURRENT L 1
// b5 62 06 8a 26 00 00 02 00 00 01 00 d0 20 02 02 00 d0 40 05 00 00 00 05 00 d0 30 01 00 08 00 d0 10 01 09 00 d0 10 01 10 00 d0
// 10 01 8c 03
*/
static const uint8_t _message_VALSET_PM_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd0, 0x20, 0x02, 0x02, 0x00, 0xd0, 0x40,
0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xd0, 0x30, 0x01, 0x00, 0x08, 0x00, 0xd0,
0x10, 0x01, 0x09, 0x00, 0xd0, 0x10, 0x01, 0x10, 0x00, 0xd0, 0x10, 0x01};
static const uint8_t _message_VALSET_PM_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0xd0, 0x20, 0x02, 0x02, 0x00, 0xd0, 0x40,
0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xd0, 0x30, 0x01, 0x00, 0x08, 0x00, 0xd0,
0x10, 0x01, 0x09, 0x00, 0xd0, 0x10, 0x01, 0x10, 0x00, 0xd0, 0x10, 0x01};
const uint8_t GPS::_message_VALSET_PM_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0xd0, 0x20, 0x02, 0x02, 0x00, 0xd0, 0x40,
0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xd0, 0x30, 0x01, 0x00, 0x08, 0x00, 0xd0,
0x10, 0x01, 0x09, 0x00, 0xd0, 0x10, 0x01, 0x10, 0x00, 0xd0, 0x10, 0x01};
const uint8_t GPS::_message_VALSET_PM_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0xd0, 0x20, 0x02, 0x02, 0x00, 0xd0, 0x40,
0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0xd0, 0x30, 0x01, 0x00, 0x08, 0x00, 0xd0,
0x10, 0x01, 0x09, 0x00, 0xd0, 0x10, 0x01, 0x10, 0x00, 0xd0, 0x10, 0x01};
/*
CFG-ITFM replaced by 5 valset messages which can be combined into one for RAM and one for BBR
@@ -396,10 +394,10 @@ CFG-ITFM replaced by 5 valset messages which can be combined into one for RAM an
b5 62 06 8a 0e 00 00 01 00 00 0d 00 41 10 01 13 00 41 10 01 63 c6
*/
static const uint8_t _message_VALSET_ITFM_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x41,
0x10, 0x01, 0x13, 0x00, 0x41, 0x10, 0x01};
static const uint8_t _message_VALSET_ITFM_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x0d, 0x00, 0x41,
0x10, 0x01, 0x13, 0x00, 0x41, 0x10, 0x01};
const uint8_t GPS::_message_VALSET_ITFM_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x0d, 0x00, 0x41,
0x10, 0x01, 0x13, 0x00, 0x41, 0x10, 0x01};
const uint8_t GPS::_message_VALSET_ITFM_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x0d, 0x00, 0x41,
0x10, 0x01, 0x13, 0x00, 0x41, 0x10, 0x01};
// Turn off all NMEA messages:
// Ram layer config message:
@@ -409,13 +407,13 @@ static const uint8_t _message_VALSET_ITFM_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x0d,
// BBR layer config message:
// b5 62 06 8a 13 00 00 02 00 00 ca 00 91 20 00 c5 00 91 20 00 b1 00 91 20 00 f8 4e
static const uint8_t _message_VALSET_DISABLE_NMEA_RAM[] = {
const uint8_t GPS::_message_VALSET_DISABLE_NMEA_RAM[] = {
/*0x00, 0x01, 0x00, 0x00, 0xca, 0x00, 0x91, 0x20, 0x00, 0xc5, 0x00, 0x91, 0x20, 0x00, 0xb1, 0x00, 0x91, 0x20, 0x00 */
0x00, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x91, 0x20, 0x00, 0xca, 0x00, 0x91, 0x20, 0x00, 0xc5, 0x00, 0x91,
0x20, 0x00, 0xac, 0x00, 0x91, 0x20, 0x00, 0xb1, 0x00, 0x91, 0x20, 0x00, 0xbb, 0x00, 0x91, 0x20, 0x00};
static const uint8_t _message_VALSET_DISABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x91, 0x20, 0x00, 0xc5,
0x00, 0x91, 0x20, 0x00, 0xb1, 0x00, 0x91, 0x20, 0x00};
const uint8_t GPS::_message_VALSET_DISABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x91, 0x20, 0x00, 0xc5,
0x00, 0x91, 0x20, 0x00, 0xb1, 0x00, 0x91, 0x20, 0x00};
// Turn off text info messages:
// Ram layer config message:
@@ -434,17 +432,17 @@ static const uint8_t _message_VALSET_DISABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x0
// b5 62 06 8a 0e 00 00 04 00 00 bb 00 91 20 01 ac 00 91 20 01 6d b6
// Doing this for the FLASH layer isn't really required since we save the config to flash later
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03};
static const uint8_t _message_VALSET_DISABLE_TXT_INFO_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03};
const uint8_t GPS::_message_VALSET_DISABLE_TXT_INFO_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03};
const uint8_t GPS::_message_VALSET_DISABLE_TXT_INFO_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x07, 0x00, 0x92, 0x20, 0x03};
static const uint8_t _message_VALSET_ENABLE_NMEA_RAM[] = {0x00, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x91,
0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01};
static const uint8_t _message_VALSET_ENABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xbb, 0x00, 0x91,
0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01};
static const uint8_t _message_VALSET_DISABLE_SBAS_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x31,
0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00};
static const uint8_t _message_VALSET_DISABLE_SBAS_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x31,
0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00};
const uint8_t GPS::_message_VALSET_ENABLE_NMEA_RAM[] = {0x00, 0x01, 0x00, 0x00, 0xbb, 0x00, 0x91,
0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01};
const uint8_t GPS::_message_VALSET_ENABLE_NMEA_BBR[] = {0x00, 0x02, 0x00, 0x00, 0xbb, 0x00, 0x91,
0x20, 0x01, 0xac, 0x00, 0x91, 0x20, 0x01};
const uint8_t GPS::_message_VALSET_DISABLE_SBAS_RAM[] = {0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x31,
0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00};
const uint8_t GPS::_message_VALSET_DISABLE_SBAS_BBR[] = {0x00, 0x02, 0x00, 0x00, 0x20, 0x00, 0x31,
0x10, 0x00, 0x05, 0x00, 0x31, 0x10, 0x00};
/*
Operational issues with the M10:
@@ -477,4 +475,4 @@ b5 62 06 8a 0e 00 00 01 00 00 20 00 31 10 00 05 00 31 10 00 46 87
BBR layer config message:
b5 62 06 8a 0e 00 00 02 00 00 20 00 31 10 00 05 00 31 10 00 47 94
*/
*/

View File

@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Screen.h"
#include "../userPrefs.h"
#include "PowerMon.h"
#include "Throttle.h"
#include "configuration.h"
@@ -1419,7 +1420,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
}
bool hasNodeHeading = false;
if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading())) {
if (ourNode && (hasValidPosition(ourNode) || screen->hasHeading())) {
const meshtastic_PositionLite &op = ourNode->position;
float myHeading;
if (screen->hasHeading())
@@ -1428,7 +1429,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
myHeading = screen->estimatedHeading(DegD(op.latitude_i), DegD(op.longitude_i));
screen->drawCompassNorth(display, compassX, compassY, myHeading);
if (nodeDB->hasValidPosition(node)) {
if (hasValidPosition(node)) {
// display direction toward node
hasNodeHeading = true;
const meshtastic_PositionLite &p = node->position;

View File

@@ -1,6 +1,5 @@
#pragma once
#include "../userPrefs.h"
#include "configuration.h"
#include "detect/ScanI2C.h"

View File

@@ -27,22 +27,14 @@
#define FONT_SMALL ArialMT_Plain_10_RU
#else
#ifdef OLED_UA
#define FONT_SMALL ArialMT_Plain_10_UA // Height: 13
#define FONT_SMALL ArialMT_Plain_10_UA
#else
#define FONT_SMALL ArialMT_Plain_10 // Height: 13
#endif
#endif
#endif
#ifdef OLED_UA
#define FONT_MEDIUM ArialMT_Plain_16_UA // Height: 19
#else
#define FONT_MEDIUM ArialMT_Plain_16 // Height: 19
#endif
#ifdef OLED_UA
#define FONT_LARGE ArialMT_Plain_24_UA // Height: 28
#else
#define FONT_LARGE ArialMT_Plain_24 // Height: 28
#endif
#define FONT_LARGE ArialMT_Plain_24 // Height: 28
#endif
#define _fontHeight(font) ((font)[1] + 1) // height is position 1

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,4 @@
#endif
extern const uint8_t ArialMT_Plain_10_UA[] PROGMEM;
extern const uint8_t ArialMT_Plain_16_UA[] PROGMEM;
extern const uint8_t ArialMT_Plain_24_UA[] PROGMEM;
#endif

View File

@@ -49,11 +49,10 @@ void CardKbI2cImpl::init()
kb_model = 0x00;
}
}
LOG_DEBUG("Keyboard Type: 0x%02x Model: 0x%02x Address: 0x%02x", kb_info.type, kb_model, cardkb_found.address);
if (cardkb_found.address == 0x00) {
disable();
return;
} else {
LOG_DEBUG("Keyboard Type: 0x%02x Model: 0x%02x Address: 0x%02x", kb_info.type, kb_model, cardkb_found.address);
}
}
#else

View File

@@ -14,13 +14,13 @@
#include "FSCommon.h"
#include "Led.h"
#include "RTC.h"
#include "SPILock.h"
#include "Throttle.h"
#include "concurrency/OSThread.h"
#include "concurrency/Periodic.h"
#include "detect/ScanI2C.h"
#include "error.h"
#include "gps/RTC.h"
#include "power.h"
#if !MESHTASTIC_EXCLUDE_I2C
@@ -28,6 +28,7 @@
#include <Wire.h>
#endif
#include "detect/einkScan.h"
#include "gps/RTC.h"
#include "graphics/RAKled.h"
#include "graphics/Screen.h"
#include "main.h"
@@ -103,7 +104,7 @@ NRF52Bluetooth *nrf52Bluetooth = nullptr;
#include "AmbientLightingThread.h"
#include "PowerFSMThread.h"
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_APOLLO3)
#include "motion/AccelerometerThread.h"
AccelerometerThread *accelerometerThread = nullptr;
#endif
@@ -150,6 +151,10 @@ ScanI2C::DeviceAddress accelerometer_found = ScanI2C::ADDRESS_NONE;
// The I2C address of the RGB LED (if found)
ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE);
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
ATECCX08A atecc;
#endif
#ifdef T_WATCH_S3
Adafruit_DRV2605 drv;
#endif
@@ -568,37 +573,49 @@ void setup()
LOG_DEBUG("acc_info = %i", acc_info.type);
#endif
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::BME_680, meshtastic_TelemetrySensorType_BME680);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::BME_280, meshtastic_TelemetrySensorType_BME280);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::BMP_280, meshtastic_TelemetrySensorType_BMP280);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::BMP_3XX, meshtastic_TelemetrySensorType_BMP3XX);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::BMP_085, meshtastic_TelemetrySensorType_BMP085);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::INA260, meshtastic_TelemetrySensorType_INA260);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::INA219, meshtastic_TelemetrySensorType_INA219);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::INA3221, meshtastic_TelemetrySensorType_INA3221);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MAX17048, meshtastic_TelemetrySensorType_MAX17048);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MCP9808, meshtastic_TelemetrySensorType_MCP9808);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MCP9808, meshtastic_TelemetrySensorType_MCP9808);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::SHT31, meshtastic_TelemetrySensorType_SHT31);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::SHTC3, meshtastic_TelemetrySensorType_SHTC3);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::LPS22HB, meshtastic_TelemetrySensorType_LPS22);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::QMC6310, meshtastic_TelemetrySensorType_QMC6310);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::QMI8658, meshtastic_TelemetrySensorType_QMI8658);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::QMC5883L, meshtastic_TelemetrySensorType_QMC5883L);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::HMC5883L, meshtastic_TelemetrySensorType_QMC5883L);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::PMSA0031, meshtastic_TelemetrySensorType_PMSA003I);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::RCWL9620, meshtastic_TelemetrySensorType_RCWL9620);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::VEML7700, meshtastic_TelemetrySensorType_VEML7700);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::TSL2591, meshtastic_TelemetrySensorType_TSL25911FN);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::OPT3001, meshtastic_TelemetrySensorType_OPT3001);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MLX90632, meshtastic_TelemetrySensorType_MLX90632);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MLX90614, meshtastic_TelemetrySensorType_MLX90614);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::SHT4X, meshtastic_TelemetrySensorType_SHT4X);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::AHT10, meshtastic_TelemetrySensorType_AHT10);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::DFROBOT_LARK, meshtastic_TelemetrySensorType_DFROBOT_LARK);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::ICM20948, meshtastic_TelemetrySensorType_ICM20948);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::MAX30102, meshtastic_TelemetrySensorType_MAX30102);
scannerToSensorsMap(i2cScanner, ScanI2C::DeviceType::CGRADSENS, meshtastic_TelemetrySensorType_RADSENS);
#define STRING(S) #S
#define SCANNER_TO_SENSORS_MAP(SCANNER_T, PB_T) \
{ \
auto found = i2cScanner->find(SCANNER_T); \
if (found.type != ScanI2C::DeviceType::NONE) { \
nodeTelemetrySensorsMap[PB_T].first = found.address.address; \
nodeTelemetrySensorsMap[PB_T].second = i2cScanner->fetchI2CBus(found.address); \
LOG_DEBUG("found i2c sensor %s", STRING(PB_T)); \
} \
}
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::BME_680, meshtastic_TelemetrySensorType_BME680)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::BME_280, meshtastic_TelemetrySensorType_BME280)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::BMP_280, meshtastic_TelemetrySensorType_BMP280)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::BMP_3XX, meshtastic_TelemetrySensorType_BMP3XX)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::BMP_085, meshtastic_TelemetrySensorType_BMP085)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::INA260, meshtastic_TelemetrySensorType_INA260)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::INA219, meshtastic_TelemetrySensorType_INA219)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::INA3221, meshtastic_TelemetrySensorType_INA3221)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MAX17048, meshtastic_TelemetrySensorType_MAX17048)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MCP9808, meshtastic_TelemetrySensorType_MCP9808)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MCP9808, meshtastic_TelemetrySensorType_MCP9808)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::SHT31, meshtastic_TelemetrySensorType_SHT31)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::SHTC3, meshtastic_TelemetrySensorType_SHTC3)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::LPS22HB, meshtastic_TelemetrySensorType_LPS22)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::QMC6310, meshtastic_TelemetrySensorType_QMC6310)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::QMI8658, meshtastic_TelemetrySensorType_QMI8658)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::QMC5883L, meshtastic_TelemetrySensorType_QMC5883L)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::HMC5883L, meshtastic_TelemetrySensorType_QMC5883L)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::PMSA0031, meshtastic_TelemetrySensorType_PMSA003I)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::RCWL9620, meshtastic_TelemetrySensorType_RCWL9620)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::VEML7700, meshtastic_TelemetrySensorType_VEML7700)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::TSL2591, meshtastic_TelemetrySensorType_TSL25911FN)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::OPT3001, meshtastic_TelemetrySensorType_OPT3001)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MLX90632, meshtastic_TelemetrySensorType_MLX90632)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MLX90614, meshtastic_TelemetrySensorType_MLX90614)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::SHT4X, meshtastic_TelemetrySensorType_SHT4X)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::AHT10, meshtastic_TelemetrySensorType_AHT10)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::DFROBOT_LARK, meshtastic_TelemetrySensorType_DFROBOT_LARK)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::ICM20948, meshtastic_TelemetrySensorType_ICM20948)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::MAX30102, meshtastic_TelemetrySensorType_MAX30102)
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::CGRADSENS, meshtastic_TelemetrySensorType_RADSENS)
i2cScanner.reset();
#endif
@@ -674,7 +691,7 @@ void setup()
#endif
#if !MESHTASTIC_EXCLUDE_I2C
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
if (acc_info.type != ScanI2C::DeviceType::NONE) {
accelerometerThread = new AccelerometerThread(acc_info.type);
}
@@ -682,7 +699,7 @@ void setup()
#if defined(HAS_NEOPIXEL) || defined(UNPHONE) || defined(RGBLED_RED)
ambientLightingThread = new AmbientLightingThread(ScanI2C::DeviceType::NONE);
#elif !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
#elif !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
if (rgb_found.type != ScanI2C::DeviceType::NONE) {
ambientLightingThread = new AmbientLightingThread(rgb_found.type);
}
@@ -1176,19 +1193,6 @@ extern meshtastic_DeviceMetadata getDeviceMetadata()
#endif
return deviceMetadata;
}
#if !MESHTASTIC_EXCLUDE_I2C
void scannerToSensorsMap(const std::unique_ptr<ScanI2CTwoWire> &i2cScanner, ScanI2C::DeviceType deviceType,
meshtastic_TelemetrySensorType sensorType)
{
auto found = i2cScanner->find(deviceType);
if (found.type != ScanI2C::DeviceType::NONE) {
nodeTelemetrySensorsMap[sensorType].first = found.address.address;
nodeTelemetrySensorsMap[sensorType].second = i2cScanner->fetchI2CBus(found.address);
}
}
#endif
#ifndef PIO_UNIT_TESTING
void loop()
{

View File

@@ -10,6 +10,9 @@
#include "mesh/generated/meshtastic/telemetry.pb.h"
#include <SPI.h>
#include <map>
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
#include <SparkFun_ATECCX08a_Arduino_Library.h>
#endif
#if defined(ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2)
#include "nimble/NimbleBluetooth.h"
extern NimbleBluetooth *nimbleBluetooth;
@@ -18,9 +21,6 @@ extern NimbleBluetooth *nimbleBluetooth;
#include "NRF52Bluetooth.h"
extern NRF52Bluetooth *nrf52Bluetooth;
#endif
#if !MESHTASTIC_EXCLUDE_I2C
#include "detect/ScanI2CTwoWire.h"
#endif
#if ARCH_PORTDUINO
extern HardwareSPI *DisplaySPI;
@@ -39,6 +39,10 @@ extern bool pmu_found;
extern bool isCharging;
extern bool isUSBPowered;
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3)
extern ATECCX08A atecc;
#endif
#ifdef T_WATCH_S3
#include <Adafruit_DRV2605.h>
extern Adafruit_DRV2605 drv;
@@ -80,10 +84,6 @@ extern bool pauseBluetoothLogging;
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), rp2040Setup(), clearBonds(), enterDfuMode();
meshtastic_DeviceMetadata getDeviceMetadata();
#if !MESHTASTIC_EXCLUDE_I2C
void scannerToSensorsMap(const std::unique_ptr<ScanI2CTwoWire> &i2cScanner, ScanI2C::DeviceType deviceType,
meshtastic_TelemetrySensorType sensorType);
#endif
// We default to 4MHz SPI, SPI mode 0
extern SPISettings spiSettings;

View File

@@ -9,8 +9,8 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "TypeConversions.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"
@@ -271,7 +271,7 @@ bool MeshService::trySendPosition(NodeNum dest, bool wantReplies)
assert(node);
if (nodeDB->hasValidPosition(node)) {
if (hasValidPosition(node)) {
#if HAS_GPS && !MESHTASTIC_EXCLUDE_GPS
if (positionModule) {
LOG_INFO("Send position ping to 0x%x, wantReplies=%d, channel=%d", dest, wantReplies, node->channel);

View File

@@ -12,11 +12,11 @@
#include "NodeDB.h"
#include "PacketHistory.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Router.h"
#include "SafeFile.h"
#include "TypeConversions.h"
#include "error.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"
@@ -542,7 +542,7 @@ void NodeDB::initConfigIntervals()
config.display.screen_on_secs = default_screen_on_secs;
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014)
#if defined(T_WATCH_S3) || defined(T_DECK) || defined(RAK14014) || defined(SENSECAP_INDICATOR)
config.power.is_power_saving = true;
config.display.screen_on_secs = 30;
config.power.wait_bluetooth_secs = 30;
@@ -1275,14 +1275,10 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
powerFSM.trigger(EVENT_NODEDB_UPDATED);
notifyObservers(true); // Force an update whether or not our node counts have changed
// We just changed something about a User,
// store our DB unless we just did so less than a minute ago
if (!Throttle::isWithinTimespanMs(lastNodeDbSave, ONE_MINUTE_MS)) {
saveToDisk(SEGMENT_DEVICESTATE);
lastNodeDbSave = millis();
} else {
LOG_DEBUG("Defer NodeDB saveToDisk for now");
}
// We just changed something about the user, store our DB
Throttle::execute(
&lastNodeDbSave, ONE_MINUTE_MS, []() { nodeDB->saveToDisk(SEGMENT_DEVICESTATE); },
[]() { LOG_DEBUG("Defer NodeDB saveToDisk for now"); }); // since we saved less than a minute ago
}
return changed;
@@ -1391,13 +1387,6 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
return lite;
}
/// Sometimes we will have Position objects that only have a time, so check for
/// valid lat/lon
bool NodeDB::hasValidPosition(const meshtastic_NodeInfoLite *n)
{
return n->has_position && (n->position.latitude_i != 0 || n->position.longitude_i != 0);
}
/// Record an error that should be reported via analytics
void recordCriticalError(meshtastic_CriticalErrorCode code, uint32_t address, const char *filename)
{

View File

@@ -165,8 +165,6 @@ class NodeDB
localPosition = position;
}
bool hasValidPosition(const meshtastic_NodeInfoLite *n);
private:
uint32_t lastNodeDbSave = 0; // when we last saved our db to flash
/// Find a node in our DB, create an empty NodeInfoLite if missing
@@ -219,6 +217,13 @@ extern NodeDB *nodeDB;
prefs.is_power_saving = True
*/
/// Sometimes we will have Position objects that only have a time, so check for
/// valid lat/lon
static inline bool hasValidPosition(const meshtastic_NodeInfoLite *n)
{
return n->has_position && (n->position.latitude_i != 0 || n->position.longitude_i != 0);
}
/** The current change # for radio settings. Starts at 0 on boot and any time the radio settings
* might have changed is incremented. Allows others to detect they might now be on a new channel.
*/

View File

@@ -4,8 +4,8 @@
#include "MeshRadio.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "configuration.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh-pb-constants.h"
#include "meshUtils.h"

View File

@@ -1,8 +1,7 @@
#include "StreamAPI.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "Throttle.h"
#include "configuration.h"
#include "gps/RTC.h"
#define START1 0x94
#define START2 0xc3

View File

@@ -10,7 +10,7 @@
#include "aes-ccm.h"
#if !MESHTASTIC_EXCLUDE_PKI
static void WPA_PUT_BE16(uint8_t *a, uint16_t val)
static inline void WPA_PUT_BE16(uint8_t *a, uint16_t val)
{
a[0] = val >> 8;
a[1] = val & 0xff;

View File

@@ -229,7 +229,7 @@ typedef enum _meshtastic_Constants {
/* From mesh.options
note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
outside of this envelope */
meshtastic_Constants_DATA_PAYLOAD_LEN = 233
meshtastic_Constants_DATA_PAYLOAD_LEN = 237
} meshtastic_Constants;
/* Error codes for critical errors
@@ -603,7 +603,7 @@ typedef struct _meshtastic_Routing {
};
} meshtastic_Routing;
typedef PB_BYTES_ARRAY_T(233) meshtastic_Data_payload_t;
typedef PB_BYTES_ARRAY_T(237) meshtastic_Data_payload_t;
/* (Formerly called SubPacket)
The payload portion fo a packet, this is the actual bytes that are sent
inside a radio packet (because from/to are broken out by the comms library) */
@@ -882,7 +882,7 @@ typedef struct _meshtastic_FileInfo {
uint32_t size_bytes;
} meshtastic_FileInfo;
typedef PB_BYTES_ARRAY_T(233) meshtastic_Compressed_data_t;
typedef PB_BYTES_ARRAY_T(237) meshtastic_Compressed_data_t;
/* Compressed message payload */
typedef struct _meshtastic_Compressed {
/* PortNum to determine the how to handle the compressed payload. */
@@ -1730,14 +1730,14 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg;
#define MESHTASTIC_MESHTASTIC_MESH_PB_H_MAX_SIZE meshtastic_FromRadio_size
#define meshtastic_ChunkedPayload_size 245
#define meshtastic_ClientNotification_size 415
#define meshtastic_Compressed_size 239
#define meshtastic_Data_size 269
#define meshtastic_Compressed_size 243
#define meshtastic_Data_size 273
#define meshtastic_DeviceMetadata_size 54
#define meshtastic_FileInfo_size 236
#define meshtastic_FromRadio_size 510
#define meshtastic_Heartbeat_size 0
#define meshtastic_LogRecord_size 426
#define meshtastic_MeshPacket_size 371
#define meshtastic_MeshPacket_size 375
#define meshtastic_MqttClientProxyMessage_size 501
#define meshtastic_MyNodeInfo_size 77
#define meshtastic_NeighborInfo_size 258

View File

@@ -91,7 +91,7 @@ typedef struct _meshtastic_StoreAndForward_Heartbeat {
uint32_t secondary;
} meshtastic_StoreAndForward_Heartbeat;
typedef PB_BYTES_ARRAY_T(233) meshtastic_StoreAndForward_text_t;
typedef PB_BYTES_ARRAY_T(237) meshtastic_StoreAndForward_text_t;
/* TODO: REPLACE */
typedef struct _meshtastic_StoreAndForward {
/* TODO: REPLACE */
@@ -211,7 +211,7 @@ extern const pb_msgdesc_t meshtastic_StoreAndForward_Heartbeat_msg;
#define meshtastic_StoreAndForward_Heartbeat_size 12
#define meshtastic_StoreAndForward_History_size 18
#define meshtastic_StoreAndForward_Statistics_size 50
#define meshtastic_StoreAndForward_size 238
#define meshtastic_StoreAndForward_size 242
#ifdef __cplusplus
} /* extern "C" */

View File

@@ -232,9 +232,9 @@ int handleAPIv1ToRadio(const struct _u_request *req, struct _u_response *res, vo
ulfius_add_header_to_response(res, "X-Protobuf-Schema",
"https://raw.githubusercontent.com/meshtastic/protobufs/master/meshtastic/mesh.proto");
if (strcmp(req->http_verb, "OPTIONS") == 0) {
if (req->http_verb == "OPTIONS") {
ulfius_set_response_properties(res, U_OPT_STATUS, 204);
return U_CALLBACK_COMPLETE;
return U_CALLBACK_CONTINUE;
}
byte buffer[MAX_TO_FROM_RADIO_SIZE];
@@ -269,11 +269,6 @@ int handleAPIv1FromRadio(const struct _u_request *req, struct _u_response *res,
ulfius_add_header_to_response(res, "X-Protobuf-Schema",
"https://raw.githubusercontent.com/meshtastic/protobufs/master/meshtastic/mesh.proto");
if (strcmp(req->http_verb, "OPTIONS") == 0) {
ulfius_set_response_properties(res, U_OPT_STATUS, 204);
return U_CALLBACK_COMPLETE;
}
uint8_t txBuf[MAX_STREAM_BUF_SIZE];
uint32_t len = 1;
@@ -498,9 +493,7 @@ PiWebServerThread::PiWebServerThread()
// Maximum body size sent by the client is 1 Kb
instanceWeb.max_post_body_size = 1024;
ulfius_add_endpoint_by_val(&instanceWeb, "GET", PREFIX, "/api/v1/fromradio/*", 1, &handleAPIv1FromRadio, NULL);
ulfius_add_endpoint_by_val(&instanceWeb, "OPTIONS", PREFIX, "/api/v1/fromradio/*", 1, &handleAPIv1FromRadio, NULL);
ulfius_add_endpoint_by_val(&instanceWeb, "PUT", PREFIX, "/api/v1/toradio/*", 1, &handleAPIv1ToRadio, configWeb.rootPath);
ulfius_add_endpoint_by_val(&instanceWeb, "OPTIONS", PREFIX, "/api/v1/toradio/*", 1, &handleAPIv1ToRadio, NULL);
// Add callback function to all endpoints for the Web Server
ulfius_add_endpoint_by_val(&instanceWeb, "GET", NULL, "/*", 2, &callback_static_file, &configWeb);

View File

@@ -3,7 +3,7 @@
#include "MeshService.h"
#include "NodeDB.h"
#include "PowerFSM.h"
#include "RTC.h"
#include "gps/RTC.h"
#include "meshUtils.h"
#include <FSCommon.h>
#if defined(ARCH_ESP32) && !MESHTASTIC_EXCLUDE_BLUETOOTH

View File

@@ -124,8 +124,7 @@ int32_t ExternalNotificationModule::runOnce()
if (externalTurnedOn[2] + (moduleConfig.external_notification.output_ms ? moduleConfig.external_notification.output_ms
: EXT_NOTIFICATION_MODULE_OUTPUT_MS) <
millis()) {
LOG_DEBUG("EXTERNAL 2 %d compared to %d", externalTurnedOn[2] + moduleConfig.external_notification.output_ms,
millis());
LOG_DEBUG("EXTERNAL 2 %d compared to %d", externalTurnedOn[2]+moduleConfig.external_notification.output_ms, millis());
setExternalState(2, !getExternal(2));
}
#if defined(HAS_NCP5623) || defined(RGBLED_RED) || defined(HAS_NEOPIXEL) || defined(UNPHONE)

View File

@@ -3,7 +3,7 @@
#include "SinglePortModule.h"
#include "concurrency/OSThread.h"
#include "configuration.h"
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(ARCH_APOLLO3) && !defined(CONFIG_IDF_TARGET_ESP32C6)
#include <NonBlockingRtttl.h>
#else
// Noop class for portduino.

View File

@@ -2,7 +2,7 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "gps/RTC.h"
#include <Throttle.h>
NeighborInfoModule *neighborInfoModule;

View File

@@ -4,12 +4,12 @@
#include "GPS.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "RTC.h"
#include "Router.h"
#include "TypeConversions.h"
#include "airtime.h"
#include "configuration.h"
#include "gps/GeoCoord.h"
#include "gps/RTC.h"
#include "main.h"
#include "mesh/compression/unishox2.h"
#include "meshUtils.h"
@@ -389,7 +389,7 @@ int32_t PositionModule::runOnce()
}
if (lastGpsSend == 0 || msSinceLastSend >= intervalMs) {
if (nodeDB->hasValidPosition(node)) {
if (hasValidPosition(node)) {
lastGpsSend = now;
lastGpsLatitude = node->position.latitude_i;
@@ -403,7 +403,7 @@ int32_t PositionModule::runOnce()
} else if (config.position.position_broadcast_smart_enabled) {
const meshtastic_NodeInfoLite *node2 = service->refreshLocalMeshNode(); // should guarantee there is now a position
if (nodeDB->hasValidPosition(node2)) {
if (hasValidPosition(node2)) {
// The minimum time (in seconds) that would pass before we are able to send a new position packet.
auto smartPosition = getDistanceTraveledSinceLastSend(node->position);
@@ -464,7 +464,7 @@ void PositionModule::handleNewPosition()
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
const meshtastic_NodeInfoLite *node2 = service->refreshLocalMeshNode(); // should guarantee there is now a position
// We limit our GPS broadcasts to a max rate
if (nodeDB->hasValidPosition(node2)) {
if (hasValidPosition(node2)) {
auto smartPosition = getDistanceTraveledSinceLastSend(node->position);
uint32_t msSinceLastSend = millis() - lastGpsSend;
if (smartPosition.hasTraveledOverThreshold &&
@@ -483,4 +483,4 @@ void PositionModule::handleNewPosition()
}
}
#endif
#endif

View File

@@ -205,7 +205,7 @@ int32_t SerialModule::runOnce()
uint32_t readIndex = 0;
const meshtastic_NodeInfoLite *tempNodeInfo = nodeDB->readNextMeshNode(readIndex);
while (tempNodeInfo != NULL) {
if (tempNodeInfo->has_user && nodeDB->hasValidPosition(tempNodeInfo)) {
if (tempNodeInfo->has_user && hasValidPosition(tempNodeInfo)) {
printWPL(outbuf, sizeof(outbuf), tempNodeInfo->position, tempNodeInfo->user.long_name, true);
serialPrint->printf("%s", outbuf);
}
@@ -474,7 +474,7 @@ void SerialModule::processWXSerial()
if (windDirPos != NULL) {
// Extract data after "=" for WindDir
strcpy(windDir, windDirPos + 15); // Add 15 to skip "WindDir = "
double radians = GeoCoord::toRadians(strtof(windDir, nullptr));
double radians = toRadians(strtof(windDir, nullptr));
dir_sum_sin += sin(radians);
dir_sum_cos += cos(radians);
dirCount++;
@@ -541,7 +541,7 @@ void SerialModule::processWXSerial()
double avgCos = dir_sum_cos / dirCount;
double avgRadians = atan2(avgSin, avgCos);
float dirAvg = GeoCoord::toDegrees(avgRadians);
float dirAvg = toDegrees(avgRadians);
if (dirAvg < 0) {
dirAvg += 360.0;

View File

@@ -126,7 +126,7 @@ void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state,
}
// If our node has a position:
if (ourNode && (nodeDB->hasValidPosition(ourNode) || screen->hasHeading())) {
if (ourNode && (hasValidPosition(ourNode) || screen->hasHeading())) {
const meshtastic_PositionLite &op = ourNode->position;
float myHeading;
if (screen->hasHeading())

View File

@@ -167,26 +167,17 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
if (isFromUs(p)) {
LOG_INFO("Ignore downlink message we originally sent");
packetPool.release(p);
free(e.channel_id);
free(e.gateway_id);
free(e.packet);
return;
}
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
if (moduleConfig.mqtt.encryption_enabled) {
LOG_INFO("Ignore decoded message on MQTT, encryption is enabled");
packetPool.release(p);
free(e.channel_id);
free(e.gateway_id);
free(e.packet);
return;
}
if (p->decoded.portnum == meshtastic_PortNum_ADMIN_APP) {
LOG_INFO("Ignore decoded admin packet");
packetPool.release(p);
free(e.channel_id);
free(e.gateway_id);
free(e.packet);
return;
}
p->channel = ch.index;
@@ -345,7 +336,7 @@ void MQTT::reconnect()
mqttPassword = moduleConfig.mqtt.password;
}
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
#if !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(RPI_PICO)
if (moduleConfig.mqtt.tls_enabled) {
// change default for encrypted to 8883
try {
@@ -780,4 +771,4 @@ bool MQTT::isPrivateIpAddress(const char address[])
int octet2Num = atoi(octet2);
return octet2Num >= 16 && octet2Num <= 31;
}
}

View File

@@ -35,7 +35,7 @@ class MQTT : private concurrency::OSThread
#if HAS_WIFI
WiFiClient mqttClient;
#if !defined(ARCH_PORTDUINO)
#if (defined(ESP_ARDUINO_VERSION_MAJOR) && ESP_ARDUINO_VERSION_MAJOR < 3) || defined(RPI_PICO)
#if defined(ESP_ARDUINO_VERSION_MAJOR) && ESP_ARDUINO_VERSION_MAJOR < 3
WiFiClientSecure wifiSecureClient;
#endif
#endif
@@ -130,4 +130,4 @@ class MQTT : private concurrency::OSThread
void mqttInit();
extern MQTT *mqtt;
extern MQTT *mqtt;

View File

@@ -0,0 +1,19 @@
#pragma once
#define ARCH_APOLLO3
//
// defaults for ARCH_APOLLO3 architecture
//
#ifndef HAS_RADIO
#define HAS_RADIO 1
#endif
//
// set HW_VENDOR
//
#ifndef HW_VENDOR
#define HW_VENDOR meshtastic_HardwareModel_PRIVATE_HW
#endif

View File

@@ -0,0 +1,26 @@
#include "configuration.h"
#include "gps/RTC.h"
void setBluetoothEnable(bool on) {}
void playStartMelody() {}
void updateBatteryLevel(uint8_t level) {}
void getMacAddr(uint8_t *dmac)
{
for (int i = 0; i < 6; i++)
dmac[i] = i;
}
void cpuDeepSleep(uint32_t msecToWake) {}
void initVariant() {}
/* pacify libc_nano */
extern "C" {
int _gettimeofday(struct timeval *tv, void *tzvp)
{
return -1;
}
}

View File

@@ -336,12 +336,6 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r
{
// LOG_DEBUG("Enter light sleep");
// LORA_DIO1 is an extended IO pin. Setting it as a wake-up pin will cause problems, such as the indicator device not entering
// LightSleep.
#if defined(SENSECAP_INDICATOR)
return ESP_SLEEP_WAKEUP_TIMER;
#endif
waitEnterSleep(false);
uint64_t sleepUsec = sleepMsec * 1000LL;

View File

@@ -2,6 +2,7 @@
[env:meshtastic-diy-v1]
extends = esp32_base
board = esp32doit-devkit-v1
board_level = extra
board_check = true
build_flags =
${esp32_base.build_flags}

View File

@@ -0,0 +1,11 @@
[env:heltec_capsule_sensor_v3]
extends = esp32s3_base
board = heltec_wifi_lora_32_V3
board_check = true
build_flags =
${esp32s3_base.build_flags} -I variants/heltec_capsule_sensor_v3
-D HELTEC_CAPSULE_SENSOR_V3
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output

View File

@@ -0,0 +1,53 @@
#define LED_PIN 33
#define LED_PIN2 34
#define EXT_PWR_DETECT 35
#define BUTTON_PIN 18
#define BATTERY_PIN 7 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
#define ADC_CHANNEL ADC1_GPIO7_CHANNEL
#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider
#define ADC_MULTIPLIER (4.9 * 1.045)
#define ADC_CTRL 36 // active HIGH, powers the voltage divider. Only on 1.1
#define ADC_CTRL_ENABLED HIGH
#undef GPS_RX_PIN
#undef GPS_TX_PIN
#define GPS_RX_PIN 5
#define GPS_TX_PIN 4
#define PIN_GPS_RESET 3
#define GPS_RESET_MODE LOW
#define PIN_GPS_PPS 1
#define PIN_GPS_EN 21
#define GPS_EN_ACTIVE HIGH
#define USE_SX1262
#define LORA_DIO0 -1 // a No connect on the SX1262 module
#define LORA_RESET 12
#define LORA_DIO1 14 // SX1262 IRQ
#define LORA_DIO2 13 // SX1262 BUSY
#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled
#define LORA_SCK 9
#define LORA_MISO 11
#define LORA_MOSI 10
#define LORA_CS 8
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY LORA_DIO2
#define SX126X_RESET LORA_RESET
#define SX126X_DIO2_AS_RF_SWITCH
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#define I2C_SDA 1
#define I2C_SCL 2
#define HAS_SCREEN 0
#define SENSOR_POWER_CTRL_PIN 21
#define SENSOR_POWER_ON 1
#define PERIPHERAL_WARMUP_MS 100
#define SENSOR_GPS_CONFLICT
#define ESP32S3_WAKE_TYPE ESP_EXT1_WAKEUP_ANY_HIGH

View File

@@ -1,6 +1,5 @@
[env:heltec-wireless-paper-v1_0]
extends = esp32s3_base
board_level = extra
board = heltec_wifi_lora_32_V3
build_flags =
${esp32s3_base.build_flags}

View File

@@ -1,13 +1,14 @@
[env:heltec-wireless-tracker-V1-0]
extends = esp32s3_base
board_level = extra
board = heltec_wireless_tracker
upload_protocol = esptool
build_flags =
${esp32s3_base.build_flags} -I variants/heltec_wireless_tracker_V1_0
-D HELTEC_TRACKER_V1_0
-D GPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely.
;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output
lib_deps =
${esp32s3_base.lib_deps}
lovyan03/LovyanGFX@^1.1.8

View File

@@ -0,0 +1 @@
-c -std=gnu11 -DMBED_MINIMAL_PRINTF -DMBED_TRAP_ERRORS_ENABLED=1 -Os -fdata-sections -ffunction-sections -fmessage-length=0 -fno-exceptions -fomit-frame-pointer -funsigned-char -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb

View File

@@ -0,0 +1 @@
-DAM_CUSTOM_BDADDR -DAM_PACKAGE_BGA -DARDUINO_BLE_FIX -DARM_MATH_CM4 -DCOMPONENT_FLASHIAP=1 -DCORDIO_ZERO_COPY_HCI -DDEVICE_FLASH=1 -DDEVICE_I2C=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_LPTICKER=1 -DDEVICE_MPU=1 -DDEVICE_SERIAL=1 -DDEVICE_SPI=1 -DDEVICE_STDIO_MESSAGES=1 -DDEVICE_USTICKER=1 -DFEATURE_BLE=1 -DTARGET_AMA3B1KK -DTARGET_Ambiq_Micro -DTARGET_Apollo3 -DTARGET_CORDIO -DTARGET_CORTEX -DTARGET_CORTEX_M -DTARGET_FAMILY_Apollo3 -DTARGET_LIKE_CORTEX_M4 -DTARGET_LIKE_MBED -DTARGET_M4 -DTARGET_NAME=SFE_ARTEMIS -DTARGET_RELEASE -DTARGET_RTOS_M4_M7 -DTARGET_SFE_ARTEMIS -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D__CMSIS_RTOS -D__CORTEX_M4 -D__FPU_PRESENT=1 -D__MBED_CMSIS_RTOS_CM -D__MBED__=1

View File

@@ -0,0 +1 @@
-c -fno-rtti -std=gnu++14 -DMBED_MINIMAL_PRINTF -DMBED_TRAP_ERRORS_ENABLED=1 -Os -fdata-sections -ffunction-sections -fmessage-length=0 -fno-exceptions -fomit-frame-pointer -funsigned-char -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb

View File

@@ -0,0 +1 @@
-DAM_CUSTOM_BDADDR -DAM_PACKAGE_BGA -DARDUINO_BLE_FIX -DARM_MATH_CM4 -DCOMPONENT_FLASHIAP=1 -DCORDIO_ZERO_COPY_HCI -DDEVICE_FLASH=1 -DDEVICE_I2C=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_LPTICKER=1 -DDEVICE_MPU=1 -DDEVICE_SERIAL=1 -DDEVICE_SPI=1 -DDEVICE_STDIO_MESSAGES=1 -DDEVICE_USTICKER=1 -DFEATURE_BLE=1 -DTARGET_AMA3B1KK -DTARGET_Ambiq_Micro -DTARGET_Apollo3 -DTARGET_CORDIO -DTARGET_CORTEX -DTARGET_CORTEX_M -DTARGET_FAMILY_Apollo3 -DTARGET_LIKE_CORTEX_M4 -DTARGET_LIKE_MBED -DTARGET_LoRa_THING_PLUS_expLoRaBLE -DTARGET_M4 -DTARGET_NAME=LoRa_THING_PLUS_expLoRaBLE -DTARGET_RELEASE -DTARGET_RTOS_M4_M7 -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D__CMSIS_RTOS -D__CORTEX_M4 -D__FPU_PRESENT=1 -D__MBED_CMSIS_RTOS_CM -D__MBED__=1

View File

@@ -0,0 +1,306 @@
"-iwithprefixbeforembed-os"
"-iwithprefixbeforembed-os/cmsis"
"-iwithprefixbeforembed-os/cmsis/TARGET_CORTEX_M"
"-iwithprefixbeforembed-os/components"
"-iwithprefixbeforembed-os/components/802.15.4_RF"
"-iwithprefixbeforembed-os/components/802.15.4_RF/atmel-rf-driver"
"-iwithprefixbeforembed-os/components/802.15.4_RF/atmel-rf-driver/atmel-rf-driver"
"-iwithprefixbeforembed-os/components/802.15.4_RF/atmel-rf-driver/source"
"-iwithprefixbeforembed-os/components/802.15.4_RF/mcr20a-rf-driver"
"-iwithprefixbeforembed-os/components/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver"
"-iwithprefixbeforembed-os/components/802.15.4_RF/mcr20a-rf-driver/source"
"-iwithprefixbeforembed-os/components/802.15.4_RF/stm-s2lp-rf-driver"
"-iwithprefixbeforembed-os/components/802.15.4_RF/stm-s2lp-rf-driver/source"
"-iwithprefixbeforembed-os/components/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver"
"-iwithprefixbeforembed-os/components/storage/blockdevice/COMPONENT_FLASHIAP"
"-iwithprefixbeforembed-os/components/storage/blockdevice/COMPONENT_FLASHIAP/COMMON"
"-iwithprefixbeforembed-os/components/wifi"
"-iwithprefixbeforembed-os/components/wifi/esp8266-driver"
"-iwithprefixbeforembed-os/components/wifi/esp8266-driver/ESP8266"
"-iwithprefixbeforembed-os/drivers/internal"
"-iwithprefixbeforembed-os/events"
"-iwithprefixbeforembed-os/events/internal"
"-iwithprefixbeforembed-os/features"
"-iwithprefixbeforembed-os/features/FEATURE_BLE"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble/common"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble/gap"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble/generic"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble/pal"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/ble/services"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/source"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/source/gap"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/source/generic"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_Ambiq_Micro"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_Ambiq_Micro/TARGET_Apollo3"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_Ambiq_Micro/hal"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_Ambiq_Micro/hal/apollo3"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/driver"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/source"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/hci"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal"
"-iwithprefixbeforembed-os/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation"
"-iwithprefixbeforembed-os/features/cellular"
"-iwithprefixbeforembed-os/features/cellular/framework"
"-iwithprefixbeforembed-os/features/cellular/framework/API"
"-iwithprefixbeforembed-os/features/cellular/framework/AT"
"-iwithprefixbeforembed-os/features/cellular/framework/common"
"-iwithprefixbeforembed-os/features/cellular/framework/device"
"-iwithprefixbeforembed-os/features/cellular/framework/targets"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/Altair"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/Altair/ALT1250"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/Altair/ALT1250/PPP"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/GEMALTO"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/GEMALTO/CINTERION"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/GENERIC"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/MultiTech"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/MultiTech/DragonflyNano"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/MultiTech/DragonflyNano/PPP"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL/BC95"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL/BG96"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL/EC2X"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL/M26"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/QUECTEL/UG96"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/RiotMicro"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/RiotMicro/AT"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/TELIT"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/TELIT/HE910"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/TELIT/ME310"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/TELIT/ME910"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/UBLOX"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/UBLOX/AT"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/UBLOX/N2XX"
"-iwithprefixbeforembed-os/features/cellular/framework/targets/UBLOX/PPP"
"-iwithprefixbeforembed-os/features/device_key"
"-iwithprefixbeforembed-os/features/device_key/source"
"-iwithprefixbeforembed-os/features/frameworks"
"-iwithprefixbeforembed-os/features/frameworks/greentea-client"
"-iwithprefixbeforembed-os/features/frameworks/greentea-client/greentea-client"
"-iwithprefixbeforembed-os/features/frameworks/mbed-client-cli"
"-iwithprefixbeforembed-os/features/frameworks/mbed-client-cli/mbed-client-cli"
"-iwithprefixbeforembed-os/features/frameworks/mbed-client-randlib"
"-iwithprefixbeforembed-os/features/frameworks/mbed-client-randlib/mbed-client-randlib"
"-iwithprefixbeforembed-os/features/frameworks/mbed-client-randlib/mbed-client-randlib/platform"
"-iwithprefixbeforembed-os/features/frameworks/mbed-coap"
"-iwithprefixbeforembed-os/features/frameworks/mbed-coap/mbed-coap"
"-iwithprefixbeforembed-os/features/frameworks/mbed-coap/source"
"-iwithprefixbeforembed-os/features/frameworks/mbed-coap/source/include"
"-iwithprefixbeforembed-os/features/frameworks/mbed-trace"
"-iwithprefixbeforembed-os/features/frameworks/mbed-trace/mbed-trace"
"-iwithprefixbeforembed-os/features/frameworks/nanostack-libservice"
"-iwithprefixbeforembed-os/features/frameworks/nanostack-libservice/mbed-client-libservice"
"-iwithprefixbeforembed-os/features/frameworks/nanostack-libservice/mbed-client-libservice/platform"
"-iwithprefixbeforembed-os/features/frameworks/unity"
"-iwithprefixbeforembed-os/features/frameworks/unity/unity"
"-iwithprefixbeforembed-os/features/frameworks/utest"
"-iwithprefixbeforembed-os/features/frameworks/utest/utest"
"-iwithprefixbeforembed-os/features/lorawan"
"-iwithprefixbeforembed-os/features/lorawan/lorastack"
"-iwithprefixbeforembed-os/features/lorawan/lorastack/mac"
"-iwithprefixbeforembed-os/features/lorawan/lorastack/phy"
"-iwithprefixbeforembed-os/features/lorawan/system"
"-iwithprefixbeforembed-os/features/lwipstack"
"-iwithprefixbeforembed-os/features/lwipstack/lwip"
"-iwithprefixbeforembed-os/features/lwipstack/lwip-sys"
"-iwithprefixbeforembed-os/features/lwipstack/lwip-sys/arch"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/compat"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/compat/posix"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/compat/posix/arpa"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/compat/posix/net"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/compat/posix/sys"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/lwip"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/lwip/priv"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/lwip/prot"
"-iwithprefixbeforembed-os/features/lwipstack/lwip/src/include/netif"
"-iwithprefixbeforembed-os/features/mbedtls"
"-iwithprefixbeforembed-os/features/mbedtls/inc"
"-iwithprefixbeforembed-os/features/mbedtls/inc/mbedtls"
"-iwithprefixbeforembed-os/features/mbedtls/platform"
"-iwithprefixbeforembed-os/features/mbedtls/platform/inc"
"-iwithprefixbeforembed-os/features/nanostack"
"-iwithprefixbeforembed-os/features/nanostack/coap-service"
"-iwithprefixbeforembed-os/features/nanostack/coap-service/coap-service"
"-iwithprefixbeforembed-os/features/nanostack/coap-service/source"
"-iwithprefixbeforembed-os/features/nanostack/coap-service/source/include"
"-iwithprefixbeforembed-os/features/nanostack/mbed-mesh-api"
"-iwithprefixbeforembed-os/features/nanostack/mbed-mesh-api/mbed-mesh-api"
"-iwithprefixbeforembed-os/features/nanostack/mbed-mesh-api/source"
"-iwithprefixbeforembed-os/features/nanostack/mbed-mesh-api/source/include"
"-iwithprefixbeforembed-os/features/nanostack/nanostack-hal-mbed-cmsis-rtos"
"-iwithprefixbeforembed-os/features/nanostack/nanostack-interface"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack-eventloop"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack-eventloop/nanostack-event-loop"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack-eventloop/nanostack-event-loop/platform"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack-eventloop/source"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/nanostack"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/nanostack/platform"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Bootstraps"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Fragmentation"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/IPHC_Decode"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/MAC"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Mesh"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ND"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/NVM"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/Thread"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/BorderRouter"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Common_Protocols"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Core"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Core/include"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/DHCPv6_Server"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/DHCPv6_client"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/MAC"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/MAC/virtual_rf"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/MLE"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/MPL"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/Include"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/RPL"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/Common"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/PANA"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/TLS"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/eapol"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/kmp"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols/eap_tls_sec_prot"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols/fwh_sec_prot"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols/gkh_sec_prot"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols/key_sec_prot"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Security/protocols/tls_sec_prot"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/Neighbor_cache"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/Trickle"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/blacklist"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/etx"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/fnv_hash"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/hmac"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/ieee_802_11"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/load_balance"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mac_neighbor_table"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/cpu"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/dns"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/poll"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/serial"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/mle_service"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/nd_proxy"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/nist_aes_kw"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/pan_blacklist"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/utils"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/Service_Libs/whiteboard"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/configs"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/configs/base"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/ipv6_stack"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/libDHCPv6"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/libNET"
"-iwithprefixbeforembed-os/features/nanostack/sal-stack-nanostack/source/libNET/src"
"-iwithprefixbeforembed-os/features/netsocket"
"-iwithprefixbeforembed-os/features/netsocket/ppp"
"-iwithprefixbeforembed-os/features/netsocket/ppp/include"
"-iwithprefixbeforembed-os/features/netsocket/ppp/include/polarssl"
"-iwithprefixbeforembed-os/features/nfc"
"-iwithprefixbeforembed-os/features/nfc/acore"
"-iwithprefixbeforembed-os/features/nfc/acore/acore"
"-iwithprefixbeforembed-os/features/nfc/controllers"
"-iwithprefixbeforembed-os/features/nfc/nfc"
"-iwithprefixbeforembed-os/features/nfc/nfc/ndef"
"-iwithprefixbeforembed-os/features/nfc/nfc/ndef/common"
"-iwithprefixbeforembed-os/features/nfc/stack"
"-iwithprefixbeforembed-os/features/nfc/stack/ndef"
"-iwithprefixbeforembed-os/features/nfc/stack/platform"
"-iwithprefixbeforembed-os/features/nfc/stack/tech"
"-iwithprefixbeforembed-os/features/nfc/stack/tech/iso7816"
"-iwithprefixbeforembed-os/features/nfc/stack/tech/isodep"
"-iwithprefixbeforembed-os/features/nfc/stack/tech/type4"
"-iwithprefixbeforembed-os/features/nfc/stack/transceiver"
"-iwithprefixbeforembed-os/features/nfc/stack/transceiver/pn512"
"-iwithprefixbeforembed-os/features/storage"
"-iwithprefixbeforembed-os/features/storage/blockdevice"
"-iwithprefixbeforembed-os/features/storage/filesystem"
"-iwithprefixbeforembed-os/features/storage/filesystem/fat"
"-iwithprefixbeforembed-os/features/storage/filesystem/fat/ChaN"
"-iwithprefixbeforembed-os/features/storage/filesystem/littlefs"
"-iwithprefixbeforembed-os/features/storage/filesystem/littlefs/littlefs"
"-iwithprefixbeforembed-os/features/storage/filesystem/littlefsv2"
"-iwithprefixbeforembed-os/features/storage/filesystem/littlefsv2/littlefs"
"-iwithprefixbeforembed-os/features/storage/kvstore"
"-iwithprefixbeforembed-os/features/storage/kvstore/conf"
"-iwithprefixbeforembed-os/features/storage/kvstore/direct_access_devicekey"
"-iwithprefixbeforembed-os/features/storage/kvstore/filesystemstore"
"-iwithprefixbeforembed-os/features/storage/kvstore/global_api"
"-iwithprefixbeforembed-os/features/storage/kvstore/include"
"-iwithprefixbeforembed-os/features/storage/kvstore/kv_map"
"-iwithprefixbeforembed-os/features/storage/kvstore/securestore"
"-iwithprefixbeforembed-os/features/storage/kvstore/tdbstore"
"-iwithprefixbeforembed-os/hal"
"-iwithprefixbeforembed-os/hal/usb"
"-iwithprefixbeforembed-os/platform"
"-iwithprefixbeforembed-os/platform/cxxsupport"
"-iwithprefixbeforembed-os/platform/internal"
"-iwithprefixbeforembed-os/platform/source"
"-iwithprefixbeforembed-os/platform/source/minimal-printf"
"-iwithprefixbeforembed-os/rtos"
"-iwithprefixbeforembed-os/rtos/source"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx4"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5/Include"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5/RTX"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Config"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Include"
"-iwithprefixbeforembed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TARGET_LoRa_THING_PLUS_expLoRaBLE"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TARGET_LoRa_THING_PLUS_expLoRaBLE/bsp"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/CMSIS"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/CMSIS/AmbiqMicro"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/CMSIS/AmbiqMicro/Include"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/mcu"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/mcu/apollo3"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/mcu/apollo3/hal"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/mcu/apollo3/regs"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/sdk"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/sdk/devices"
"-iwithprefixbeforembed-os/targets/TARGET_Ambiq_Micro/sdk/utils"

View File

@@ -0,0 +1 @@
-DMBED_BOOT_STACK_SIZE=1024 -DXIP_ENABLE=0 -Wl,--gc-sections -Wl,--wrap,_calloc_r -Wl,--wrap,_memalign_r -Wl,--wrap,atexit -Wl,--wrap,exit -Wl,--wrap,fprintf -Wl,--wrap,main -Wl,--wrap,printf -Wl,--wrap,snprintf -Wl,--wrap,sprintf -Wl,--wrap,vfprintf -Wl,--wrap,vprintf -Wl,--wrap,vsnprintf -Wl,--wrap,vsprintf -Wl,-n -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb

View File

@@ -0,0 +1 @@
ARDUINO_BLE_FIX

View File

@@ -0,0 +1 @@
-DAM_CUSTOM_BDADDR -DAM_PACKAGE_BGA -DARDUINO_BLE_FIX -DARM_MATH_CM4 -DCOMPONENT_FLASHIAP=1 -DCORDIO_ZERO_COPY_HCI -DDEVICE_FLASH=1 -DDEVICE_I2C=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_LPTICKER=1 -DDEVICE_MPU=1 -DDEVICE_SERIAL=1 -DDEVICE_SPI=1 -DDEVICE_STDIO_MESSAGES=1 -DDEVICE_USTICKER=1 -DFEATURE_BLE=1 -DMBED_BUILD_TIMESTAMP=1701297259.6592317 -DTARGET_AMA3B1KK -DTARGET_Ambiq_Micro -DTARGET_Apollo3 -DTARGET_CORDIO -DTARGET_CORTEX -DTARGET_CORTEX_M -DTARGET_FAMILY_Apollo3 -DTARGET_LIKE_CORTEX_M4 -DTARGET_LIKE_MBED -DTARGET_M4 -DTARGET_NAME=SFE_ARTEMIS -DTARGET_RELEASE -DTARGET_RTOS_M4_M7 -DTARGET_SFE_ARTEMIS -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D__CMSIS_RTOS -D__CORTEX_M4 -D__FPU_PRESENT=1 -D__MBED_CMSIS_RTOS_CM -D__MBED__=1

Binary file not shown.

View File

@@ -0,0 +1,434 @@
/*
* mbed SDK
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Automatically generated configuration file.
// DO NOT EDIT, content will be overwritten.
#ifndef __MBED_CONFIG_DATA__
#define __MBED_CONFIG_DATA__
// Configuration parameters
#define ATT_NUM_SIMUL_NTF 1 // set by library:cordio
#define ATT_NUM_SIMUL_WRITE_CMD 1 // set by library:cordio
#define BLE_FEATURE_EXTENDED_ADVERTISING 1 // set by library:ble
#define BLE_FEATURE_GATT_CLIENT 1 // set by library:ble
#define BLE_FEATURE_GATT_SERVER 1 // set by library:ble
#define BLE_FEATURE_PERIODIC_ADVERTISING 1 // set by library:ble
#define BLE_FEATURE_PHY_MANAGEMENT 1 // set by library:ble
#define BLE_FEATURE_PRIVACY 1 // set by library:ble
#define BLE_FEATURE_SECURE_CONNECTIONS 1 // set by library:ble
#define BLE_FEATURE_SECURITY 1 // set by library:ble
#define BLE_FEATURE_SIGNING 1 // set by library:ble
#define BLE_FEATURE_WHITELIST 1 // set by library:ble
#define BLE_ROLE_BROADCASTER 1 // set by library:ble
#define BLE_ROLE_CENTRAL 1 // set by library:ble
#define BLE_ROLE_OBSERVER 1 // set by library:ble
#define BLE_ROLE_PERIPHERAL 1 // set by library:ble
#define BLE_SECURITY_DATABASE_MAX_ENTRIES 5 // set by library:ble
#define DM_CONN_MAX 3 // set by library:cordio
#define DM_NUM_ADV_SETS 3 // set by library:cordio
#define DM_NUM_PHYS 3 // set by library:cordio
#define DM_SYNC_MAX 1 // set by library:cordio
#define L2C_COC_CHAN_MAX 1 // set by library:cordio
#define L2C_COC_REG_MAX 1 // set by library:cordio
#define MBED_CONF_ALT1250_PPP_BAUDRATE 115200 // set by library:ALT1250_PPP
#define MBED_CONF_ALT1250_PPP_PROVIDE_DEFAULT 0 // set by library:ALT1250_PPP
#define MBED_CONF_ATMEL_RF_ASSUME_SPACED_SPI 0 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_FULL_SPI_SPEED 7500000 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_FULL_SPI_SPEED_BYTE_SPACING 250 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_IRQ_THREAD_STACK_SIZE 1024 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_LOW_SPI_SPEED 3750000 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_PROVIDE_DEFAULT 0 // set by library:atmel-rf
#define MBED_CONF_ATMEL_RF_USE_SPI_SPACING_API 0 // set by library:atmel-rf
#define MBED_CONF_BLE_PRESENT 1 // set by library:ble
#define MBED_CONF_CELLULAR_CONTROL_PLANE_OPT 0 // set by library:cellular
#define MBED_CONF_CELLULAR_DEBUG_AT 0 // set by library:cellular
#define MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN 1358 // set by library:cellular
#define MBED_CONF_CELLULAR_RANDOM_MAX_START_DELAY 0 // set by library:cellular
#define MBED_CONF_CELLULAR_USE_APN_LOOKUP 0 // set by library:cellular
#define MBED_CONF_CELLULAR_USE_SMS 0 // set by library:cellular
#define MBED_CONF_CORDIO_DESIRED_ATT_MTU 23 // set by library:cordio
#define MBED_CONF_CORDIO_MAX_PREPARED_WRITES 4 // set by library:cordio
#define MBED_CONF_CORDIO_PREFERRED_TX_POWER 0 // set by library:cordio
#define MBED_CONF_CORDIO_ROUTE_UNHANDLED_COMMAND_COMPLETE_EVENTS 1 // set by library:cordio
#define MBED_CONF_CORDIO_RX_ACL_BUFFER_SIZE 70 // set by library:cordio
#define MBED_CONF_DRIVERS_QSPI_CSN QSPI_FLASH1_CSN // set by library:drivers
#define MBED_CONF_DRIVERS_QSPI_IO0 QSPI_FLASH1_IO0 // set by library:drivers
#define MBED_CONF_DRIVERS_QSPI_IO1 QSPI_FLASH1_IO1 // set by library:drivers
#define MBED_CONF_DRIVERS_QSPI_IO2 QSPI_FLASH1_IO2 // set by library:drivers
#define MBED_CONF_DRIVERS_QSPI_IO3 QSPI_FLASH1_IO3 // set by library:drivers
#define MBED_CONF_DRIVERS_QSPI_SCK QSPI_FLASH1_SCK // set by library:drivers
#define MBED_CONF_DRIVERS_UART_SERIAL_RXBUF_SIZE 256 // set by library:drivers
#define MBED_CONF_DRIVERS_UART_SERIAL_TXBUF_SIZE 256 // set by library:drivers
#define MBED_CONF_ESP8266_BUILT_IN_DNS 0 // set by library:esp8266
#define MBED_CONF_ESP8266_DEBUG 0 // set by library:esp8266
#define MBED_CONF_ESP8266_POWER_OFF_TIME_MS 3 // set by library:esp8266
#define MBED_CONF_ESP8266_POWER_ON_POLARITY 0 // set by library:esp8266
#define MBED_CONF_ESP8266_POWER_ON_TIME_MS 3 // set by library:esp8266
#define MBED_CONF_ESP8266_PROVIDE_DEFAULT 0 // set by library:esp8266
#define MBED_CONF_ESP8266_SERIAL_BAUDRATE 115200 // set by library:esp8266
#define MBED_CONF_ESP8266_SNTP_ENABLE 0 // set by library:esp8266
#define MBED_CONF_ESP8266_SNTP_SERVER0 "" // set by library:esp8266
#define MBED_CONF_ESP8266_SNTP_SERVER1 "" // set by library:esp8266
#define MBED_CONF_ESP8266_SNTP_SERVER2 "" // set by library:esp8266
#define MBED_CONF_ESP8266_SNTP_TIMEZONE 0 // set by library:esp8266
#define MBED_CONF_ESP8266_SOCKET_BUFSIZE 8192 // set by library:esp8266
#define MBED_CONF_EVENTS_PRESENT 1 // set by library:events
#define MBED_CONF_EVENTS_SHARED_DISPATCH_FROM_APPLICATION 0 // set by library:events
#define MBED_CONF_EVENTS_SHARED_EVENTSIZE 768 // set by library:events
#define MBED_CONF_EVENTS_SHARED_HIGHPRIO_EVENTSIZE 256 // set by library:events
#define MBED_CONF_EVENTS_SHARED_HIGHPRIO_STACKSIZE 1024 // set by library:events
#define MBED_CONF_EVENTS_SHARED_STACKSIZE 2048 // set by library:events
#define MBED_CONF_EVENTS_USE_LOWPOWER_TIMER_TICKER 0 // set by library:events
#define MBED_CONF_FAT_CHAN_FFS_DBG 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_CODE_PAGE 437 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_EXFAT 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_HEAPBUF 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_LOCK 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_MINIMIZE 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_NOFSINFO 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_NORTC 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_READONLY 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_REENTRANT 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_RPATH 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_TIMEOUT 1000 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_FS_TINY 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_LFN_BUF 255 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_LFN_UNICODE 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_MAX_LFN 255 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_MAX_SS 4096 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_MIN_SS 512 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_MULTI_PARTITION 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_NORTC_MDAY 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_NORTC_MON 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_NORTC_YEAR 2017 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_SFN_BUF 12 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_STRF_ENCODE 3 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_STR_VOLUME_ID 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_SYNC_T HANDLE // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_CHMOD 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_EXPAND 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_FASTSEEK 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_FIND 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_FORWARD 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_LABEL 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_LFN 3 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_MKFS 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_STRFUNC 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_USE_TRIM 1 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_VOLUMES 4 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FF_VOLUME_STRS "RAM", "NAND", "CF", "SD", "SD2", "USB", "USB2", "USB3" // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_CLUSTER 0 // set by library:fat_chan
#define MBED_CONF_FAT_CHAN_FLUSH_ON_NEW_SECTOR 1 // set by library:fat_chan
#define MBED_CONF_FILESYSTEM_PRESENT 1 // set by library:filesystem
#define MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS 0xFFFFFFFF // set by library:flashiap-block-device
#define MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE 0 // set by library:flashiap-block-device
#define MBED_CONF_GEMALTO_CINTERION_BAUDRATE 115200 // set by library:GEMALTO_CINTERION
#define MBED_CONF_GEMALTO_CINTERION_PROVIDE_DEFAULT 0 // set by library:GEMALTO_CINTERION
#define MBED_CONF_GENERIC_AT3GPP_BAUDRATE 115200 // set by library:GENERIC_AT3GPP
#define MBED_CONF_GENERIC_AT3GPP_PROVIDE_DEFAULT 0 // set by library:GENERIC_AT3GPP
#define MBED_CONF_LORA_ADR_ON 1 // set by library:lora
#define MBED_CONF_LORA_APPLICATION_EUI \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
} // set by library:lora
#define MBED_CONF_LORA_APPLICATION_KEY \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
} // set by library:lora
#define MBED_CONF_LORA_APPSKEY \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
} // set by library:lora
#define MBED_CONF_LORA_APP_PORT 15 // set by library:lora
#define MBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE 1 // set by library:lora
#define MBED_CONF_LORA_DEVICE_ADDRESS 0x00000000 // set by library:lora
#define MBED_CONF_LORA_DEVICE_EUI \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
} // set by library:lora
#define MBED_CONF_LORA_DOWNLINK_PREAMBLE_LENGTH 5 // set by library:lora
#define MBED_CONF_LORA_DUTY_CYCLE_ON 1 // set by library:lora
#define MBED_CONF_LORA_DUTY_CYCLE_ON_JOIN 1 // set by library:lora
#define MBED_CONF_LORA_FSB_MASK \
{ \
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF \
} // set by library:lora
#define MBED_CONF_LORA_FSB_MASK_CHINA \
{ \
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF \
} // set by library:lora
#define MBED_CONF_LORA_LBT_ON 0 // set by library:lora
#define MBED_CONF_LORA_MAX_SYS_RX_ERROR 5 // set by library:lora
#define MBED_CONF_LORA_NB_TRIALS 12 // set by library:lora
#define MBED_CONF_LORA_NWKSKEY \
{ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 \
} // set by library:lora
#define MBED_CONF_LORA_OVER_THE_AIR_ACTIVATION 1 // set by library:lora
#define MBED_CONF_LORA_PHY EU868 // set by library:lora
#define MBED_CONF_LORA_PUBLIC_NETWORK 1 // set by library:lora
#define MBED_CONF_LORA_TX_MAX_SIZE 64 // set by library:lora
#define MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH 8 // set by library:lora
#define MBED_CONF_LORA_WAKEUP_TIME 5 // set by library:lora
#define MBED_CONF_LWIP_ADDR_TIMEOUT 5 // set by library:lwip
#define MBED_CONF_LWIP_ADDR_TIMEOUT_MODE 1 // set by library:lwip
#define MBED_CONF_LWIP_DEBUG_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE 512 // set by library:lwip
#define MBED_CONF_LWIP_DHCP_TIMEOUT 60 // set by library:lwip
#define MBED_CONF_LWIP_ENABLE_PPP_TRACE 0 // set by library:lwip
#define MBED_CONF_LWIP_ETHERNET_ENABLED 1 // set by library:lwip
#define MBED_CONF_LWIP_IPV4_ENABLED 1 // set by library:lwip
#define MBED_CONF_LWIP_IPV6_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_IP_VER_PREF 4 // set by library:lwip
#define MBED_CONF_LWIP_L3IP_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_MBOX_SIZE 8 // set by library:lwip
#define MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT 8 // set by library:lwip
#define MBED_CONF_LWIP_MEMP_NUM_TCP_SEG 16 // set by library:lwip
#define MBED_CONF_LWIP_MEM_SIZE 1600 // set by library:lwip
#define MBED_CONF_LWIP_NUM_NETBUF 8 // set by library:lwip
#define MBED_CONF_LWIP_NUM_PBUF 8 // set by library:lwip
#define MBED_CONF_LWIP_PBUF_POOL_SIZE 5 // set by library:lwip
#define MBED_CONF_LWIP_PPP_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_PPP_IPV4_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_PPP_IPV6_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_PPP_THREAD_STACKSIZE 768 // set by library:lwip
#define MBED_CONF_LWIP_PRESENT 1 // set by library:lwip
#define MBED_CONF_LWIP_RAW_SOCKET_ENABLED 0 // set by library:lwip
#define MBED_CONF_LWIP_SOCKET_MAX 4 // set by library:lwip
#define MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY osPriorityNormal // set by library:lwip
#define MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE 1200 // set by library:lwip
#define MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT 1000 // set by library:lwip
#define MBED_CONF_LWIP_TCP_ENABLED 1 // set by library:lwip
#define MBED_CONF_LWIP_TCP_MAXRTX 6 // set by library:lwip
#define MBED_CONF_LWIP_TCP_MSS 536 // set by library:lwip
#define MBED_CONF_LWIP_TCP_SERVER_MAX 4 // set by library:lwip
#define MBED_CONF_LWIP_TCP_SND_BUF (2 * TCP_MSS) // set by library:lwip
#define MBED_CONF_LWIP_TCP_SOCKET_MAX 4 // set by library:lwip
#define MBED_CONF_LWIP_TCP_SYNMAXRTX 6 // set by library:lwip
#define MBED_CONF_LWIP_TCP_WND (4 * TCP_MSS) // set by library:lwip
#define MBED_CONF_LWIP_UDP_SOCKET_MAX 4 // set by library:lwip
#define MBED_CONF_LWIP_USE_MBED_TRACE 0 // set by library:lwip
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_MASK 0x7fff800 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_CHANNEL_PAGE 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_DEVICE_TYPE NET_6LOWPAN_ROUTER // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER 0xffff // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY \
{ \
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf \
} // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PSK_KEY_ID 1 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SECURITY_MODE NONE // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL 5 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_HEAP_SIZE 32500 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_HEAP_STAT_INFO NULL // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_MAC_NEIGH_TABLE_SIZE 32 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL 22 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_MASK 0x7fff800 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_CHANNEL_PAGE 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_COMMISSIONING_DATASET_TIMESTAMP 0x10000 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_EXTENDED_PANID \
{ \
0xf1, 0xb5, 0xa1, 0xb2, 0xc4, 0xd5, 0xa1, 0xbd \
} // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_ML_PREFIX \
{ \
0xfd, 0x0, 0x0d, 0xb8, 0x0, 0x0, 0x0, 0x0 \
} // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_NETWORK_NAME "Thread Network" // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PANID 0x0700 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_CONFIG_PSKC \
{ \
0xc8, 0xa6, 0x2e, 0xae, 0xf3, 0x68, 0xf3, 0x46, 0xa9, 0x9e, 0x57, 0x85, 0x98, 0x9d, 0x1c, 0xd0 \
} // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_DEVICE_TYPE MESH_DEVICE_TYPE_THREAD_ROUTER // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_MASTER_KEY \
{ \
0x10, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff \
} // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_PSKD "ABCDEFGH" // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_SECURITY_POLICY 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_THREAD_USE_STATIC_LINK_CONFIG 1 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_USE_MALLOC_FOR_HEAP 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_BC_CHANNEL_FUNCTION 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_BC_DWELL_INTERVAL 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_BC_FIXED_CHANNEL 65535 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_BC_INTERVAL 0 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_DEVICE_TYPE MESH_DEVICE_TYPE_WISUN_ROUTER // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_NETWORK_NAME "Wi-SUN Network" // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_OPERATING_CLASS 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_OPERATING_MODE 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_REGULATORY_DOMAIN 3 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_UC_CHANNEL_FUNCTION 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_UC_DWELL_INTERVAL 255 // set by library:mbed-mesh-api
#define MBED_CONF_MBED_MESH_API_WISUN_UC_FIXED_CHANNEL 65535 // set by library:mbed-mesh-api
#define MBED_CONF_MCR20A_PROVIDE_DEFAULT 0 // set by library:mcr20a
#define MBED_CONF_NANOSTACK_CONFIGURATION nanostack_full // set by library:nanostack
#define MBED_CONF_NANOSTACK_HAL_CRITICAL_SECTION_USABLE_FROM_INTERRUPT 0 // set by library:nanostack-hal
#define MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_DISPATCH_FROM_APPLICATION 0 // set by library:nanostack-hal
#define MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_THREAD_STACK_SIZE 6144 // set by library:nanostack-hal
#define MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_USE_MBED_EVENTS 0 // set by library:nanostack-hal
#define MBED_CONF_NANOSTACK_HAL_KVSTORE_PATH "/kv/" // set by library:nanostack-hal
#define MBED_CONF_NANOSTACK_HAL_USE_KVSTORE 0 // set by library:nanostack-hal
#define MBED_CONF_NSAPI_DEFAULT_MESH_TYPE THREAD // set by library:nsapi
#define MBED_CONF_NSAPI_DEFAULT_STACK LWIP // set by library:nsapi
#define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE // set by library:nsapi
#define MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT 10 // set by library:nsapi
#define MBED_CONF_NSAPI_DNS_CACHE_SIZE 3 // set by library:nsapi
#define MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME 10000 // set by library:nsapi
#define MBED_CONF_NSAPI_DNS_RETRIES 1 // set by library:nsapi
#define MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS 10 // set by library:nsapi
#define MBED_CONF_NSAPI_PRESENT 1 // set by library:nsapi
#define MBED_CONF_NSAPI_SOCKET_STATS_ENABLED 0 // set by library:nsapi
#define MBED_CONF_NSAPI_SOCKET_STATS_MAX_COUNT 10 // set by library:nsapi
#define MBED_CONF_PLATFORM_CALLBACK_COMPARABLE 1 // set by library:platform
#define MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL 0 // set by library:platform
#define MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED 0 // set by library:platform
#define MBED_CONF_PLATFORM_CTHUNK_COUNT_MAX 8 // set by library:platform
#define MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE 9600 // set by library:platform
#define MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO 0 // set by library:platform
#define MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED 0 // set by library:platform
#define MBED_CONF_PLATFORM_ERROR_HIST_ENABLED 0 // set by library:platform
#define MBED_CONF_PLATFORM_ERROR_HIST_SIZE 4 // set by library:platform
#define MBED_CONF_PLATFORM_ERROR_REBOOT_MAX 1 // set by library:platform
#define MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED 0 // set by library:platform
#define MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN 16 // set by library:platform
#define MBED_CONF_PLATFORM_MINIMAL_PRINTF_ENABLE_64_BIT 1 // set by library:platform
#define MBED_CONF_PLATFORM_MINIMAL_PRINTF_ENABLE_FLOATING_POINT 0 // set by library:platform
#define MBED_CONF_PLATFORM_MINIMAL_PRINTF_SET_FLOATING_POINT_MAX_DECIMALS 6 // set by library:platform
#define MBED_CONF_PLATFORM_POLL_USE_LOWPOWER_TIMER 0 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_BAUD_RATE 9600 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL 0 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES 1 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_CONVERT_TTY_NEWLINES 1 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT 1 // set by library:platform
#define MBED_CONF_PLATFORM_STDIO_MINIMAL_CONSOLE_ONLY 0 // set by library:platform
#define MBED_CONF_PLATFORM_USE_MPU 1 // set by library:platform
#define MBED_CONF_PPP_ENABLED 0 // set by library:ppp
#define MBED_CONF_PPP_ENABLE_TRACE 0 // set by library:ppp
#define MBED_CONF_PPP_IPV4_ENABLED 1 // set by library:ppp
#define MBED_CONF_PPP_IPV6_ENABLED 0 // set by library:ppp
#define MBED_CONF_PPP_MBED_EVENT_QUEUE 0 // set by library:ppp
#define MBED_CONF_PPP_THREAD_STACKSIZE 816 // set by library:ppp
#define MBED_CONF_QUECTEL_BC95_BAUDRATE 9600 // set by library:QUECTEL_BC95
#define MBED_CONF_QUECTEL_BC95_PROVIDE_DEFAULT 0 // set by library:QUECTEL_BC95
#define MBED_CONF_QUECTEL_BG96_BAUDRATE 115200 // set by library:QUECTEL_BG96
#define MBED_CONF_QUECTEL_BG96_PROVIDE_DEFAULT 0 // set by library:QUECTEL_BG96
#define MBED_CONF_QUECTEL_EC2X_BAUDRATE 115200 // set by library:QUECTEL_EC2X
#define MBED_CONF_QUECTEL_EC2X_PROVIDE_DEFAULT 0 // set by library:QUECTEL_EC2X
#define MBED_CONF_QUECTEL_EC2X_START_TIMEOUT 15000 // set by library:QUECTEL_EC2X
#define MBED_CONF_QUECTEL_M26_BAUDRATE 115200 // set by library:QUECTEL_M26
#define MBED_CONF_QUECTEL_M26_PROVIDE_DEFAULT 0 // set by library:QUECTEL_M26
#define MBED_CONF_QUECTEL_UG96_BAUDRATE 115200 // set by library:QUECTEL_UG96
#define MBED_CONF_QUECTEL_UG96_PROVIDE_DEFAULT 0 // set by library:QUECTEL_UG96
#define MBED_CONF_RM1000_AT_BAUDRATE 230400 // set by library:RM1000_AT
#define MBED_CONF_RM1000_AT_PROVIDE_DEFAULT 0 // set by library:RM1000_AT
#define MBED_CONF_RTOS_API_PRESENT 1 // set by library:rtos-api
#define MBED_CONF_RTOS_EVFLAGS_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE 512 // set by library:rtos
#define MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_DEBUG_EXTRA 0 // set by library:rtos
#define MBED_CONF_RTOS_IDLE_THREAD_STACK_SIZE_TICKLESS_EXTRA 256 // set by library:rtos
#define MBED_CONF_RTOS_MAIN_THREAD_STACK_SIZE 4096 // set by library:rtos
#define MBED_CONF_RTOS_MSGQUEUE_DATA_SIZE 0 // set by library:rtos
#define MBED_CONF_RTOS_MSGQUEUE_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_MUTEX_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_PRESENT 1 // set by library:rtos
#define MBED_CONF_RTOS_SEMAPHORE_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_THREAD_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_THREAD_STACK_SIZE 4096 // set by library:rtos
#define MBED_CONF_RTOS_THREAD_USER_STACK_SIZE 0 // set by library:rtos
#define MBED_CONF_RTOS_TIMER_NUM 0 // set by library:rtos
#define MBED_CONF_RTOS_TIMER_THREAD_STACK_SIZE 768 // set by library:rtos
#define MBED_CONF_S2LP_PROVIDE_DEFAULT 0 // set by library:s2lp
#define MBED_CONF_SARA4_PPP_BAUDRATE 115200 // set by library:SARA4_PPP
#define MBED_CONF_SARA4_PPP_PROVIDE_DEFAULT 0 // set by library:SARA4_PPP
#define MBED_CONF_STORAGE_DEFAULT_KV kv // set by library:storage
#define MBED_CONF_STORAGE_FILESYSTEM_BLOCKDEVICE default // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_EXTERNAL_BASE_ADDRESS 0 // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_EXTERNAL_SIZE 0 // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_FILESYSTEM default // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_FOLDER_PATH kvstore // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_INTERNAL_BASE_ADDRESS 0 // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_MOUNT_POINT kv // set by library:storage_filesystem
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_BLOCKDEVICE default // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_EXTERNAL_BASE_ADDRESS 0 // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_EXTERNAL_SIZE 0 // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_FILESYSTEM default // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_FOLDER_PATH kvstore // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_NO_RBP_MOUNT_POINT kv // set by library:storage_filesystem_no_rbp
#define MBED_CONF_STORAGE_FILESYSTEM_RBP_INTERNAL_SIZE 0 // set by library:storage_filesystem
#define MBED_CONF_STORAGE_STORAGE_TYPE default // set by library:storage
#define MBED_CONF_STORAGE_TDB_EXTERNAL_BLOCKDEVICE default // set by library:storage_tdb_external
#define MBED_CONF_STORAGE_TDB_EXTERNAL_EXTERNAL_BASE_ADDRESS 0 // set by library:storage_tdb_external
#define MBED_CONF_STORAGE_TDB_EXTERNAL_EXTERNAL_SIZE 0 // set by library:storage_tdb_external
#define MBED_CONF_STORAGE_TDB_EXTERNAL_INTERNAL_BASE_ADDRESS 0 // set by library:storage_tdb_external
#define MBED_CONF_STORAGE_TDB_EXTERNAL_NO_RBP_BLOCKDEVICE default // set by library:storage_tdb_external_no_rbp
#define MBED_CONF_STORAGE_TDB_EXTERNAL_NO_RBP_EXTERNAL_BASE_ADDRESS 0 // set by library:storage_tdb_external_no_rbp
#define MBED_CONF_STORAGE_TDB_EXTERNAL_NO_RBP_EXTERNAL_SIZE 0 // set by library:storage_tdb_external_no_rbp
#define MBED_CONF_STORAGE_TDB_EXTERNAL_RBP_INTERNAL_SIZE 0 // set by library:storage_tdb_external
#define MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_BASE_ADDRESS 0 // set by library:storage_tdb_internal
#define MBED_CONF_STORAGE_TDB_INTERNAL_INTERNAL_SIZE 0 // set by library:storage_tdb_internal
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400 // set by library:rtos[*]
#define MBED_CONF_TARGET_CONSOLE_UART 1 // set by target:Target
#define MBED_CONF_TARGET_DEEP_SLEEP_LATENCY 0 // set by target:Target
#define MBED_CONF_TARGET_DEFAULT_ADC_VREF NAN // set by target:Target
#define MBED_CONF_TARGET_INIT_US_TICKER_AT_BOOT 0 // set by target:Target
#define MBED_CONF_TARGET_MPU_ROM_END 0x0fffffff // set by target:Target
#define MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER 0 // set by target:Target
#define MBED_CONF_TARGET_XIP_ENABLE 0 // set by target:Target
#define MBED_CONF_TELIT_HE910_BAUDRATE 115200 // set by library:TELIT_HE910
#define MBED_CONF_TELIT_HE910_PROVIDE_DEFAULT 0 // set by library:TELIT_HE910
#define MBED_CONF_TELIT_ME310_BAUDRATE 115200 // set by library:TELIT_ME310
#define MBED_CONF_TELIT_ME310_PROVIDE_DEFAULT 0 // set by library:TELIT_ME310
#define MBED_CONF_TELIT_ME910_BAUDRATE 115200 // set by library:TELIT_ME910
#define MBED_CONF_TELIT_ME910_PROVIDE_DEFAULT 0 // set by library:TELIT_ME910
#define MBED_CONF_UBLOX_AT_BAUDRATE 115200 // set by library:UBLOX_AT
#define MBED_CONF_UBLOX_AT_PROVIDE_DEFAULT 0 // set by library:UBLOX_AT
#define MBED_CONF_UBLOX_N2XX_BAUDRATE 9600 // set by library:UBLOX_N2XX
#define MBED_CONF_UBLOX_N2XX_PROVIDE_DEFAULT 0 // set by library:UBLOX_N2XX
#define MBED_CONF_UBLOX_PPP_BAUDRATE 115200 // set by library:UBLOX_PPP
#define MBED_CONF_UBLOX_PPP_PROVIDE_DEFAULT 0 // set by library:UBLOX_PPP
#define MBED_CRC_TABLE_SIZE 16 // set by library:drivers
#define MBED_LFS2_BLOCK_CYCLES 1024 // set by library:littlefs2
#define MBED_LFS2_BLOCK_SIZE 512 // set by library:littlefs2
#define MBED_LFS2_CACHE_SIZE 64 // set by library:littlefs2
#define MBED_LFS2_ENABLE_INFO 0 // set by library:littlefs2
#define MBED_LFS2_INTRINSICS 1 // set by library:littlefs2
#define MBED_LFS2_LOOKAHEAD_SIZE 64 // set by library:littlefs2
#define MBED_LFS_BLOCK_SIZE 512 // set by library:littlefs
#define MBED_LFS_ENABLE_INFO 0 // set by library:littlefs
#define MBED_LFS_INTRINSICS 1 // set by library:littlefs
#define MBED_LFS_LOOKAHEAD 512 // set by library:littlefs
#define MBED_LFS_PROG_SIZE 64 // set by library:littlefs
#define MBED_LFS_READ_SIZE 64 // set by library:littlefs
#define MBED_STACK_DUMP_ENABLED 0 // set by library:platform
#define MEM_ALLOC malloc // set by library:mbed-trace
#define MEM_FREE free // set by library:mbed-trace
#define PPP_DEBUG 0 // set by library:ppp
#define SEC_CCM_CFG 1 // set by library:cordio
#define SMP_DB_MAX_DEVICES 3 // set by library:cordio
// Macros
#define MBEDTLS_CIPHER_MODE_CTR // defined by library:SecureStore
#define MBEDTLS_CMAC_C // defined by library:SecureStore
#define NSAPI_PPP_AVAILABLE (MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED) // defined by library:ppp
#define NS_USE_EXTERNAL_MBED_TLS // defined by library:nanostack
#define UNITY_INCLUDE_CONFIG_H // defined by library:utest
#define WSF_MS_PER_TICK 1 // defined by library:cordio
#define _RTE_ // defined by library:rtos
#endif

View File

@@ -0,0 +1,7 @@
#ifndef _PINS_ARDUINO_H_
#define _PINS_ARDUINO_H_
// API Competibility
#include "variant.h"
#endif /*_PINS_ARDUINO_H_*/

View File

@@ -0,0 +1,5 @@
[env:rak11720]
extends = apollo3_base
board = wiscore_rak11720
board_level = extra
build_flags = ${apollo3_base.build_flags} -Ivariants/rak11720 -DDEVICE_LOCALFILESYSTEM

View File

@@ -0,0 +1,17 @@
#include "variant.h"
const pin_size_t variantPinCount = 22;
PinState variantPinStates[variantPinCount] = {
{D0, 0, NULL, /*NULL, NULL, NULL,*/ NULL}, {D1, 1, NULL, /*NULL, NULL, NULL,*/ NULL},
{D2, 2, NULL, /*NULL, NULL, NULL,*/ NULL}, {D3, 3, NULL, /*NULL, NULL, NULL,*/ NULL},
{D4, 4, NULL, /*NULL, NULL, NULL,*/ NULL}, {D5, 5, NULL, /*NULL, NULL, NULL,*/ NULL},
{D6, 6, NULL, /*NULL, NULL, NULL,*/ NULL}, {D7, 7, NULL, /*NULL, NULL, NULL,*/ NULL},
{D8, 8, NULL, /*NULL, NULL, NULL,*/ NULL}, {D9, 9, NULL, /*NULL, NULL, NULL,*/ NULL},
{D10, 10, NULL, /*NULL, NULL, NULL,*/ NULL}, {D11, 11, NULL, /*NULL, NULL, NULL,*/ NULL},
{D12, 12, NULL, /*NULL, NULL, NULL,*/ NULL}, {D13, 13, NULL, /*NULL, NULL, NULL,*/ NULL},
{D14, 14, NULL, /*NULL, NULL, NULL,*/ NULL}, {D15, 15, NULL, /*NULL, NULL, NULL,*/ NULL},
{D16, 16, NULL, /*NULL, NULL, NULL,*/ NULL}, {D17, 17, NULL, /*NULL, NULL, NULL,*/ NULL},
{D18, 18, NULL, /*NULL, NULL, NULL,*/ NULL}, {D19, 19, NULL, /*NULL, NULL, NULL,*/ NULL},
{D20, 20, NULL, /*NULL, NULL, NULL,*/ NULL}, {D21, 21, NULL, /*NULL, NULL, NULL,*/ NULL},
};

190
variants/rak11720/variant.h Normal file
View File

@@ -0,0 +1,190 @@
#ifndef _VARIANT_RAK11720_
#define _VARIANT_RAK11720_
/*----------------------------------------------------------------------------
* Definitions
*----------------------------------------------------------------------------*/
// TODO
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
extern const uint32_t g_ADigitalPinMap[];
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#define portOutputRegister(port) (&AM_REGVAL(port + offsetof(GPIO_Type, WTA)))
#define portInputRegister(port) ((volatile uint32_t *)&AM_REGVAL(port + offsetof(GPIO_Type, RDA)))
#define portModeRegister(port) ()
#define digitalPinHasPWM(P) (g_ADigitalPinMap[P] > 1) // FIXME
#define digitalPinToBitMask(P) ((uint32_t)0x1 << (P % 32))
#define digitalPinToPinName(P) g_ADigitalPinMap[P]
#define digitalPinToPort(P) (GPIO_BASE + ((P & 0x20) >> 3))
// Interrupts
#define digitalPinToInterrupt(P) (P) // FIXME
/*----------------------------------------------------------------------------
* Pins
*----------------------------------------------------------------------------*/
#define PINS_COUNT (50u)
#define NUM_DIGITAL_PINS (0u)
#define NUM_ANALOG_INPUTS (0u)
#define NUM_ANALOG_OUTPUTS (0u)
#define P44 44 // LED1
#define P45 45 // LED2
#define P39 39 // UART0_TX
#define P40 40 // UART0_RX
#define P42 42 // UART1_TX
#define P43 43 // UART1_RX
#define P25 25 // I2C2_SDA
#define P27 27 // I2C2_SCL
#define P1 1 // SPI0_NSS
#define P5 5 // SPI0_SCK
#define P6 6 // SPI0_MISO
#define P7 7 // SPI0_MOSI
#define P20 20 // SWDIO
#define P21 21 // SWCLK
#define P41 41 // BOOT0 - SWO
// GP4 - GP36 - GP37 - GP38 - GP44(LED1) -GP45(LED2)
// ADC9(12), ADC8(13), ADC3(31), ADC4(32), ADC5(33)
#define P38 38 // IO1
#define P4 4 // IO2
#define P37 37 // IO3
#define P31 31 // IO4 - ADC3(31)
#define P12 12 // IO5 - ADC9(12)
#define P36 36 // IO6
#define P32 32 // IO7 - ADC4(32)
#define P13 13 // AN0 - ADC8(13)
#define P33 33 // AN1 - ADC5(33)
#define P18 18 // ANT_SW(LORA internal)
#define P17 17 // NRESET(LORA internal)
#define P16 16 // BUSY(LORA internal)
#define P15 15 // DIO1(LORA internal)
#define P14 14 // DIO2(LORA internal)
#define P11 11 // SPI_NSS(LORA internal)
#define P8 8 // SPI_CLK(LORA internal)
#define P10 10 // SPI_MOSI(LORA internal)
#define P9 9 // SPI_MISO(LORA internal)
/*
* WisBlock Base GPIO definitions
*/
#define WB_IO1 P38 // SLOT_A SLOT_B
#define WB_IO2 P4 // SLOT_A SLOT_B
#define WB_IO3 P37 // SLOT_C
#define WB_IO4 P31 // SLOT_C
#define WB_IO5 P12 // SLOT_D
#define WB_IO6 P36 // SLOT_D
#define WB_IO7 P32
#define WB_SW1 0xFF // IO_SLOT
#define WB_A0 P13 // IO_SLOT
#define WB_A1 P33 // IO_SLOT
#define WB_I2C1_SDA P25 // SENSOR_SLOT IO_SLOT
#define WB_I2C1_SCL P27 // SENSOR_SLOT IO_SLOT
#define WB_I2C2_SDA 0xFF // IO_SLOT
#define WB_I2C2_SCL 0xFF // IO_SLOT
#define WB_SPI_CS P1 // IO_SLOT
#define WB_SPI_CLK P5 // IO_SLOT
#define WB_SPI_MISO P6 // IO_SLOT
#define WB_SPI_MOSI P7 // IO_SLOT
#define WB_RXD0 P40 // IO_SLOT
#define WB_TXD0 P39 // IO_SLOT
#define WB_RXD1 P43 // SLOT_A IO_SLOT
#define WB_TXD1 P42 // SLOT_A IO_SLOT
#define WB_LED1 P44 // IO_SLOT
#define WB_LED2 P45 // IO_SLOT
// LEDs
#define PIN_LED1 WB_LED1 // PA0
#define PIN_LED2 WB_LED2 // PA1
#define LED_BUILTIN PIN_LED1
#define LED_CONN PIN_LED2
#define LED_GREEN PIN_LED1
#define LED_BLUE PIN_LED2
#define LED_STATE_ON 1 // State when LED is litted
/*
* Analog pins
*/
#define PIN_A0 P13
#define PIN_A1 P33
#define PIN_A3 P5 // channel1
#define PIN_A4 P31 // channel2
#define PIN_A5 P32 // channel4
#define PIN_A6 P36
#define PIN_A7 P7 // channel6
#define ADC_RESOLUTION 14
// Other pins
#define PIN_AREF (0)
static const uint8_t AREF = PIN_AREF;
/*
* Serial interfaces
*/
#define PIN_SERIAL0_RX WB_RXD0 // PB7
#define PIN_SERIAL0_TX WB_TXD0 // PB6
#define PIN_SERIAL1_RX WB_RXD1 // PA3
#define PIN_SERIAL1_TX WB_TXD1 // PA2
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define VARIANT_SPI_INTFCS SPI_INTERFACES_COUNT
#define PIN_SPI_CS WB_SPI_CS
#define PIN_SPI_MISO WB_SPI_MISO
#define PIN_SPI_MOSI WB_SPI_MOSI
#define PIN_SPI_SCK WB_SPI_CLK
#define VARIANT_SPI_SDI PIN_SPI_MISO
#define VARIANT_SPI_SDO PIN_SPI_MOSI
#define VARIANT_SPI_CLK PIN_SPI_SCK
static const uint8_t SS = PIN_SPI_CS;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 1
#define VARIANT_WIRE_INTFCS WIRE_INTERFACES_COUNT
#define PIN_WIRE_SDA WB_I2C1_SDA
#define PIN_WIRE_SCL WB_I2C1_SCL
#define VARIANT_Wire_SDA PIN_WIRE_SDA
#define VARIANT_Wire_SCL PIN_WIRE_SCL
#ifdef __cplusplus
}
#endif
#endif /* _VARIANT_RAK11720_ */

View File

@@ -1,4 +1,4 @@
[VERSION]
major = 2
minor = 5
build = 15
build = 14