feat(main): firmware integration by wiring all three modules into main.c and updating the full test runner#41
Draft
Rohith-Kalarikkal wants to merge 14 commits intodevelopfrom
Draft
feat(main): firmware integration by wiring all three modules into main.c and updating the full test runner#41Rohith-Kalarikkal wants to merge 14 commits intodevelopfrom
main.c and updating the full test runner#41Rohith-Kalarikkal wants to merge 14 commits intodevelopfrom
Conversation
…les for all tests
main.c and updating the full test runner
* feat(sensor): Added sensor hal modules * test(sensor): Adding sensor_hal module for unity tests * test(repo): Adding mock hal implementations for unity tests
…les for all tests
…system into feat/main-build
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.
Summary
Completes the Sprint 2 firmware integration by wiring all three modules into
main.cand updating the full test runner.main.cnow has a clean superloop that callssensor_init(),motor_init(), reads all sensors every 10 ms, applies brake-override motor control logic, and rate-limits UART Teleplot logging to every 100 ms.test_runner.cis updated to include all 69 Sprint 2 tests across the three modules using the handoff.incpattern so future sprints can add tests without touchingtest_runner.c. BothCMakeLists.txtfiles are confirmed correct and all stub HAL headers are stable.Type of Change
Related Issue
Closes #31 #32
Changes Made
core/src/main.c- Sprint 2 additions:sensor_init()andmotor_init()calls with blink-on-failure error handling,main_loop_run()callingsensor_read_all()every 10 ms,motor_control_update()implementing brake-overrides-throttle safety rule,uart_log_sensors()emitting Teleplot-format>label:value\nlines every 100 ms, andsystem_hal_init()setting up stub HAL handles with correct ARR=3599 for 20 kHz PWM at 72 MHztests/test_runner.c- addedexterndeclarations for all 63 Sprint 2 tests across all three modules; replaced individualRUN_TEST()calls with#include "handoff/dev1_tests.inc",#include "handoff/dev2_tests.inc", and#include "handoff/dev3_tests.inc"in the corrects_active_modulecontext sosetUp()/tearDown()dispatches correctly for each module grouptests/test_placeholder.c- no functional changes; confirmed Sprint 1 framework tests still passCMakeLists.txt(root) -FIRMWARE_SOURCESlist includes all three new module.cfiles; linker script path correcttests/CMakeLists.txt-TEST_SOURCESincludestest_sensor_hal.c,test_motor_ctrl.c,test_protocol_prep.c, andtest_runner.c;MOCK_SOURCESincludes all five mock files;FIRMWARE_SOURCES_UNDER_TESTincludessensor_hal.c,motor_ctrl.c, andfault_logger.cdrivers/STM32_HAL/stm32f1xx_hal*.hstub headers - no changes required; all peripheral types used by Sprint 2 modules are already definedHow to Test This PR
git checkout feat/main-buildgit log --oneline developand verify commits from feat/sensor-hal, feat/motor-ctrl, and feat/fault-log are presentls tests/handoff/- must showdev1_tests.inc,dev2_tests.inc,dev3_tests.inccmake --build build- must complete with 0 errors and 0 warningscd tests && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug && make && ./test_runner69 Tests 0 Failures 0 Ignoredcppcheck --error-exitcode=1 -I core/inc core/src/Testing Done by Author
cd Tests/build && ./test_runner→ 0 Failures)cppcheck --error-exitcode=1 -I core/Inc core/src/)cmake --build build)-Wall -Wextraclean)Code Quality Checklist
06_CODING_STANDARDS.md@brief,@param,@retval)ev_config.hswitchstatements have adefaultcaseif/for/whileblocks use{braces even for single linesDocumentation
README.mdupdated if new setup steps are needed/* TODO: */comments added for any deferred workScreenshots / Logs (if applicable)