mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-29 08:39:56 +00:00
Compare commits
4 Commits
629adc23c5
...
acca73f57e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acca73f57e | ||
|
|
2a321b53eb | ||
|
|
3a7ccc085d | ||
|
|
465776d667 |
@@ -8,11 +8,11 @@
|
||||
#define FIRMWARE_VER_CODE 8
|
||||
|
||||
#ifndef FIRMWARE_BUILD_DATE
|
||||
#define FIRMWARE_BUILD_DATE "30 Nov 2025"
|
||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
||||
#endif
|
||||
|
||||
#ifndef FIRMWARE_VERSION
|
||||
#define FIRMWARE_VERSION "v1.11.0"
|
||||
#define FIRMWARE_VERSION "v1.12.0"
|
||||
#endif
|
||||
|
||||
#if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)
|
||||
|
||||
@@ -69,11 +69,11 @@ struct NeighbourInfo {
|
||||
};
|
||||
|
||||
#ifndef FIRMWARE_BUILD_DATE
|
||||
#define FIRMWARE_BUILD_DATE "30 Nov 2025"
|
||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
||||
#endif
|
||||
|
||||
#ifndef FIRMWARE_VERSION
|
||||
#define FIRMWARE_VERSION "v1.11.0"
|
||||
#define FIRMWARE_VERSION "v1.12.0"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "repeater"
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
/* ------------------------------ Config -------------------------------- */
|
||||
|
||||
#ifndef FIRMWARE_BUILD_DATE
|
||||
#define FIRMWARE_BUILD_DATE "30 Nov 2025"
|
||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
||||
#endif
|
||||
|
||||
#ifndef FIRMWARE_VERSION
|
||||
#define FIRMWARE_VERSION "v1.11.0"
|
||||
#define FIRMWARE_VERSION "v1.12.0"
|
||||
#endif
|
||||
|
||||
#ifndef LORA_FREQ
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#define PERM_RECV_ALERTS_HI (1 << 7) // high priority alerts
|
||||
|
||||
#ifndef FIRMWARE_BUILD_DATE
|
||||
#define FIRMWARE_BUILD_DATE "30 Nov 2025"
|
||||
#define FIRMWARE_BUILD_DATE "29 Jan 2026"
|
||||
#endif
|
||||
|
||||
#ifndef FIRMWARE_VERSION
|
||||
#define FIRMWARE_VERSION "v1.11.0"
|
||||
#define FIRMWARE_VERSION "v1.12.0"
|
||||
#endif
|
||||
|
||||
#define FIRMWARE_ROLE "sensor"
|
||||
|
||||
28
variants/thinknode_m3/ThinkNodeM3Board.cpp
Normal file
28
variants/thinknode_m3/ThinkNodeM3Board.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <Arduino.h>
|
||||
#include "ThinkNodeM3Board.h"
|
||||
#include <Wire.h>
|
||||
|
||||
#include <bluefruit.h>
|
||||
|
||||
void ThinkNodeM3Board::begin() {
|
||||
NRF52Board::begin();
|
||||
btn_prev_state = HIGH;
|
||||
|
||||
Wire.begin();
|
||||
|
||||
delay(10); // give sx1262 some time to power up
|
||||
}
|
||||
|
||||
uint16_t ThinkNodeM3Board::getBattMilliVolts() {
|
||||
int adcvalue = 0;
|
||||
|
||||
analogReference(AR_INTERNAL_2_4);
|
||||
analogReadResolution(ADC_RESOLUTION);
|
||||
delay(10);
|
||||
|
||||
// ADC range is 0..2400mV and resolution is 12-bit (0..4095)
|
||||
adcvalue = analogRead(PIN_VBAT_READ);
|
||||
// Convert the raw value to compensated mv, taking the resistor-
|
||||
// divider into account (providing the actual LIPO voltage)
|
||||
return (uint16_t)((float)adcvalue * ADC_FACTOR);
|
||||
}
|
||||
54
variants/thinknode_m3/ThinkNodeM3Board.h
Normal file
54
variants/thinknode_m3/ThinkNodeM3Board.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <MeshCore.h>
|
||||
#include <helpers/NRF52Board.h>
|
||||
|
||||
#define ADC_FACTOR ((1000.0*ADC_MULTIPLIER*AREF_VOLTAGE)/ADC_MAX)
|
||||
|
||||
class ThinkNodeM3Board : public NRF52BoardDCDC {
|
||||
protected:
|
||||
#if NRF52_POWER_MANAGEMENT
|
||||
void initiateShutdown(uint8_t reason) override;
|
||||
#endif
|
||||
uint8_t btn_prev_state;
|
||||
|
||||
public:
|
||||
ThinkNodeM3Board() : NRF52Board("THINKNODE_M3_OTA") {}
|
||||
void begin();
|
||||
uint16_t getBattMilliVolts() override;
|
||||
|
||||
#if defined(P_LORA_TX_LED)
|
||||
void onBeforeTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
|
||||
}
|
||||
void onAfterTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Elecrow ThinkNode M3";
|
||||
}
|
||||
|
||||
int buttonStateChanged() {
|
||||
#ifdef BUTTON_PIN
|
||||
uint8_t v = digitalRead(BUTTON_PIN);
|
||||
if (v != btn_prev_state) {
|
||||
btn_prev_state = v;
|
||||
return (v == LOW) ? 1 : -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void powerOff() override {
|
||||
// turn off all leds, sd_power_system_off will not do this for us
|
||||
#ifdef P_LORA_TX_LED
|
||||
digitalWrite(P_LORA_TX_LED, LOW);
|
||||
#endif
|
||||
|
||||
// power off board
|
||||
sd_power_system_off();
|
||||
}
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
#include <Arduino.h>
|
||||
#include "ThinknodeM3Board.h"
|
||||
#include <Wire.h>
|
||||
|
||||
#include <bluefruit.h>
|
||||
|
||||
void ThinknodeM3Board::begin() {
|
||||
Nrf52BoardDCDC::begin();
|
||||
btn_prev_state = HIGH;
|
||||
|
||||
Wire.begin();
|
||||
|
||||
delay(10); // give sx1262 some time to power up
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <MeshCore.h>
|
||||
#include <helpers/NRF52Board.h>
|
||||
|
||||
#define ADC_FACTOR ((1000.0*ADC_MULTIPLIER*AREF_VOLTAGE)/ADC_MAX)
|
||||
|
||||
class ThinknodeM3Board : public Nrf52BoardDCDC {
|
||||
protected:
|
||||
uint8_t btn_prev_state;
|
||||
|
||||
public:
|
||||
void begin();
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
int adcvalue = 0;
|
||||
|
||||
analogReference(AR_INTERNAL_2_4);
|
||||
analogReadResolution(ADC_RESOLUTION);
|
||||
delay(10);
|
||||
|
||||
// ADC range is 0..2400mV and resolution is 12-bit (0..4095)
|
||||
adcvalue = analogRead(PIN_VBAT_READ);
|
||||
// Convert the raw value to compensated mv, taking the resistor-
|
||||
// divider into account (providing the actual LIPO voltage)
|
||||
return (uint16_t)((float)adcvalue * ADC_FACTOR);
|
||||
}
|
||||
|
||||
#if defined(P_LORA_TX_LED)
|
||||
#if !defined(P_LORA_TX_LED_ON)
|
||||
#define P_LORA_TX_LED_ON HIGH
|
||||
#endif
|
||||
void onBeforeTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, P_LORA_TX_LED_ON); // turn TX LED on
|
||||
}
|
||||
void onAfterTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, !P_LORA_TX_LED_ON); // turn TX LED off
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Elecrow ThinkNode M3";
|
||||
}
|
||||
|
||||
int buttonStateChanged() {
|
||||
#ifdef BUTTON_PIN
|
||||
uint8_t v = digitalRead(BUTTON_PIN);
|
||||
if (v != btn_prev_state) {
|
||||
btn_prev_state = v;
|
||||
return (v == LOW) ? 1 : -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void powerOff() override { sd_power_system_off(); }
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "target.h"
|
||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
|
||||
ThinknodeM3Board board;
|
||||
ThinkNodeM3Board board;
|
||||
|
||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI);
|
||||
|
||||
@@ -30,26 +30,26 @@ static const uint32_t rfswitch_dios[Module::RFSWITCH_MAX_PINS] = {
|
||||
RADIOLIB_LR11X0_DIO5,
|
||||
RADIOLIB_LR11X0_DIO6,
|
||||
RADIOLIB_NC,
|
||||
RADIOLIB_NC,
|
||||
RADIOLIB_NC,
|
||||
RADIOLIB_NC
|
||||
};
|
||||
|
||||
static const Module::RfSwitchMode_t rfswitch_table[] = {
|
||||
// mode DIO5 DIO6
|
||||
{ LR11x0::MODE_STBY, {LOW , LOW }},
|
||||
// mode DIO5 DIO6
|
||||
{ LR11x0::MODE_STBY, {LOW , LOW }},
|
||||
{ LR11x0::MODE_RX, {HIGH, LOW }},
|
||||
{ LR11x0::MODE_TX, {HIGH, HIGH }},
|
||||
{ LR11x0::MODE_TX_HP, {LOW , HIGH }},
|
||||
{ LR11x0::MODE_TX_HF, {LOW , LOW }},
|
||||
{ LR11x0::MODE_TX_HF, {LOW , LOW }},
|
||||
{ LR11x0::MODE_GNSS, {LOW , LOW }},
|
||||
{ LR11x0::MODE_WIFI, {LOW , LOW }},
|
||||
{ LR11x0::MODE_WIFI, {LOW , LOW }},
|
||||
END_OF_MODE_TABLE,
|
||||
};
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
|
||||
#ifdef LR11X0_DIO3_TCXO_VOLTAGE
|
||||
float tcxo = LR11X0_DIO3_TCXO_VOLTAGE;
|
||||
#else
|
||||
@@ -64,7 +64,7 @@ bool radio_init() {
|
||||
Serial.println(status);
|
||||
return false; // fail
|
||||
}
|
||||
|
||||
|
||||
radio.setCRC(2);
|
||||
radio.explicitHeader();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include "ThinknodeM3Board.h"
|
||||
#include "ThinkNodeM3Board.h"
|
||||
#include <helpers/radiolib/CustomLR1110Wrapper.h>
|
||||
#include <helpers/ArduinoHelpers.h>
|
||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||
@@ -17,7 +17,7 @@
|
||||
extern NullDisplayDriver display;
|
||||
#endif
|
||||
|
||||
extern ThinknodeM3Board board;
|
||||
extern ThinkNodeM3Board board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern EnvironmentSensorManager sensors;
|
||||
|
||||
@@ -12,9 +12,14 @@
|
||||
#define PIN_VBAT_READ BATTERY_PIN
|
||||
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||
|
||||
class ThinkNodeM6Board : public Nrf52BoardOTA {
|
||||
class ThinkNodeM6Board : public NRF52BoardDCDC {
|
||||
protected:
|
||||
#if NRF52_POWER_MANAGEMENT
|
||||
void initiateShutdown(uint8_t reason) override;
|
||||
#endif
|
||||
|
||||
public:
|
||||
ThinkNodeM6Board() : NRF52BoardOTA("THINKNODE_M1_OTA") {}
|
||||
ThinkNodeM6Board() : NRF52Board("THINKNODE_M6_OTA") {}
|
||||
void begin();
|
||||
uint16_t getBattMilliVolts() override;
|
||||
|
||||
@@ -25,10 +30,10 @@ public:
|
||||
void onAfterTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Elecrow ThinkNode-M6";
|
||||
return "Elecrow ThinkNode M6";
|
||||
}
|
||||
|
||||
void powerOff() override {
|
||||
|
||||
Reference in New Issue
Block a user