Skip to content

Conversation

@lewispg228
Copy link
Contributor

ready for group code review.

@lewispg228 lewispg228 self-assigned this Jan 15, 2024
@lewispg228

This comment was marked as resolved.

SFE-Brudnerd

This comment was marked as resolved.

@lewispg228

This comment was marked as resolved.

@sfe-SparkFro

This comment was marked as resolved.

-on() no longer takes settings arguments. It soley sets the buzzerActiveRegister to turn on the buzzer
-configureBuzzer must be called separately in examples to configure the buzzer
-removed silentConfiguration example 9 - because this is done in most other examples already. That is, when you call configureBuzzer(), this does not cause the buzzer to buzz, and so is "silent".
-deviceId will read device ID from qwiic buzzer
-also added in a check into the begin function
@lewispg228

This comment was marked as resolved.

@lewispg228

This comment was marked as resolved.

Copy link
Member

@gigapod gigapod left a comment

Choose a reason for hiding this comment

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

A couple of minor things to cleanup here.

void setup() {
Serial.begin(115200);
Serial.println("Qwiic Buzzer Example_09_FirmwareVersion");
Wire.begin(); //Join I2C bus
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed? If no wire is provided to begin - which these calls into the toolkit which uses the default Wire, it calls begin I believe.

The correct action is one of the following:

  • Remove Wire.begin()
  • Keep Wire.begin(), and then pass that into the begin() method - you are taking ownership for wire setup ..etc

Public Constants
*************************************************/

#define SFE_QWIIC_BUZZER_NOTE_B0 31
Copy link
Member

Choose a reason for hiding this comment

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

nit note: These should be const uint*_t values.

In c++, you should rarely use #define constant defines.

@@ -0,0 +1,41 @@
/******************************************************************************
Copy link
Member

Choose a reason for hiding this comment

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

This is fine and I won't push this. But future implementations, we need to change how this is done.

I could be two registers, but with active developed products it could/will cause an issue at some point. Also it's important to have a mindset of defensive programming when implementing functionally. Prevents future issues and very little cost up front.

@lewispg228 lewispg228 merged commit 387b5d0 into main Jan 29, 2024
@lewispg228 lewispg228 deleted the dev_toolkit branch January 29, 2024 20:56
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.

5 participants