mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 22:08:36 -07:00
Merge branch 'fz-dev' into dev
This commit is contained in:
@@ -152,8 +152,12 @@ bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
|
|
||||||
instance->spi = NULL;
|
if(instance->spi) {
|
||||||
|
avr_isp_spi_sw_free(instance->spi);
|
||||||
|
instance->spi = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ static void avr_isp_prog_set_cfg(AvrIspProg* instance) {
|
|||||||
instance->cfg->lockbytes = instance->buff[6];
|
instance->cfg->lockbytes = instance->buff[6];
|
||||||
instance->cfg->fusebytes = instance->buff[7];
|
instance->cfg->fusebytes = instance->buff[7];
|
||||||
instance->cfg->flashpoll = instance->buff[8];
|
instance->cfg->flashpoll = instance->buff[8];
|
||||||
// ignore (instance->buff[9] == instance->buff[8]) //FLASH polling value. Same as “flashpoll”
|
// ignore (instance->buff[9] == instance->buff[8]) //FLASH polling value. Same as <EFBFBD>flashpoll<EFBFBD>
|
||||||
instance->cfg->eeprompoll = instance->buff[10] << 8 | instance->buff[11];
|
instance->cfg->eeprompoll = instance->buff[10] << 8 | instance->buff[11];
|
||||||
instance->cfg->pagesize = instance->buff[12] << 8 | instance->buff[13];
|
instance->cfg->pagesize = instance->buff[12] << 8 | instance->buff[13];
|
||||||
instance->cfg->eepromsize = instance->buff[14] << 8 | instance->buff[15];
|
instance->cfg->eepromsize = instance->buff[14] << 8 | instance->buff[15];
|
||||||
@@ -317,8 +317,12 @@ static bool avr_isp_prog_auto_set_spi_speed_start_pmode(AvrIspProg* instance) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
|
|
||||||
instance->spi = NULL;
|
if(instance->spi) {
|
||||||
|
avr_isp_spi_sw_free(instance->spi);
|
||||||
|
instance->spi = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -239,7 +239,11 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
|
|||||||
(subghz->txrx->txrx_state == SubGhzTxRxStateSleep)) {
|
(subghz->txrx->txrx_state == SubGhzTxRxStateSleep)) {
|
||||||
if(!subghz_tx_start(subghz, subghz->txrx->fff_data)) {
|
if(!subghz_tx_start(subghz, subghz->txrx->fff_data)) {
|
||||||
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
|
subghz->txrx->rx_key_state = SubGhzRxKeyStateBack;
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowOnlyRx);
|
subghz_read_raw_set_status(
|
||||||
|
subghz->subghz_read_raw,
|
||||||
|
SubGhzReadRAWStatusIDLE,
|
||||||
|
"",
|
||||||
|
subghz->txrx->raw_threshold_rssi);
|
||||||
} else {
|
} else {
|
||||||
if(scene_manager_has_previous_scene(
|
if(scene_manager_has_previous_scene(
|
||||||
subghz->scene_manager, SubGhzSceneSaved) ||
|
subghz->scene_manager, SubGhzSceneSaved) ||
|
||||||
|
|||||||
@@ -74,9 +74,7 @@ bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
|||||||
}
|
}
|
||||||
if((subghz->txrx->txrx_state == SubGhzTxRxStateIDLE) ||
|
if((subghz->txrx->txrx_state == SubGhzTxRxStateIDLE) ||
|
||||||
(subghz->txrx->txrx_state == SubGhzTxRxStateSleep)) {
|
(subghz->txrx->txrx_state == SubGhzTxRxStateSleep)) {
|
||||||
if(!subghz_tx_start(subghz, subghz->txrx->fff_data)) {
|
if(subghz_tx_start(subghz, subghz->txrx->fff_data)) {
|
||||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneShowOnlyRx);
|
|
||||||
} else {
|
|
||||||
subghz->state_notifications = SubGhzNotificationStateTx;
|
subghz->state_notifications = SubGhzNotificationStateTx;
|
||||||
subghz_scene_transmitter_update_data_show(subghz);
|
subghz_scene_transmitter_update_data_show(subghz);
|
||||||
DOLPHIN_DEED(DolphinDeedSubGhzSend);
|
DOLPHIN_DEED(DolphinDeedSubGhzSend);
|
||||||
|
|||||||
@@ -106,9 +106,11 @@ static bool subghz_tx(SubGhz* subghz, uint32_t frequency) {
|
|||||||
furi_hal_gpio_write(furi_hal_subghz.cc1101_g0_pin, false);
|
furi_hal_gpio_write(furi_hal_subghz.cc1101_g0_pin, false);
|
||||||
furi_hal_gpio_init(
|
furi_hal_gpio_init(
|
||||||
furi_hal_subghz.cc1101_g0_pin, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
furi_hal_subghz.cc1101_g0_pin, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||||
subghz_speaker_on(subghz);
|
|
||||||
bool ret = furi_hal_subghz_tx();
|
bool ret = furi_hal_subghz_tx();
|
||||||
subghz->txrx->txrx_state = SubGhzTxRxStateTx;
|
if(ret) {
|
||||||
|
subghz_speaker_on(subghz);
|
||||||
|
subghz->txrx->txrx_state = SubGhzTxRxStateTx;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,6 +118,7 @@ void subghz_idle(SubGhz* subghz) {
|
|||||||
furi_assert(subghz);
|
furi_assert(subghz);
|
||||||
furi_assert(subghz->txrx->txrx_state != SubGhzTxRxStateSleep);
|
furi_assert(subghz->txrx->txrx_state != SubGhzTxRxStateSleep);
|
||||||
furi_hal_subghz_idle();
|
furi_hal_subghz_idle();
|
||||||
|
subghz_speaker_off(subghz);
|
||||||
subghz->txrx->txrx_state = SubGhzTxRxStateIDLE;
|
subghz->txrx->txrx_state = SubGhzTxRxStateIDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,8 +166,9 @@ void furi_hal_resources_init() {
|
|||||||
furi_hal_resources_init_input_pins(GpioModeInterruptRiseFall);
|
furi_hal_resources_init_input_pins(GpioModeInterruptRiseFall);
|
||||||
|
|
||||||
// Explicit pulls pins
|
// Explicit pulls pins
|
||||||
furi_hal_gpio_init(&gpio_speaker, GpioModeAnalog, GpioPullDown, GpioSpeedLow);
|
LL_PWR_EnablePUPDCfg();
|
||||||
furi_hal_gpio_init(&gpio_vibro, GpioModeAnalog, GpioPullDown, GpioSpeedLow);
|
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_B, LL_PWR_GPIO_BIT_8); // gpio_speaker
|
||||||
|
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_A, LL_PWR_GPIO_BIT_8); // gpio_vibro
|
||||||
|
|
||||||
// Display pins
|
// Display pins
|
||||||
furi_hal_gpio_init(&gpio_display_rst_n, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(&gpio_display_rst_n, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||||
|
|||||||
@@ -158,10 +158,11 @@ void furi_hal_resources_init() {
|
|||||||
// Button pins
|
// Button pins
|
||||||
furi_hal_resources_init_input_pins(GpioModeInterruptRiseFall);
|
furi_hal_resources_init_input_pins(GpioModeInterruptRiseFall);
|
||||||
|
|
||||||
// Explicit pulls pins
|
// Explicit, surviving reset, pulls
|
||||||
furi_hal_gpio_init(&gpio_infrared_tx, GpioModeAnalog, GpioPullDown, GpioSpeedLow);
|
LL_PWR_EnablePUPDCfg();
|
||||||
furi_hal_gpio_init(&gpio_speaker, GpioModeAnalog, GpioPullDown, GpioSpeedLow);
|
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_B, LL_PWR_GPIO_BIT_9); // gpio_infrared_tx
|
||||||
furi_hal_gpio_init(&gpio_vibro, GpioModeAnalog, GpioPullDown, GpioSpeedLow);
|
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_B, LL_PWR_GPIO_BIT_8); // gpio_speaker
|
||||||
|
LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_A, LL_PWR_GPIO_BIT_8); // gpio_vibro
|
||||||
|
|
||||||
// Display pins
|
// Display pins
|
||||||
furi_hal_gpio_init(&gpio_display_rst_n, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(&gpio_display_rst_n, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||||
|
|||||||
Reference in New Issue
Block a user