mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
Temp fix
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:
parent
175287ee0a
commit
a098e0561e
3 changed files with 27 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue