Skip to content
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

[SOFT-999] Completed Firmware 102 homework, request for code review #488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nehemiah-negussie
Copy link

First test commit.

@nehemiah-negussie nehemiah-negussie changed the title Completed Firmware 102 homework, request for code review [SOFT-999] Completed Firmware 102 homework, request for code review Jan 22, 2022
Copy link
Contributor

@mitchellostler mitchellostler left a comment

Choose a reason for hiding this comment

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

Looks really well done! There is a simpler design however, that uses only one timer callback function. See if you can figure it out, but if not feel free to ask for help

uint8_t counter_b;
} Counters;

void prv_timer_callback_2(SoftTimerId timer_id, void *context);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't worry about forward declaring your functions, just declare them where you write the function bodies.
This line can go


void prv_timer_callback_2(SoftTimerId timer_id, void *context);

void prv_timer_callback(SoftTimerId timer_id, void *context) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can (and should) do all the soft-timer functionality in one timer callback function instead of 2, see if you can figure it out, but if not feel free to ask for help 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, all private functions in a file should be declared as static, ie static void prv_*

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.

2 participants