mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-22 05:14:46 -07: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:
@@ -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]);
|
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;
|
subghz->txrx->debug_pin_state = index == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -597,6 +597,10 @@ void subghz_hopper_update(SubGhz* subghz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void subghz_speaker_on(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(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
|
||||||
if(furi_hal_speaker_acquire(30)) {
|
if(furi_hal_speaker_acquire(30)) {
|
||||||
if(!subghz->txrx->debug_pin_state) {
|
if(!subghz->txrx->debug_pin_state) {
|
||||||
@@ -609,6 +613,9 @@ void subghz_speaker_on(SubGhz* subghz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void subghz_speaker_off(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(subghz->txrx->speaker_state != SubGhzSpeakerStateDisable) {
|
||||||
if(furi_hal_speaker_is_mine()) {
|
if(furi_hal_speaker_is_mine()) {
|
||||||
if(!subghz->txrx->debug_pin_state) {
|
if(!subghz->txrx->debug_pin_state) {
|
||||||
@@ -622,6 +629,9 @@ void subghz_speaker_off(SubGhz* subghz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void subghz_speaker_mute(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(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
|
||||||
if(furi_hal_speaker_is_mine()) {
|
if(furi_hal_speaker_is_mine()) {
|
||||||
if(!subghz->txrx->debug_pin_state) {
|
if(!subghz->txrx->debug_pin_state) {
|
||||||
@@ -632,6 +642,9 @@ void subghz_speaker_mute(SubGhz* subghz) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void subghz_speaker_unmute(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(subghz->txrx->speaker_state == SubGhzSpeakerStateEnable) {
|
||||||
if(furi_hal_speaker_is_mine()) {
|
if(furi_hal_speaker_is_mine()) {
|
||||||
if(!subghz->txrx->debug_pin_state) {
|
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_SetCounter(TIM2, 0);
|
||||||
LL_TIM_EnableCounter(TIM2);
|
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;
|
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[0] = (uint32_t)gpio->pin << GPIO_NUMBER;
|
||||||
furi_hal_subghz_debug_gpio_buff[1] = gpio->pin;
|
furi_hal_subghz_debug_gpio_buff[1] = gpio->pin;
|
||||||
|
|
||||||
@@ -828,6 +838,9 @@ void furi_hal_subghz_stop_async_tx() {
|
|||||||
// Deinitialize GPIO
|
// Deinitialize GPIO
|
||||||
furi_hal_gpio_init(furi_hal_subghz.cc1101_g0_pin, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
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);
|
LL_DMA_DisableChannel(SUBGHZ_DMA_CH2_DEF);
|
||||||
|
|
||||||
FURI_CRITICAL_EXIT();
|
FURI_CRITICAL_EXIT();
|
||||||
|
|||||||
Reference in New Issue
Block a user