-
Notifications
You must be signed in to change notification settings - Fork 0
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
[DRAFT] CPU load proof of concept #3
base: main
Are you sure you want to change the base?
Conversation
Core/Src/circular_buffer.c
Outdated
bool circ_buf_full(circ_buf_t *p_circ_bbuf_t, uint8_t maxlen) { | ||
return (p_circ_bbuf_t->num_entries == maxlen); | ||
} | ||
|
||
bool circ_buf_empty(circ_buf_t *p_circ_bbuf_t) { | ||
return (p_circ_bbuf_t->num_entries == 0); | ||
} | ||
|
||
int circ_buf_enqueue(circ_buf_t *pBuffer, float data, uint8_t maxlen) { |
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.
Since these functions are exposed in circular_buffer.h
make sure you follow the coding standard for public functions. See the Coding Style here: https://wiki.ubcsolar.com/subteams/embedded/coding_style
Of course this is still a solar sandbox project, however, to make your refactor and integration to production code later, I recommend following the coding style from the beginning.
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.
Unclear on what coding standard isn't being followed?
Core/Src/circular_buffer.c
Outdated
} | ||
|
||
// Insert the data and move the head | ||
pBuffer->pBuffer[pBuffer->head] = data; |
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.
The naming here is a bit confusing since pBuffer
is a float*
inside the struct and pBuffer
is also a circ_buf_t*
.
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.
Makes sense, can definitely see how this could be super confusing to someone who didn't write it.
No description provided.