BUG: Now sound works but sending signal with sound on doesn't actually send signal!!!
Need to return previous implementation with 2 channel Timer or find another way
This commit is contained in:
MX 2023-02-10 00:56:29 +03:00
parent 175287ee0a
commit a098e0561e
No known key found for this signature in database
GPG key ID: 7CCC66B7DBDD1C83
3 changed files with 27 additions and 8 deletions

View file

@ -34,13 +34,6 @@ static void subghz_scene_receiver_config_set_debug_pin(VariableItem* item) {
variable_item_set_current_value_text(item, debug_pin_text[index]);
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) {
if(value_index2 == 1) {
furi_hal_subghz_set_async_mirror_pin(&gpio_ext_pa7);
} else {
furi_hal_subghz_set_async_mirror_pin(NULL);
}
}
subghz->txrx->debug_pin_state = index == 1;
}

View file

@ -597,6 +597,10 @@ void subghz_hopper_update(SubGhz* subghz) {
}
void subghz_speaker_on(SubGhz* subghz) {
if(subghz->txrx->debug_pin_state) {
furi_hal_subghz_set_async_mirror_pin(&gpio_ext_pa7);
}
if(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
if(furi_hal_speaker_acquire(30)) {
if(!subghz->txrx->debug_pin_state) {
@ -609,6 +613,9 @@ void subghz_speaker_on(SubGhz* subghz) {
}
void subghz_speaker_off(SubGhz* subghz) {
if(subghz->txrx->debug_pin_state) {
furi_hal_subghz_set_async_mirror_pin(NULL);
}
if(subghz->txrx->speaker_state != SubGhzSpeakerStateDisable) {
if(furi_hal_speaker_is_mine()) {
if(!subghz->txrx->debug_pin_state) {
@ -622,6 +629,9 @@ void subghz_speaker_off(SubGhz* subghz) {
}
void subghz_speaker_mute(SubGhz* subghz) {
if(subghz->txrx->debug_pin_state) {
furi_hal_subghz_set_async_mirror_pin(NULL);
}
if(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
if(furi_hal_speaker_is_mine()) {
if(!subghz->txrx->debug_pin_state) {
@ -632,6 +642,9 @@ void subghz_speaker_mute(SubGhz* subghz) {
}
void subghz_speaker_unmute(SubGhz* subghz) {
if(subghz->txrx->debug_pin_state) {
furi_hal_subghz_set_async_mirror_pin(&gpio_ext_pa7);
}
if(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
if(furi_hal_speaker_is_mine()) {
if(!subghz->txrx->debug_pin_state) {

View file

@ -777,8 +777,18 @@ bool furi_hal_subghz_start_async_tx(FuriHalSubGhzAsyncTxCallback callback, void*
LL_TIM_SetCounter(TIM2, 0);
LL_TIM_EnableCounter(TIM2);
//Signal generation for external G0
//Signal generation for external module
// Start debug (and speaker)
furi_hal_subghz_start_debug();
const GpioPin* gpio = furi_hal_subghz.cc1101_g0_pin;
if((furi_hal_subghz.async_mirror_pin != NULL) &&
(furi_hal_subghz.radio_type == SubGhzRadioInternal)) {
gpio = furi_hal_subghz.async_mirror_pin;
}
furi_hal_subghz_debug_gpio_buff[0] = (uint32_t)gpio->pin << GPIO_NUMBER;
furi_hal_subghz_debug_gpio_buff[1] = gpio->pin;
@ -828,6 +838,9 @@ void furi_hal_subghz_stop_async_tx() {
// Deinitialize GPIO
furi_hal_gpio_init(furi_hal_subghz.cc1101_g0_pin, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
// Stop debug
furi_hal_subghz_stop_debug();
LL_DMA_DisableChannel(SUBGHZ_DMA_CH2_DEF);
FURI_CRITICAL_EXIT();