Skip to content
Merged
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
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,17 @@
runtimeInputs = [ pkgs.cppcheck ];
text = ''
cd "''${1:-.}"
# zephyr_hardware.cpp gates the battery-check ADC code on Zephyr
# devicetree macros (DT_NODE_EXISTS/DT_PATH/DT_NODE_HAS_PROP) in a
# #if. Standalone cppcheck has no DT headers to expand them;
# cppcheck >= 2.21 hard-errors (syntaxError) on the unevaluatable
# condition where older versions assumed 0. Real syntax is checked
# by the Zephyr compiler in the smoke-build gate.
cppcheck --enable=warning,performance,portability \
--std=c++20 --error-exitcode=1 --force \
--suppress=missingIncludeSystem \
--suppress=normalCheckLevelMaxBranches \
--suppress=syntaxError:src/zephyr_hardware.cpp \
src/*.cpp src/*.hpp
'';
};
Expand Down
12 changes: 6 additions & 6 deletions src/beacon_logic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ bool is_key_empty(const uint8_t* key, size_t len);

/// Input to the status computation (replaces all globals).
struct StatusInput {
StatusFlags status; // Decoded status configuration
uint16_t battery_voltage; // Battery voltage in millivolts (e.g. 3800 = 3.8V)
uint16_t keys_changes; // Rolling counter of AirTag key rotations (used by mode 2)
uint8_t what_in_status; // Telemetry cycle selector: 0=voltage, 1=accel, 2=temperature
uint8_t accel_byte; // 7-bit movement summary from MovementTracker::compute_accel_byte()
int16_t temperature; // Accelerometer die temperature in 0.1C units (e.g. 235 = 23.5C)
StatusFlags status; // Decoded status configuration
uint16_t battery_voltage = 0; // Battery voltage in millivolts (e.g. 3800 = 3.8V)
uint16_t keys_changes = 0; // Rolling counter of AirTag key rotations (used by mode 2)
uint8_t what_in_status = 0; // Telemetry cycle selector: 0=voltage, 1=accel, 2=temperature
uint8_t accel_byte = 0; // 7-bit movement summary from MovementTracker::compute_accel_byte()
int16_t temperature = 0; // Accelerometer die temperature in 0.1C units (e.g. 235 = 23.5C)
};

/// Output of the status computation.
Expand Down