Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions boards/inhero_mr2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"build": {
"arduino": {
"ldscript": "nrf52840_s140_v6.ld"
},
"core": "nRF5",
"cpu": "cortex-m4",
"extra_flags": "-DARDUINO_NRF52840_FEATHER -DNRF52840_XXAA",
"f_cpu": "64000000L",
"hwids": [
[
"0x239A",
"0x8029"
],
[
"0x239A",
"0x0029"
],
[
"0x239A",
"0x002A"
],
[
"0x239A",
"0x802A"
]
],
"usb_product": "Inhero MR2",
"mcu": "nrf52840",
"variant": "Inhero_MR2_Board",
"bsp": {
"name": "adafruit"
},
"softdevice": {
"sd_flags": "-DS140",
"sd_name": "s140",
"sd_version": "6.1.1",
"sd_fwid": "0x00B6"
},
"bootloader": {
"settings_addr": "0xFF000"
}
},
"connectivity": [
"bluetooth"
],
"debug": {
"jlink_device": "nRF52840_xxAA",
"svd_path": "nrf52840.svd",
"openocd_target": "nrf52.cfg"
},
"frameworks": [
"arduino"
],
"name": "Inhero MR2",
"upload": {
"maximum_ram_size": 235520,
"maximum_size": 815104,
"speed": 115200,
"protocol": "nrfutil",
"protocols": [
"jlink",
"nrfjprog",
"nrfutil",
"stlink",
"cmsis-dap"
],
"use_1200bps_touch": true,
"require_upload_port": true,
"wait_for_upload_port": true
},
"url": "https://inhero.de",
"vendor": "Inhero GmbH"
}
5 changes: 5 additions & 0 deletions examples/simple_repeater/MyMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
}
sensors.querySensors(perm_mask, telemetry);

// board specific telemetry -- target specific
if (perm_mask & TELEM_PERM_ENVIRONMENT) {
board.queryBoardTelemetry(telemetry);
}

// This default temperature will be overridden by external sensors (if any)
float temperature = board.getMCUTemperature();
if(!isnan(temperature)) { // Supported boards with built-in temperature sensor. ESP32-C3 may return NAN
Expand Down
2 changes: 2 additions & 0 deletions examples/simple_repeater/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ void loop() {
command[0] = 0; // reset command buffer
}

board.tick(); // let the board feed its watchdog, run periodic housekeeping

#ifdef ETHERNET_ENABLED
ethernet_loop_maintain();
if (ethernet_read_line(ethernet_command, sizeof(ethernet_command))) {
Expand Down
2 changes: 2 additions & 0 deletions examples/simple_sensor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ void loop() {
command[0] = 0; // reset command buffer
}

board.tick(); // let the board feed its watchdog, run periodic housekeeping

the_mesh.loop();
sensors.loop();
#ifdef DISPLAY_CLASS
Expand Down
9 changes: 9 additions & 0 deletions src/MeshCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#define BRIDGE_DEBUG_PRINTLN(...) {}
#endif

class CayenneLPP;

namespace mesh {

#define BD_STARTUP_NORMAL 0 // getStartupReason() codes
Expand Down Expand Up @@ -74,6 +76,13 @@ class MainBoard {
virtual const char* getShutdownReasonString(uint8_t reason) { return "Not available"; }

virtual bool handleCommand(const char* command, uint32_t sender_timestamp, char* reply) { return false; }

// Called from the example main loops. Lets a board feed its watchdog and
// run periodic housekeeping. Default no-op.
virtual void tick() { /* no op */ }

// Lets a board contribute its own telemetry channels. Default no-op.
virtual bool queryBoardTelemetry(CayenneLPP& telemetry) { return false; }
};

/**
Expand Down
Loading