Skip to content

Commit 5701669

Browse files
committed
correct examples: logging
1 parent 8651ad0 commit 5701669

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ void setup() {
3333
// Setup logging
3434
Serial.begin(115200);
3535
AudioLogger::instance().begin(Serial, AudioLogger::Warning);
36-
LOGLEVEL_AUDIODRIVER = AudioDriverWarning;
36+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Warning);
37+
3738
delay(2000);
3839

3940
Serial.println("Setup starting...");

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void setup() {
1818
// Setup logging
1919
Serial.begin(115200);
2020
AudioLogger::instance().begin(Serial, AudioLogger::Warning);
21-
LOGLEVEL_AUDIODRIVER = AudioDriverWarning;
21+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Info);
2222

2323
// initialize i2c because board has no i2c definition
2424
Wire.begin();

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void setup() {
1717
// Setup logging
1818
Serial.begin(115200);
1919
AudioLogger::instance().begin(Serial, AudioLogger::Warning);
20-
LOGLEVEL_AUDIODRIVER = AudioDriverWarning;
20+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Info);
2121

2222
// start I2S & codec with i2c and i2s configured above
2323
Serial.println("starting I2S...");

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ AudioBoard board(AudioDriverES8388, my_pins);
1313
void setup() {
1414
// Setup logging
1515
Serial.begin(115200);
16-
LOGLEVEL_AUDIODRIVER = AudioDriverInfo;
16+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Info);
1717

1818
// add i2c codec pins: scl, sda, port
1919
my_pins.addI2C(CODEC, 32, 22, 0x20);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AudioBoard board(AudioDriverES8388);
1111
void setup() {
1212
// Setup logging
1313
Serial.begin(115200);
14-
LOGLEVEL_AUDIODRIVER = AudioDriverInfo;
14+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Info);
1515

1616
// start I2C for the communication with the codec
1717
Wire.begin();

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
void setup() {
99
// Setup logging
1010
Serial.begin(115200);
11-
LOGLEVEL_AUDIODRIVER = AudioDriverInfo;
11+
AudioDriverLogger.begin(Serial,AudioDriverLogLevel::Info);
1212

1313
// configure codec
1414
CodecConfig cfg;

src/DriverPins.h

+7-5
Original file line numberDiff line numberDiff line change
@@ -525,29 +525,31 @@ class DriverPins {
525525
}
526526
};
527527

528+
528529
/**
529530
* @brief Support for Touch
530531
* @author Phil Schatzmann
531532
* @copyright GPLv3
532533
*/
533534
class DriverTouchClass : public DriverPins {
534-
#ifdef ESP32
535-
# if SOC_TOUCH_SENSOR_SUPPORTED
536535
bool isKeyPressed(uint8_t key) override {
536+
bool result = false;
537+
#if defined(ESP32) && defined(ARDUINO)
538+
# if SOC_TOUCH_SENSOR_SUPPORTED
537539
auto pin_opt = getPin(PinFunction::KEY, key);
538540
if (!pin_opt) return false;
539541
auto pin = pin_opt.value();
540542
int value = touchRead(pin.pin);
541-
bool result = value <= touch_limit;
543+
result = value <= touch_limit;
542544
if (result) {
543545
// retry to confirm reading
544546
value = touchRead(pin.pin);
545547
result = value <= touch_limit;
546548
}
547-
return result;
548-
}
549549
# endif
550550
#endif
551+
return result;
552+
}
551553
void setTouchLimit(int limit){
552554
touch_limit = limit;
553555
}

0 commit comments

Comments
 (0)