-
Notifications
You must be signed in to change notification settings - Fork 5
./tests: Move PSOC specific variables from spi test to test_config. #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors PSOC-specific SPI variables by moving them from SPI test files to a centralized test configuration. The purpose is to improve code organization and reusability across different projects by removing hardcoded class names from test files.
- Moved PSOC-specific SPI class declarations to test_config.h/cpp
- Created centralized global SPI instances for master and slave configurations
- Added proper forward declarations and implementations to avoid multiple definition errors
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_config.h | Added SPI.h include and forward declarations for spi_master/spi_slave instances |
| tests/test_config.cpp | New file implementing SPI instance definitions with proper initialization |
Comments suppressed due to low confidence (1)
tests/test_config.cpp:15
- [nitpick] The variable name 'SPI1' is inconsistent with the declared naming pattern. Consider renaming to 'spi_slave_instance' or similar to match the naming convention used for the pointer variables.
SPIClassPSOC SPI1 = SPIClassPSOC(PIN_SPI_MOSI, PIN_SPI_MISO, PIN_SPI_SCK, TEST_PIN_SPI_SSEL, true);
300700a to
23a3644
Compare
|
Should not |
It will not work because in PSOC project the class name is SPIClassPSOC. |
23a3644 to
b8a999c
Compare
Signed-off-by: Ramya Subramanyam <ramya.subramanyam@infineon.com>
b8a999c to
73c29e8
Compare
Signed-off-by: Ramya Subramanyam <ramya.subramanyam@infineon.com>
7dcf8d7 to
d0b6e72
Compare
Signed-off-by: Ramya Subramanyam <ramya.subramanyam@infineon.com>
989188f to
690188d
Compare
By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---
We previously used project-specific class names "SPIClassPSOC" in SPI tests to create slave and master instances. This has now been moved to a test_config source file to enhance its generic nature and reusability across different projects.