diff --git a/platformio.ini b/platformio.ini index a4fbad03..5375fc5d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -89,6 +89,7 @@ build_flags = -DMIC_SPM1423=1 ;Applicable for SPM1423 device ;FM Radio -DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=0 -DPIN_CLK=0 -DI2S_SCLK_PIN=0 -DI2S_DATA_PIN=34 @@ -199,6 +200,7 @@ build_flags = -DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;FM Radio -DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=0 ;Microphone -DMIC_SPM1423=1 ;Applicable for SPM1423 device -DPIN_CLK=0 @@ -313,7 +315,8 @@ build_flags = ;Microphone -DMIC_SPM1423=1 ;uncomment to enable Applicable for SPM1423 device ;FM Radio - ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=40 -DPIN_CLK=43 -DI2S_SCLK_PIN=43 -DI2S_DATA_PIN=46 @@ -440,6 +443,7 @@ build_flags = ;-DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=18 ;Microphone -DMIC_SPM1423=1 ;uncomment to enable Applicable for SPM1423 device -DPIN_CLK=-1 @@ -560,6 +564,7 @@ build_flags = ;Features Enabled ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=18 ;-DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;Microphone ;-DMIC_SPM1423=1 ;uncomment to enable Applicable for SPM1423 device @@ -678,6 +683,7 @@ build_flags = ;Features Enabled ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=18 -DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;Microphone ;-DMIC_SPM1423=1 ;uncomment to enable Applicable for SPM1423 device @@ -847,6 +853,7 @@ build_flags = ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=12 ;Microphone ;-DMIC_SPM1423=1 ; uncomment to enable Applicable for SPM1423 device ;-DPIN_CLK=-1 @@ -899,6 +906,7 @@ build_flags = ;Features Enabled ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=18 ;-DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;Microphone @@ -1021,6 +1029,7 @@ build_flags = ;Features Enabled ;FM Radio ;-DFM_SI4713=1 ;Uncomment to activate FM Radio using Adafruit Si4713 + -DFM_RSTPIN=40 ;-DLITE_VERSION=1 ;limits some features to save space for M5Launcher Compatibility ;Microphone ;-DMIC_SPM1423=1 ;uncomment to enable Applicable for SPM1423 device @@ -1130,4 +1139,4 @@ build_flags = lib_deps = ${common.lib_deps} - xylopyrographer/LiteLED@^1.2.0 \ No newline at end of file + xylopyrographer/LiteLED@^1.2.0 diff --git a/src/core/menu_items/FMMenu.cpp b/src/core/menu_items/FMMenu.cpp index 6a09c2ae..0675c545 100644 --- a/src/core/menu_items/FMMenu.cpp +++ b/src/core/menu_items/FMMenu.cpp @@ -4,7 +4,8 @@ void FMMenu::optionsMenu() { options = { - #if !defined(LITE_VERSION) and defined(FM_SI4713) +// #if !defined(LITE_VERSION) and defined(FM_SI4713) + #if defined(FM_SI4713) {"Brdcast std", [=]() { fm_live_run(false); }}, {"Brdcast rsvd", [=]() { fm_live_run(true); }}, {"Brdcast stop", [=]() { fm_stop(); }}, diff --git a/src/modules/fm/fm.cpp b/src/modules/fm/fm.cpp index b68d1c69..17e02e42 100644 --- a/src/modules/fm/fm.cpp +++ b/src/modules/fm/fm.cpp @@ -1,11 +1,9 @@ #include "fm.h" -#define RESETPIN 0 - bool auto_scan = false; bool is_running = false; uint16_t fm_station = 10230; // Default set to 102.30 MHz -Adafruit_Si4713 radio = Adafruit_Si4713(RESETPIN); +Adafruit_Si4713 radio = Adafruit_Si4713(FM_RSTPIN); void set_auto_scan(bool new_value) { auto_scan = new_value;