Repository navigation
tech: restructuration de main.cpp (audit A2, A3) - #39
Merged
Merged
Conversation
Audit A2 + A3. No change in transmitted frames. - Measurements (include/Measurements.h): one cycle's values with a present flag each, replacing the NOT_SET = -1000 sentinel floats. - EnvironmentEncoder (include/EnvironmentEncoder.h): build-time alias to OregonV3 or LacrosseWS7000, ConfigureEncoder() and one ApplyMeasurements() overload per encoder. Static, no virtual table. - LightSensor (include/LightSensor.h): BH1750 wrapper with Hal* and a native stub; the BH1750 and the dedicated Lacrosse light encoder are now created once instead of every cycle. Luminosity still goes out as a Lacrosse type-5 frame, twice (LIGHT_FRAME_REPEAT). - Fixes: direct _delay_ms(150) in main.cpp (now Hal::Delay30ms x5); vccMv declared only in the battery block but used by the analog block; missing native BMx280::Shutdown() stub. - test_environment: HAL orders through ApplyMeasurements() match the former direct encoder calls (Oregon, Lacrosse, battery-low flag). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNYLnB9ATL4uFdUmr9bSfN
docs/architecture.md: component diagram (EnvironmentEncoder, LightSensor, Measurements), responsibilities, and a Main loop structure section with the design choices. CLAUDE.md and audit updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNYLnB9ATL4uFdUmr9bSfN
arcadien
force-pushed
the
tech/main-refactor
branch
from
October 26, 2026 12:54
fa91788 to
bd87651
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basée sur #38 (à fusionner d'abord).
include/EnvironmentEncoder.h: aliasEnvironmentEncoder(Oregon ou Lacrosse) choisi à la compilation,ConfigureEncoder(),ApplyMeasurements()par encodeur. Statique, pas de vtable.include/LightSensor.h(wrapper BH1750, stub natif). Capteur et encodeur Lacrosse lumière créés une fois ; lux toujours en Lacrosse type 5, émis 2 fois.include/Measurements.hremplace les sentinellesNOT_SET = -1000._delay_ms(150)direct dansmain.cpp,vccMvhors portée pourANALOG1_X10_IDseul, stub natifBMx280::Shutdown().test_environment(7 tests) : mêmes ordres HAL qu'avec les appels directs d'avant.docs/architecture.md(diagramme + section Main loop structure), CLAUDE.md, audit.Aucun changement de trame attendu. La CI compile les 7 cibles ; vérification sur banc recommandée pour
SOLAR_TEST(BH1750).Generated by Claude Code