Skip to content

Add embedded sharepoint, MCP23S17 driver and basic tests#5

Merged
Lakshay983 merged 54 commits into
mainfrom
add_embedded_sharepoint
Apr 12, 2026
Merged

Add embedded sharepoint, MCP23S17 driver and basic tests#5
Lakshay983 merged 54 commits into
mainfrom
add_embedded_sharepoint

Conversation

@changxu-liu
Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @changxu-liu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly advances the embedded firmware development environment by integrating the 'Embedded-Sharepoint' project as a submodule and introducing a robust blocking driver for the MCP23S17 GPIO expander. The changes include a new Makefile for streamlined building, a reorganized project structure, and dedicated test cases to thoroughly verify the functionality of the MCP23S17 for input, output, and interrupt handling. These additions lay the groundwork for future hardware interaction and development.

Highlights

  • Embedded Sharepoint Integration: The 'Embedded-Sharepoint' project has been integrated as a new submodule, establishing a foundational framework for firmware development.
  • MCP23S17 Blocking Driver: A new blocking driver for the MCP23S17 GPIO expander has been added, providing comprehensive functionality for controlling and reading GPIO pins via SPI.
  • Comprehensive MCP23S17 Tests: Basic tests have been introduced to validate the MCP23S17 driver's input, output, and interrupt capabilities, ensuring reliable operation.
  • Project Structure Refinement: The project's directory structure has been reorganized, moving CubeMX configuration files and introducing a dedicated Makefile for the test board.
  • Enhanced .gitignore: The .gitignore file has been updated with new rules to exclude various build artifacts, IDE-specific files, and other non-essential items related to firmware development, Python, and Nix.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new driver for the MCP23S17 SPI GPIO expander, along with a set of test applications and updates to the build system. However, a security audit identified two significant logic vulnerabilities in the MCP23S17 driver implementation: an incorrect hardware address calculation (address bits shifted left twice) and a type mismatch where the Chip Select pin is stored as an 8-bit integer, truncating STM32 GPIO pin bitmasks for pins 8 through 15. These can lead to unintended hardware behavior or denial of service. Additionally, the code contains critical bugs in the Makefile and driver logic, significant style and maintainability problems, unprofessional driver function names, performance concerns due to long, blocking delays, and bad practices in test code like modifying global strings and using magic numbers. Please address these issues to improve code quality and security.

Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/TestBoard_TPS27SA08-Q1/Makefile
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Rav4s
Rav4s previously requested changes Feb 1, 2026
Copy link
Copy Markdown

@Rav4s Rav4s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice job overall :)
i left comments throughout, let me know if you need clarifications. also address gemini comments and set up github actions for verifying compilation

Comment thread firmware/TestBoard_TPS27SA08-Q1/test/src/MCP23S17_in_test.c Outdated
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/inc/MCP23S17.h
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/inc/MCP23S17.h Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/TestBoard_TPS27SA08-Q1/test/src/MCP23S17_int_test.c
Comment thread firmware/TestBoard_TPS27SA08-Q1/test/src/MCP23S17_int_test.c Outdated
Comment thread firmware/TestBoard_TPS27SA08-Q1/test/src/MCP23S17_int_test.c Outdated
@changxu-liu changxu-liu force-pushed the add_embedded_sharepoint branch from cb697b0 to 9aaf389 Compare April 5, 2026 03:22
@changxu-liu changxu-liu changed the title Add embedded sharepoint, MCP23S17 (blocking) driver and basic tests Add embedded sharepoint, MCP23S17 driver and basic tests Apr 5, 2026
Copy link
Copy Markdown

@Lakshay983 Lakshay983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all your files in core in TestBoard_TPS27SA08-Q1 having that string appended to the names is kinda silly imo. Like is that not implied via the different folder?

Comment thread firmware/driver/src/MCP23S17.c
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/driver/src/MCP23S17.c Outdated
Comment thread firmware/TestBoard_TPS27SA08-Q1/test/src/MCP23S17_int_test.c Outdated
Comment thread firmware/TestBoard_TPS27SA08-Q1/core/src/main.c
Comment thread firmware/TestBoard_TPS27SA08-Q1/core/src/TestBoard_TPS27SA08-Q1_SPI.c Outdated
@changxu-liu changxu-liu requested a review from Lakshay983 April 6, 2026 07:51
Copy link
Copy Markdown

@Lakshay983 Lakshay983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changxu

@Lakshay983 Lakshay983 merged commit 3dccf76 into main Apr 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants