mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-18 13:43:58 +00:00
chore: update microphone driver to use latest i2s interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -64,7 +64,7 @@ func (d *Device) Read(r []int32) (int, error) {
|
|||||||
count := len(r)
|
count := len(r)
|
||||||
|
|
||||||
// get the next group of samples
|
// get the next group of samples
|
||||||
machine.I2S0.Read(d.buf)
|
machine.I2S0.ReadStereo(d.buf)
|
||||||
|
|
||||||
if len(r) > len(d.buf) {
|
if len(r) > len(d.buf) {
|
||||||
count = len(d.buf)
|
count = len(d.buf)
|
||||||
@@ -83,7 +83,7 @@ func (d *Device) ReadWithFilter(r []int32) (int, error) {
|
|||||||
for i := 0; i < len(r); i++ {
|
for i := 0; i < len(r); i++ {
|
||||||
|
|
||||||
// get the next group of samples
|
// get the next group of samples
|
||||||
machine.I2S0.Read(d.buf)
|
machine.I2S0.ReadStereo(d.buf)
|
||||||
|
|
||||||
// filter
|
// filter
|
||||||
sum = applySincFilter(d.buf)
|
sum = applySincFilter(d.buf)
|
||||||
|
|||||||
Reference in New Issue
Block a user