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

Quick experiment to expand frequency range #167

Draft
wants to merge 5 commits into
base: mdev
Choose a base branch
from

Conversation

netmindz
Copy link
Collaborator

@netmindz netmindz commented Sep 21, 2024

For reference, this is what the effect looked like originally deliberately without serpentine correction

https://photos.app.goo.gl/6Zkw4ckXqApmFdWD8


static uint8_t getMax(uint8_t* myArray) {
uint8_t maxV = 0;
for (int i = 0; i < (sizeof(myArray) / sizeof(myArray[0])); i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a rather tricky pitfall in C - if you pass an array pointer, sizeof() behaves differently and you cannot get the number of array items. It means that sizeof(myArray) = 4 (size of a pointer) so the loop will always run over exactly 4 elements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hate C arrays 😉 Thanks for the tip

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