mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 02:09:57 +00:00
Cleanup and exclude external sensor macro to make T1000-E binaries much smaller
This commit is contained in:
parent
ad726ad684
commit
31a5b9c122
@ -1106,7 +1106,6 @@ bool AdminModule::messageIsResponse(const meshtastic_AdminMessage *r)
|
|||||||
r->which_payload_variant == meshtastic_AdminMessage_get_ringtone_response_tag ||
|
r->which_payload_variant == meshtastic_AdminMessage_get_ringtone_response_tag ||
|
||||||
r->which_payload_variant == meshtastic_AdminMessage_get_device_connection_status_response_tag ||
|
r->which_payload_variant == meshtastic_AdminMessage_get_device_connection_status_response_tag ||
|
||||||
r->which_payload_variant == meshtastic_AdminMessage_get_node_remote_hardware_pins_response_tag ||
|
r->which_payload_variant == meshtastic_AdminMessage_get_node_remote_hardware_pins_response_tag ||
|
||||||
r->which_payload_variant == meshtastic_NodeRemoteHardwarePinsResponse_node_remote_hardware_pins_tag ||
|
|
||||||
r->which_payload_variant == meshtastic_AdminMessage_get_ui_config_response_tag)
|
r->which_payload_variant == meshtastic_AdminMessage_get_ui_config_response_tag)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <OLEDDisplay.h>
|
#include <OLEDDisplay.h>
|
||||||
#include <OLEDDisplayUi.h>
|
#include <OLEDDisplayUi.h>
|
||||||
|
|
||||||
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL
|
||||||
// Sensors
|
// Sensors
|
||||||
#include "Sensor/AHT10.h"
|
#include "Sensor/AHT10.h"
|
||||||
#include "Sensor/BME280Sensor.h"
|
#include "Sensor/BME280Sensor.h"
|
||||||
@ -36,7 +37,6 @@
|
|||||||
#include "Sensor/SHT31Sensor.h"
|
#include "Sensor/SHT31Sensor.h"
|
||||||
#include "Sensor/SHT4XSensor.h"
|
#include "Sensor/SHT4XSensor.h"
|
||||||
#include "Sensor/SHTC3Sensor.h"
|
#include "Sensor/SHTC3Sensor.h"
|
||||||
#include "Sensor/T1000xSensor.h"
|
|
||||||
#include "Sensor/TSL2591Sensor.h"
|
#include "Sensor/TSL2591Sensor.h"
|
||||||
#include "Sensor/VEML7700Sensor.h"
|
#include "Sensor/VEML7700Sensor.h"
|
||||||
|
|
||||||
@ -58,11 +58,12 @@ MLX90632Sensor mlx90632Sensor;
|
|||||||
DFRobotLarkSensor dfRobotLarkSensor;
|
DFRobotLarkSensor dfRobotLarkSensor;
|
||||||
NAU7802Sensor nau7802Sensor;
|
NAU7802Sensor nau7802Sensor;
|
||||||
BMP3XXSensor bmp3xxSensor;
|
BMP3XXSensor bmp3xxSensor;
|
||||||
|
CGRadSensSensor cgRadSens;
|
||||||
|
#endif
|
||||||
#ifdef T1000X_SENSOR_EN
|
#ifdef T1000X_SENSOR_EN
|
||||||
|
#include "Sensor/T1000xSensor.h"
|
||||||
T1000xSensor t1000xSensor;
|
T1000xSensor t1000xSensor;
|
||||||
#endif
|
#endif
|
||||||
CGRadSensSensor cgRadSens;
|
|
||||||
|
|
||||||
#define FAILED_STATE_SENSOR_READ_MULTIPLIER 10
|
#define FAILED_STATE_SENSOR_READ_MULTIPLIER 10
|
||||||
#define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true
|
#define DISPLAY_RECEIVEID_MEASUREMENTS_ON_SCREEN true
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
|||||||
// therefore, we should only enable the sensor loop if measurement is also enabled
|
// therefore, we should only enable the sensor loop if measurement is also enabled
|
||||||
#ifdef T1000X_SENSOR_EN
|
#ifdef T1000X_SENSOR_EN
|
||||||
result = t1000xSensor.runOnce();
|
result = t1000xSensor.runOnce();
|
||||||
#else
|
#elif !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL
|
||||||
if (dfRobotLarkSensor.hasSensor())
|
if (dfRobotLarkSensor.hasSensor())
|
||||||
result = dfRobotLarkSensor.runOnce();
|
result = dfRobotLarkSensor.runOnce();
|
||||||
if (bmp085Sensor.hasSensor())
|
if (bmp085Sensor.hasSensor())
|
||||||
@ -159,8 +160,10 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
|||||||
if (!moduleConfig.telemetry.environment_measurement_enabled) {
|
if (!moduleConfig.telemetry.environment_measurement_enabled) {
|
||||||
return disable();
|
return disable();
|
||||||
} else {
|
} else {
|
||||||
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL
|
||||||
if (bme680Sensor.hasSensor())
|
if (bme680Sensor.hasSensor())
|
||||||
result = bme680Sensor.runTrigger();
|
result = bme680Sensor.runTrigger();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((lastSentToMesh == 0) ||
|
if (((lastSentToMesh == 0) ||
|
||||||
@ -499,6 +502,7 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule
|
|||||||
meshtastic_AdminMessage *response)
|
meshtastic_AdminMessage *response)
|
||||||
{
|
{
|
||||||
AdminMessageHandleResult result = AdminMessageHandleResult::NOT_HANDLED;
|
AdminMessageHandleResult result = AdminMessageHandleResult::NOT_HANDLED;
|
||||||
|
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL
|
||||||
if (dfRobotLarkSensor.hasSensor()) {
|
if (dfRobotLarkSensor.hasSensor()) {
|
||||||
result = dfRobotLarkSensor.handleAdminMessage(mp, request, response);
|
result = dfRobotLarkSensor.handleAdminMessage(mp, request, response);
|
||||||
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
||||||
@ -609,7 +613,8 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule
|
|||||||
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -4,6 +4,7 @@ board = tracker-t1000-e
|
|||||||
build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DTRACKER_T1000_E
|
build_flags = ${nrf52840_base.build_flags} -Ivariants/tracker-t1000-e -Isrc/platform/nrf52/softdevice -Isrc/platform/nrf52/softdevice/nrf52 -DTRACKER_T1000_E
|
||||||
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
-L "${platformio.libdeps_dir}/${this.__env__}/bsec2/src/cortex-m4/fpv4-sp-d16-hard"
|
||||||
-DGPS_POWER_TOGGLE
|
-DGPS_POWER_TOGGLE
|
||||||
|
-DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR_EXTERNAL=1
|
||||||
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld
|
||||||
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/tracker-t1000-e>
|
build_src_filter = ${nrf52_base.build_src_filter} +<../variants/tracker-t1000-e>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
@ -11,4 +12,4 @@ lib_deps =
|
|||||||
https://github.com/meshtastic/QMA6100P_Arduino_Library.git#14c900b8b2e4feaac5007a7e41e0c1b7f0841136
|
https://github.com/meshtastic/QMA6100P_Arduino_Library.git#14c900b8b2e4feaac5007a7e41e0c1b7f0841136
|
||||||
debug_tool = jlink
|
debug_tool = jlink
|
||||||
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
|
||||||
upload_protocol = nrfutil
|
upload_protocol = nrfutil
|
Loading…
Reference in New Issue
Block a user