Skip to content

Commit 594f0a1

Browse files
committed
compile errors in examples
1 parent 4df4a79 commit 594f0a1

File tree

9 files changed

+10
-45
lines changed

9 files changed

+10
-45
lines changed

examples/audiotools/audiotools-custom-max/audiotools-custom-max.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AudioInfo info(44100, 2, 16);
1111
SineWaveGenerator<int16_t> sineWave(32000);
1212
GeneratedSoundStream<int16_t> sound(sineWave);
1313
DriverPins my_pins;
14-
AudioBoard board(&AudioDriverES8388, my_pins);
14+
AudioBoard board(AudioDriverES8388, my_pins);
1515
I2SCodecStream out(board);
1616
StreamCopy copier(out, sound);
1717

examples/audiotools/audiotools-custom-min/audiotools-custom-min.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
AudioInfo info(44100, 2, 16);
1111
SineWaveGenerator<int16_t> sineWave(32000);
1212
GeneratedSoundStream<int16_t> sound(sineWave);
13-
AudioBoard board(&AudioDriverES8388);
13+
AudioBoard board(AudioDriverES8388);
1414
I2SCodecStream out(board);
1515
StreamCopy copier(out, sound);
1616

examples/audiotools/audiotools-standard/audiotools-standard.ino

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ void setup() {
1919
AudioLogger::instance().begin(Serial, AudioLogger::Info);
2020
LOGLEVEL_AUDIODRIVER = AudioDriverInfo;
2121

22-
// setup pins
23-
// - add i2c codec pins: scl, sda, port, (I2C object)
24-
my_pins.addI2C(CODEC, 32, 22, 0x20, 100000, Wire);
25-
// - add i2s pins: mclk, bclk, ws, data_out, data_in
26-
my_pins.addI2S(CODEC, 0, 14, 15, 22);
27-
2822
// start I2S & codec with i2c and i2s configured above
2923
Serial.println("starting I2S...");
3024
auto config = out.defaultConfig();

examples/custom/custom-max/custom-max.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
#include "AudioBoard.h"
99

10-
AudioBoard board(&AudioDriverES8388);
10+
DriverPins my_pins;
11+
AudioBoard board(AudioDriverES8388);
1112

1213
void setup() {
1314
// add i2c codec pins: scl, sda, port

examples/custom/custom-min/custom-min.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "AudioBoard.h"
88

9-
AudioBoard board(&AudioDriverES8388, my_pins);
9+
AudioBoard board(AudioDriverES8388);
1010

1111
void setup() {
1212
// start I2C for the communication with the codec

examples/custom/custom-standard/custom-standard.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @brief We just set up the codec for a predefined board (AudioDriverES8388)
2+
* @brief We just set up the codec for a predefined board (AudioKitEs8388V1)
33
* @author phil schatzmann
44
*/
55

@@ -14,7 +14,7 @@ void setup() {
1414
cfg.i2s.rate = RATE_44K;
1515
// cfg.i2s.fmt = I2S_NORMAL;
1616
// cfg.i2s.mode = MODE_SLAVE;
17-
AudioDriverES8388.begin(cfg);
17+
AudioKitEs8388V1.begin(cfg);
1818
}
1919

2020
void loop() {}

src/Utils/I2C.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ error_t i2c_bus_write_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg,
2626
return result;
2727
}
2828

29-
error_t i2c_bus_write_data(i2c_bus_handle_t bus, int addr, uint8_t *data,
30-
int datalen) {
31-
AUDIODRIVER_LOGD("i2c_bus_write_data: addr=%d len=%d", addr, datalen);
32-
TwoWire *p_wire = (TwoWire *)bus;
33-
assert(datalen == 1);
34-
assert(p_wire!=nullptr);
35-
36-
int result = RESULT_OK;
37-
p_wire->beginTransmission(addr >> 1);
38-
p_wire->write(data, datalen);
39-
int rc = p_wire->endTransmission(I2C_END);
40-
if (rc != 0) {
41-
AUDIODRIVER_LOGE("->p_wire->endTransmission: %d", rc);
42-
result = RESULT_FAIL;
43-
}
44-
return result;
45-
}
4629

4730
/// This method is used
4831
error_t i2c_bus_read_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg,

src/Utils/I2C.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@ extern "C" {
2424
*/
2525
error_t i2c_bus_write_bytes(i2c_bus_handle_t bus, int addr, uint8_t *reg, int regLen, uint8_t *data, int datalen);
2626

27-
/**
28-
* @brief Write data to I2C bus
29-
*
30-
* @param bus I2C bus handle
31-
* @param addr The address of the device
32-
* @param data The data pointer
33-
* @param datalen The length of data
34-
*
35-
* @return
36-
* - NULL Fail
37-
* - Others Success
38-
*/
39-
error_t i2c_bus_write_data(i2c_bus_handle_t bus, int addr, uint8_t *data, int datalen);
4027

4128
/**
4229
* @brief Read bytes to I2C bus

src/Utils/etc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ extern "C" {
2626
#endif
2727

2828
#ifndef ARDUINO
29-
extern void pinMode(int, int);
30-
extern void digitalWrite(int, int);
31-
extern void delay(uint32_t);
29+
void pinMode(int, int);
30+
void digitalWrite(int, int);
31+
void delay(uint32_t);
3232
#endif
3333

3434

0 commit comments

Comments
 (0)