Backport: Add header guards and clean up Button self-qualification#152
Merged
livingkurt merged 8 commits intomasterfrom Mar 27, 2026
Merged
Backport: Add header guards and clean up Button self-qualification#152livingkurt merged 8 commits intomasterfrom
livingkurt merged 8 commits intomasterfrom
Conversation
- Add proper #ifndef/#define header guards to Button.h, Helios.h, ColorConstants.h, and Random.h (replacing #pragma once where used) - Remove unnecessary Button:: self-qualification on static method calls within Button.cpp (holdPressing, processPreInput, processPostInput) - Extract repeated Time::getCurtime() calls into const local variable in Button::update() Made-with: Cursor
Collaborator
|
Okay this is my first experience with cursor, this is really cool lol I am curious though can it actually tell if the total size is smaller? It would need to look at this output of this build step: master This one So it's definitely smaller, which makes sense, but I'm curious would Cursor know if it wasn't? Other than this question, changeset looks good to me and definitely fixes the issues |
Unreal-Dan
approved these changes
Mar 3, 2026
Collaborator
|
Can confirm same size before and after removing the call to Helios::wakeup() in the ISR, therefore it was never needed and logically doesn't make sense for embedded. Same size: 96.90% and globals 53.91% |
livingkurt
added a commit
that referenced
this pull request
Mar 27, 2026
Backport cleanup from master (#152): replace #pragma once in Button.h and add missing include guard to Helios.h with standard #ifndef guards. This reduces the diff against master for the RAII PR review. Made-with: Cursor
livingkurt
added a commit
that referenced
this pull request
Mar 27, 2026
Port of master PR #152 cleanup changes to aeos branch: - Add proper #ifndef/#define header guards to Button.h, Helios.h, ColorConstants.h, and Random.h (replacing #pragma once where used) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H - Remove Helios::wakeup() from ISR (not used on embedded) - Remove unnecessary Button:: self-qualification on static method calls within Button.cpp (holdPressing, processPreInput, processPostInput) - Extract repeated Time::getCurtime() calls into const local variable in Button::update() - Move Led::setBrightness() out of inline into Led.cpp - Remove commented-out include from Pattern.cpp - Remove unused Led.h include from TimeControl.cpp - Update TimeControl.h comments for clarity Made-with: Cursor
2 tasks
livingkurt
added a commit
that referenced
this pull request
Mar 27, 2026
Port of master PR #152 cleanup changes to the master-c branch: - Add proper #ifndef/#define guard to ColorConstants.h (replacing #pragma once) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H to match filename - Remove helios_wakeup() from embedded ISR (not used on embedded) - Extract repeated time_get_current_time() calls into const local variable in button_update() for clarity - Remove unused Led.h include from TimeControl.cpp, reorder includes - Update TimeControl.h comments on time_get_current_time() and time_microseconds() for clarity Made-with: Cursor
livingkurt
added a commit
that referenced
this pull request
Mar 27, 2026
Port of master PR #152 cleanup changes to the aeos-c branch: - Add proper #ifndef/#define guard to ColorConstants.h (replacing #pragma once) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H to match filename - Remove helios_wakeup() from embedded ISR (not used on embedded) - Extract repeated time_get_current_time() calls into const local variable in button_update() for clarity - Remove unused Led.h include from TimeControl.cpp, reorder includes - Update TimeControl.h comments on time_get_current_time() and time_microseconds() for clarity Made-with: Cursor
This was referenced Mar 27, 2026
livingkurt
added a commit
that referenced
this pull request
Mar 28, 2026
) Port of master PR #152 cleanup changes to aeos branch: - Add proper #ifndef/#define header guards to Button.h, Helios.h, ColorConstants.h, and Random.h (replacing #pragma once where used) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H - Remove Helios::wakeup() from ISR (not used on embedded) - Remove unnecessary Button:: self-qualification on static method calls within Button.cpp (holdPressing, processPreInput, processPostInput) - Extract repeated Time::getCurtime() calls into const local variable in Button::update() - Move Led::setBrightness() out of inline into Led.cpp - Remove commented-out include from Pattern.cpp - Remove unused Led.h include from TimeControl.cpp - Update TimeControl.h comments for clarity Made-with: Cursor
livingkurt
added a commit
that referenced
this pull request
Mar 28, 2026
#154) Port of master PR #152 cleanup changes to the master-c branch: - Add proper #ifndef/#define guard to ColorConstants.h (replacing #pragma once) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H to match filename - Remove helios_wakeup() from embedded ISR (not used on embedded) - Extract repeated time_get_current_time() calls into const local variable in button_update() for clarity - Remove unused Led.h include from TimeControl.cpp, reorder includes - Update TimeControl.h comments on time_get_current_time() and time_microseconds() for clarity Made-with: Cursor
livingkurt
added a commit
that referenced
this pull request
Mar 28, 2026
…155) Port of master PR #152 cleanup changes to the aeos-c branch: - Add proper #ifndef/#define guard to ColorConstants.h (replacing #pragma once) - Rename Colortypes.h guard from COLOR_H to COLORTYPES_H to match filename - Remove helios_wakeup() from embedded ISR (not used on embedded) - Extract repeated time_get_current_time() calls into const local variable in button_update() for clarity - Remove unused Led.h include from TimeControl.cpp, reorder includes - Update TimeControl.h comments on time_get_current_time() and time_microseconds() for clarity Made-with: Cursor
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
These are small cleanup changes identified during the RAII branch review (PR #151) that apply cleanly to master and reduce the diff size of the RAII branch when they're merged here first.
Button.h,Helios.h,ColorConstants.h, andRandom.h. The first two had no include guard at all, the latter two used non-standard#pragma once.Button::self-qualification on static method calls withinButton.cpp(holdPressing,processPreInput,processPostInput). These are calls to the class's own static members and don't need the class prefix.Time::getCurtime()calls into aconstlocal variable inButton::update()for clarity (the compiler likely optimizes this already, but the old AVR compiler may benefit).Test plan
Made with Cursor