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
Add send example for Nano 33 Sense #9
Conversation
} | ||
|
||
void | ||
onSentCallback(void *chirp, uint8_t *payload, size_t length, uint8_t channel) |
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.
A detail but could we have function declaration on one single line ?
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.
done. good to merge
// Process next buffer | ||
next = (current + 1) % NUM_BUFFERS; | ||
chirp_connect_error_code_t err = chirp_connect_process_shorts_output(chirp, data[next], BUFFER_SIZE); | ||
if (current == 0) { |
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.
@dinuchiriac we can remove this current
variable and instead use
if (current_buffer == buffer_one)
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.
In fact in can be reduced to a one liner with a ternary statement..
current_buffer = current_buffer == buffer_one ? buffer_two : buffer_one;
Serial.print("Generated payload: "); | ||
Serial.println(hex); | ||
|
||
chirp_connect_error_code_t err = chirp_connect_send(chirp, payload, payload_len); |
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 payload
is still orphan 😢
No description provided.