Skip to content

Commit

Permalink
Fixed AM mute
Browse files Browse the repository at this point in the history
  • Loading branch information
lmartorella committed Jan 4, 2020
1 parent 3535bd2 commit d5a3f97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lm7001_si470_bridge.X/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,15 @@ static void decodeLmData() {
// Invalid (AM or invalid data)
si_fm_mute(1);
debug(DEBUG_INVALID_CODE);
} else {
si_fm_mute(0);

} else {
//debug8(s_lmData.FREQ_LO);
//debug8(s_lmData.FREQ_HI);

uint16_t freq = (s_lmData.FREQ_LO | (s_lmData.FREQ_HI << 8)) - (875 * 2) - (107 * 2); // Base is 87.5 , subtract IF too
if (freq > 410) { // (108 - 87.5 Mhz) / 50 kHz
debug(DEBUG_INVALID_CODE);
} else {
// This will unmute
si_fm_tune(freq);
debug(DEBUG_VALID_CODE);
}
Expand Down
6 changes: 3 additions & 3 deletions lm7001_si470_bridge.X/si_fm_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ void si_fm_forceMono(uint8_t forceMono) {
}

void si_fm_mute(uint8_t mute) {
uint8_t isMute = si_powerCfg.DMUTE;
uint8_t isMute = !si_powerCfg.DMUTE;
if (isMute != mute) {
// Update mute status
si_powerCfg.DMUTE = mute;
si_powerCfg.DSMUTE = mute;
si_powerCfg.DMUTE = !mute;
si_powerCfg.DSMUTE = !mute;

// Only write register 2 (the first)
i2c_start(SI_WRITE_ADDRESS);
Expand Down

0 comments on commit d5a3f97

Please sign in to comment.