Skip to content

Commit

Permalink
fix(sound): wrong variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar244 committed Jun 14, 2018
1 parent 651cd24 commit d4dcf82
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/sound.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ namespace sound {

namespace {

void SendNoteThroughWire(uint8_t dev, Audio::Note notes) {
void SendNoteThroughWire(uint8_t dev, Audio::Note note) {
if (dev < 2) {
Wire.beginTransmission(0x24 + dev);
Wire.write(notes);
Wire.write(note);
Wire.endTransmission();
} else {
Wire2.beginTransmission(0x24 + dev - 2);
Wire2.write(notes);
Wire2.write(note);
Wire2.endTransmission();
}
}

// returns the notes but as a DTMF data
uint8_t GetNote(Audio::Note notes) {
switch (notes % 24) {
// returns the note but as a DTMF data
uint8_t GetNote(Audio::Note note) {
switch (note % 24) {
case 0: return 0x30;
case 1: return 0x31;
case 2: return 0x32;
Expand Down Expand Up @@ -60,11 +60,11 @@ void Init() {
Wire2.begin();
}

void SetPlayedNotes(const Audio::NoteList& notess) {
void SetPlayedNotes(const Audio::NoteList& notes) {
uint8_t i = 0;

for (const auto& notes : notess) {
SendNoteThroughWire(i++, GetNote(notes));
for (const auto& note : notes) {
SendNoteThroughWire(i++, GetNote(note));
}
for (; i < Audio::kMaxNotes; i++) {
SendNoteThroughWire(i, 0);
Expand Down

0 comments on commit d4dcf82

Please sign in to comment.