Skip to content

Commit

Permalink
docs: add alternative for bin2hex and add link for the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ensonic committed Nov 18, 2015
1 parent f4a1646 commit 92b9784
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ gst-launch-1.0 -q uridecodebin uri=file:///path/to/audio-file ! audioconvert ! \
perl ~/bin/bin2hex.pl /tmp/snd 1 | sed -e 's/bin_data|wave_data/' >/tmp/wave_data.h
```

An alternative for bin2hex.pl would be:

```Shell
size=$(stat -c "%s" /tmp/snd); \
(
echo "static uint8_t wave_data[] = { /* ${size} */";
hexdump -v -e '15/1 "0x%02X," "\n"' /tmp/snd | sed -e 's/0x ,//g';
echo "};"
) >wave_data.h
```

gstreamer is included with most linux distros and I found the bin2hex.pl at
http://www.chami.com/tips/delphi/052098D.html

Expand Down
5 changes: 5 additions & 0 deletions firmware/PhotonWaveOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,9 @@ void WaveOut::playback_handler(void) {
pinResetFast(current->pin_p);
}
}
/* once DAC bug in 0.4.7 (https://github.com/spark/firmware/issues/671) is
* fixed we could do this with one pin instead:
pinMode(audio, OUTPUT);
analogWrite(audio, (v<<4));
*/
}

0 comments on commit 92b9784

Please sign in to comment.