Skip to content

Commit

Permalink
Merge pull request #231 from IncursioHack/main
Browse files Browse the repository at this point in the history
 Changes to FM Radio, working on StickC 1.1 and Cardputer.
  • Loading branch information
pr3y authored Sep 1, 2024
2 parents 9b64e04 + 2f50c9f commit aa6b8bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 11 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1130,4 +1139,4 @@ build_flags =

lib_deps =
${common.lib_deps}
xylopyrographer/LiteLED@^1.2.0
xylopyrographer/LiteLED@^1.2.0
3 changes: 2 additions & 1 deletion src/core/menu_items/FMMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }},
Expand Down
4 changes: 1 addition & 3 deletions src/modules/fm/fm.cpp
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit aa6b8bf

Please sign in to comment.