From d1d720e7803c2a472e64392560aa05606c6bbea1 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Fri, 6 Jul 2018 15:54:52 +0200 Subject: [PATCH] cleanup --- platformio.ini | 2 +- src/mp3.cpp | 6 +++++- src/mp3.h | 2 +- src/rotary.h | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index a7b443c..6f041c1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -15,7 +15,7 @@ board = heltec_wifi_lora_32 board_f_cpu = 240000000L board_f_flash = 80000000L framework = arduino -;build_flags = -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE -DDEBUG_INT_ALLOC_DECISIONS=1 +build_flags = -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE -DDEBUG_INT_ALLOC_DECISIONS=1 ; -DCONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL=y board_build.partitions = min_spiffs.csv ; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables https://github.com/espressif/arduino-esp32/tree/master/tools/partitions diff --git a/src/mp3.cpp b/src/mp3.cpp index 34cf0a1..8807f74 100644 --- a/src/mp3.cpp +++ b/src/mp3.cpp @@ -143,8 +143,12 @@ void MP3::mp3_decoder_task(void *pvParameters) { audiobuffer = buff; buff->RegisterStatusCB(StatusCallback, (void*)"buffer"); if (out == NULL) { - out = new AudioOutputI2S(I2S_NUM_0, false); + out = new AudioOutputI2S(I2S_NUM_0, AudioOutputI2S::EXTERNAL_I2S, AudioOutputI2S::APLL_DISABLE); out->SetPinout(12, 13, 25); + //out->SetRate(44100); + //out->SetBitsPerSample(I2S_BITS_PER_SAMPLE_16BIT); + //out->SetChannels(I2S_CHANNEL_STEREO); + //out->SetOutputModeMono(true); } if (rtttl_len > 0) { decoder = new AudioGeneratorRTTTL(); diff --git a/src/mp3.h b/src/mp3.h index f82b2b2..4e82c85 100644 --- a/src/mp3.h +++ b/src/mp3.h @@ -28,7 +28,7 @@ class MP3 { int getVolume(); bool playing = false; bool aborted = false; - int volume = 20; + int volume = 4; bool volumeChanged = true; uint32_t getBuffFill(void); bool fromProgmem; diff --git a/src/rotary.h b/src/rotary.h index 925e45f..67c2432 100644 --- a/src/rotary.h +++ b/src/rotary.h @@ -3,7 +3,7 @@ #include #include -#include +//#include // usually the rotary encoders three pins have the ground pin in the middle enum PinAssignments {