Rename MeshPocket V2 board and targets with Heltec prefix
This commit is contained in:
1 parent
a72a75cd08
commit
d6cd80e0e6
12 files changed
+42
-42
No files matched your search
@@ -15,7 +15,7 @@
|
|||||||
],
|
],
|
||||||
"usb_product": "pocket-v2",
|
"usb_product": "pocket-v2",
|
||||||
"mcu": "nrf52840",
|
"mcu": "nrf52840",
|
||||||
"variant": "meshpocket_v2",
|
"variant": "heltec_meshpocket_v2",
|
||||||
"bsp": {
|
"bsp": {
|
||||||
"name": "adafruit"
|
"name": "adafruit"
|
||||||
},
|
},
|
||||||
+12
-12
@@ -1,16 +1,16 @@
|
|||||||
#include "MeshPocketV2.h"
|
#include "HeltecMeshPocketV2Board.h"
|
||||||
#include "PowerBankPage.h"
|
#include "PowerBankPage.h"
|
||||||
#include <helpers/ui/BoardUiExtension.h>
|
#include <helpers/ui/BoardUiExtension.h>
|
||||||
#include <helpers/ui/MomentaryButton.h>
|
#include <helpers/ui/MomentaryButton.h>
|
||||||
#include <nrf_gpio.h>
|
#include <nrf_gpio.h>
|
||||||
|
|
||||||
class MeshPocketV2::UiExtension : public mesh::BoardUiExtension {
|
class HeltecMeshPocketV2Board::UiExtension : public mesh::BoardUiExtension {
|
||||||
MeshPocketV2& board;
|
HeltecMeshPocketV2Board& board;
|
||||||
PowerBankPage page;
|
PowerBankPage page;
|
||||||
MomentaryButton secondaryButton;
|
MomentaryButton secondaryButton;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UiExtension(MeshPocketV2& board) :
|
explicit UiExtension(HeltecMeshPocketV2Board& board) :
|
||||||
board(board), secondaryButton(PIN_BUTTON2, 1000, true, true, false) {}
|
board(board), secondaryButton(PIN_BUTTON2, 1000, true, true, false) {}
|
||||||
|
|
||||||
void begin() {
|
void begin() {
|
||||||
@@ -47,43 +47,43 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void MeshPocketV2::begin() {
|
void HeltecMeshPocketV2Board::begin() {
|
||||||
NRF52Board::begin();
|
NRF52Board::begin();
|
||||||
powerBank.begin();
|
powerBank.begin();
|
||||||
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
||||||
uiExtension().begin();
|
uiExtension().begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
MeshPocketV2::UiExtension& MeshPocketV2::uiExtension() {
|
HeltecMeshPocketV2Board::UiExtension& HeltecMeshPocketV2Board::uiExtension() {
|
||||||
static UiExtension extension(*this);
|
static UiExtension extension(*this);
|
||||||
return extension;
|
return extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh::BoardUiExtension* MeshPocketV2::getUiExtension() {
|
mesh::BoardUiExtension* HeltecMeshPocketV2Board::getUiExtension() {
|
||||||
return &uiExtension();
|
return &uiExtension();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t MeshPocketV2::getBattMilliVolts() {
|
uint16_t HeltecMeshPocketV2Board::getBattMilliVolts() {
|
||||||
const auto& status = powerBank.snapshot();
|
const auto& status = powerBank.snapshot();
|
||||||
if (status.cw.ready) return status.cw.voltageMv;
|
if (status.cw.ready) return status.cw.voltageMv;
|
||||||
return status.hltLive() ? status.hlt.batteryMv : 0;
|
return status.hltLive() ? status.hlt.batteryMv : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshPocketV2::setUsbDataEnabled(bool enabled) {
|
void HeltecMeshPocketV2Board::setUsbDataEnabled(bool enabled) {
|
||||||
digitalWrite(PIN_IO_CSA, enabled ? HIGH : LOW);
|
digitalWrite(PIN_IO_CSA, enabled ? HIGH : LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MeshPocketV2::toggleUsbData() {
|
bool HeltecMeshPocketV2Board::toggleUsbData() {
|
||||||
const bool enabled = !isUsbDataEnabled();
|
const bool enabled = !isUsbDataEnabled();
|
||||||
setUsbDataEnabled(enabled);
|
setUsbDataEnabled(enabled);
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MeshPocketV2::isUsbDataEnabled() const {
|
bool HeltecMeshPocketV2Board::isUsbDataEnabled() const {
|
||||||
return digitalRead(PIN_IO_CSA) == HIGH;
|
return digitalRead(PIN_IO_CSA) == HIGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshPocketV2::shutdownPeripherals() {
|
void HeltecMeshPocketV2Board::shutdownPeripherals() {
|
||||||
NRF52Board::shutdownPeripherals();
|
NRF52Board::shutdownPeripherals();
|
||||||
powerBank.end();
|
powerBank.end();
|
||||||
nrf_gpio_cfg_sense_input(PIN_USER_BTN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
nrf_gpio_cfg_sense_input(PIN_USER_BTN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
||||||
+2
-2
@@ -3,9 +3,9 @@
|
|||||||
#include <helpers/NRF52Board.h>
|
#include <helpers/NRF52Board.h>
|
||||||
#include "PowerBank.h"
|
#include "PowerBank.h"
|
||||||
|
|
||||||
class MeshPocketV2 : public NRF52Board {
|
class HeltecMeshPocketV2Board : public NRF52Board {
|
||||||
public:
|
public:
|
||||||
MeshPocketV2() : NRF52Board("MeshPocket_V2_OTA") {}
|
HeltecMeshPocketV2Board() : NRF52Board("MeshPocket_V2_OTA") {}
|
||||||
PowerBank powerBank;
|
PowerBank powerBank;
|
||||||
void begin() override;
|
void begin() override;
|
||||||
void loop() override { powerBank.poll(); }
|
void loop() override { powerBank.poll(); }
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+24
-24
@@ -1,10 +1,10 @@
|
|||||||
[meshpocket_v2]
|
[heltec_meshpocket_v2]
|
||||||
extends = nrf52_base
|
extends = nrf52_base
|
||||||
board = meshpocket_v2
|
board = heltec_meshpocket_v2
|
||||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||||
board_upload.maximum_size = 712704
|
board_upload.maximum_size = 712704
|
||||||
build_flags = ${nrf52_base.build_flags}
|
build_flags = ${nrf52_base.build_flags}
|
||||||
-I variants/meshpocket_v2
|
-I variants/heltec_meshpocket_v2
|
||||||
-I src/helpers/nrf52
|
-I src/helpers/nrf52
|
||||||
-I lib/nrf52/s140_nrf52_6.1.1_API/include
|
-I lib/nrf52/s140_nrf52_6.1.1_API/include
|
||||||
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
|
-I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52
|
||||||
@@ -18,7 +18,7 @@ build_flags = ${nrf52_base.build_flags}
|
|||||||
-D ENV_INCLUDE_GPS=1
|
-D ENV_INCLUDE_GPS=1
|
||||||
-D DISABLE_DIAGNOSTIC_OUTPUT
|
-D DISABLE_DIAGNOSTIC_OUTPUT
|
||||||
build_src_filter = ${nrf52_base.build_src_filter}
|
build_src_filter = ${nrf52_base.build_src_filter}
|
||||||
+<../variants/meshpocket_v2/*.cpp>
|
+<../variants/heltec_meshpocket_v2/*.cpp>
|
||||||
+<helpers/sensors/EnvironmentSensorManager.cpp>
|
+<helpers/sensors/EnvironmentSensorManager.cpp>
|
||||||
+<helpers/ui/NV3001BDisplay.cpp>
|
+<helpers/ui/NV3001BDisplay.cpp>
|
||||||
lib_deps = ${nrf52_base.lib_deps}
|
lib_deps = ${nrf52_base.lib_deps}
|
||||||
@@ -28,52 +28,52 @@ lib_deps = ${nrf52_base.lib_deps}
|
|||||||
debug_tool = jlink
|
debug_tool = jlink
|
||||||
upload_protocol = nrfutil
|
upload_protocol = nrfutil
|
||||||
|
|
||||||
[meshpocket_v2_companion]
|
[heltec_meshpocket_v2_companion]
|
||||||
extends = meshpocket_v2
|
extends = heltec_meshpocket_v2
|
||||||
build_flags = ${meshpocket_v2.build_flags}
|
build_flags = ${heltec_meshpocket_v2.build_flags}
|
||||||
-I examples/companion_radio/ui-new
|
-I examples/companion_radio/ui-new
|
||||||
-D MAX_CONTACTS=350
|
-D MAX_CONTACTS=350
|
||||||
-D MAX_GROUP_CHANNELS=40
|
-D MAX_GROUP_CHANNELS=40
|
||||||
build_src_filter = ${meshpocket_v2.build_src_filter}
|
build_src_filter = ${heltec_meshpocket_v2.build_src_filter}
|
||||||
+<../examples/companion_radio/*.cpp>
|
+<../examples/companion_radio/*.cpp>
|
||||||
+<../examples/companion_radio/ui-new/*.cpp>
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||||||
lib_deps = ${meshpocket_v2.lib_deps}
|
lib_deps = ${heltec_meshpocket_v2.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
[env:meshpocket_v2_companion_radio_ble]
|
[env:heltec_meshpocket_v2_companion_radio_ble]
|
||||||
extends = meshpocket_v2_companion
|
extends = heltec_meshpocket_v2_companion
|
||||||
build_flags = ${meshpocket_v2_companion.build_flags}
|
build_flags = ${heltec_meshpocket_v2_companion.build_flags}
|
||||||
-D BLE_PIN_CODE=123456
|
-D BLE_PIN_CODE=123456
|
||||||
-D OFFLINE_QUEUE_SIZE=256
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
build_src_filter = ${meshpocket_v2_companion.build_src_filter}
|
build_src_filter = ${heltec_meshpocket_v2_companion.build_src_filter}
|
||||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||||
|
|
||||||
[env:meshpocket_v2_companion_radio_usb]
|
[env:heltec_meshpocket_v2_companion_radio_usb]
|
||||||
extends = meshpocket_v2_companion
|
extends = heltec_meshpocket_v2_companion
|
||||||
build_flags = ${meshpocket_v2_companion.build_flags}
|
build_flags = ${heltec_meshpocket_v2_companion.build_flags}
|
||||||
-D ENABLE_USB_INTERFACE
|
-D ENABLE_USB_INTERFACE
|
||||||
-D MESHPOCKET_V2_USB_SWITCHABLE
|
-D MESHPOCKET_V2_USB_SWITCHABLE
|
||||||
|
|
||||||
[env:meshpocket_v2_repeater]
|
[env:heltec_meshpocket_v2_repeater]
|
||||||
extends = meshpocket_v2
|
extends = heltec_meshpocket_v2
|
||||||
build_flags = ${meshpocket_v2.build_flags}
|
build_flags = ${heltec_meshpocket_v2.build_flags}
|
||||||
-D MESHPOCKET_V2_USB_SWITCHABLE
|
-D MESHPOCKET_V2_USB_SWITCHABLE
|
||||||
-D ADVERT_NAME='"MeshPocket V2 Repeater"'
|
-D ADVERT_NAME='"MeshPocket V2 Repeater"'
|
||||||
-D ADVERT_LAT=0.0
|
-D ADVERT_LAT=0.0
|
||||||
-D ADVERT_LON=0.0
|
-D ADVERT_LON=0.0
|
||||||
-D ADMIN_PASSWORD='"password"'
|
-D ADMIN_PASSWORD='"password"'
|
||||||
-D MAX_NEIGHBOURS=50
|
-D MAX_NEIGHBOURS=50
|
||||||
build_src_filter = ${meshpocket_v2.build_src_filter}
|
build_src_filter = ${heltec_meshpocket_v2.build_src_filter}
|
||||||
+<../examples/simple_repeater>
|
+<../examples/simple_repeater>
|
||||||
|
|
||||||
[env:meshpocket_v2_room_server]
|
[env:heltec_meshpocket_v2_room_server]
|
||||||
extends = meshpocket_v2
|
extends = heltec_meshpocket_v2
|
||||||
build_flags = ${meshpocket_v2.build_flags}
|
build_flags = ${heltec_meshpocket_v2.build_flags}
|
||||||
-D MESHPOCKET_V2_USB_SWITCHABLE
|
-D MESHPOCKET_V2_USB_SWITCHABLE
|
||||||
-D ADVERT_NAME='"MeshPocket V2 Room"'
|
-D ADVERT_NAME='"MeshPocket V2 Room"'
|
||||||
-D ADVERT_LAT=0.0
|
-D ADVERT_LAT=0.0
|
||||||
-D ADVERT_LON=0.0
|
-D ADVERT_LON=0.0
|
||||||
-D ADMIN_PASSWORD='"password"'
|
-D ADMIN_PASSWORD='"password"'
|
||||||
-D ROOM_PASSWORD='"hello"'
|
-D ROOM_PASSWORD='"hello"'
|
||||||
build_src_filter = ${meshpocket_v2.build_src_filter}
|
build_src_filter = ${heltec_meshpocket_v2.build_src_filter}
|
||||||
+<../examples/simple_room_server>
|
+<../examples/simple_room_server>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||||
|
|
||||||
MeshPocketV2 board;
|
HeltecMeshPocketV2Board board;
|
||||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
|
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
|
||||||
WRAPPER_CLASS radio_driver(radio, board);
|
WRAPPER_CLASS radio_driver(radio, board);
|
||||||
VolatileRTCClock rtc_clock;
|
VolatileRTCClock rtc_clock;
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||||
#include <helpers/ui/MomentaryButton.h>
|
#include <helpers/ui/MomentaryButton.h>
|
||||||
#include <helpers/ui/NV3001BDisplay.h>
|
#include <helpers/ui/NV3001BDisplay.h>
|
||||||
#include "MeshPocketV2.h"
|
#include "HeltecMeshPocketV2Board.h"
|
||||||
|
|
||||||
extern MeshPocketV2 board;
|
extern HeltecMeshPocketV2Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
extern VolatileRTCClock rtc_clock;
|
extern VolatileRTCClock rtc_clock;
|
||||||
extern EnvironmentSensorManager sensors;
|
extern EnvironmentSensorManager sensors;
|
||||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user