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

Add send example for Nano 33 Sense #9

Merged
merged 6 commits into from Aug 7, 2019

Conversation

joextodd
Copy link
Contributor

@joextodd joextodd commented Aug 7, 2019

No description provided.

}

void
onSentCallback(void *chirp, uint8_t *payload, size_t length, uint8_t channel)
Copy link
Contributor

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 ?

Copy link
Contributor Author

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) {
Copy link
Contributor Author

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)

Copy link
Contributor Author

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);
Copy link
Contributor

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 😢

@LittleMonsterFr LittleMonsterFr merged commit c4fcd6c into master Aug 7, 2019
@LittleMonsterFr LittleMonsterFr deleted the feature/nano33sense_tx_example branch August 7, 2019 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants