Repository navigation
Select the rocket (R8 / Rurku) with a build flag - #562
Merged
Merged
Conversation
Mateusz-Krajewski
marked this pull request as ready for review
November 17, 2026 21:54
Mateusz-Krajewski
enabled stacked auto-merge
November 17, 2026 21:55
Mateusz-Krajewski
disabled stacked auto-merge
November 22, 2026 17:12
KrzysKond
reviewed
Nov 22, 2026
Mateusz-Krajewski
enabled stacked auto-merge
November 22, 2026 17:59
KrzysKond
approved these changes
Nov 22, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 22, 2026
--config=r8 / --config=rurku (--define rocket=...) picks rocket-specific files, independent of the board: rocket_file() swaps a source in srcs, rocket_config() copies config_<Rocket>.json to config.json (//rockets:rocket.bzl). The engine app source becomes engine_app_R8.cpp / engine_app_Rurku.cpp and the EC EnvApp config becomes config_R8.json / config_Rurku.json (Rurku files start as copies). No flag means R8. CI builds every enabled board with both rockets.
The rocket flag only selects EC files, so the FC package is built once per board (R8, as before).
…s per rocket
engine_app.cpp holds what both rockets share (config, Initialize with the state callback registration, Run, OnStateChange). The reactions to state changes (OnArm, OnDisarm, OnLaunch, OnApogee, OnAbort and CloseValves) move to engine_reactions_R8.cpp / engine_reactions_Rurku.cpp, picked by rocket_file("engine_reactions.cpp"); the Rurku file is a copy of R8 for now. kPin_on / kPin_off become EngineApp constants so both files can use them.
States the EC does not react to (INIT, FLIGHT, FIRST_PARACHUTE, SECOND_PARACHUTE, DROP, TOUCHDOWN) get empty reactions in the per-rocket files, and CONNECTION_LOST gets its own OnConnectionLost (calls OnDisarm, as before), so each rocket can define every reaction.
Mateusz-Krajewski
force-pushed
the
board/6-rockets
branch
from
November 22, 2026 18:29
62fad81 to
f5622b9
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.
Stack płytek 6/6 (baza: board/5-uart). Poprzedni: #560.
Cel
Jedno repo dla R8 i Rurku: rakiety są zgodne w 99%, różnią się configami JSON i jednym miejscem w kodzie. Rakieta to flaga builda niezależna od płytki (platforma opisuje tylko sprzęt).
Zmiana
.bazelrc:--config=r8/--config=rurku(--define rocket=r8|rurku);//rockets:is_r8/is_rurku. Bez flagi → R8.//rockets:rocket.bzl:rocket_file("engine_reactions.cpp")wsrcs→engine_reactions_R8.cpp/engine_reactions_Rurku.cpp,rocket_config()→ kopiujeconfig_<Rakieta>.jsondoconfig.json(jakboard_config, bez łączenia JSON-ów).engine_app.cpp(konfig,Initializez rejestracją callbacków,Run,OnStateChange); reakcje na zmiany stanu (OnArm,OnDisarm,OnConnectionLost,OnLaunch,OnApogee,OnAbort+CloseValves) →engine_reactions_R8.cpp/engine_reactions_Rurku.cpp(rocket_file("engine_reactions.cpp"), Rurku na razie kopia R8). Callback zarejestrowany dla każdego stanu; stany bez reakcji EC (INIT, FLIGHT, FIRST_PARACHUTE, SECOND_PARACHUTE, DROP, TOUCHDOWN) mają puste reakcje.config_BbbEbV2.json→config_R8.json,config_BbbLbV1.json→config_Rurku.json(na razie kopia R8).ec:pkgz obiema rakietami,fc:pkgraz (R8, jak dotąd — rakieta wybiera tylko pliki EC).Przykład:
bazel build --config=bbb-LB_V1 --config=rurku //deployment/cpu/ec:pkg.Test
--config=r8→engine_reactions_R8.cpp, config EnvApp R8;--config=rurku→engine_reactions_Rurku.cpp, a znacznik zconfig_Rurku.jsonjest wEnvApp.tartylko wtedy.ec:pkgdlabbb-EB_V2ibbb-LB_V1×r8irurkuOK,fc:pkgdla obu płytek (R8) OK.build_all(host) OK, UT jak w CI: 59/59.Ryzyko
Pliki Rurku są kopiami R8, więc oba buildy dają dziś ten sam wynik. Nieznana wartość
--define rocket=...(literówka) wybiera R8 bez błędu — używać--config=r8/--config=rurku.