mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge remote-tracking branch 'ofw/dev' into mntm-dev
This commit is contained in:
@@ -5,21 +5,22 @@
|
||||
#include <lib/subghz/devices/cc1101_int/cc1101_int_interconnect.h>
|
||||
#include <lib/subghz/blocks/custom_btn.h>
|
||||
|
||||
#include <power/power_service/power.h>
|
||||
|
||||
#define TAG "SubGhzTxRx"
|
||||
|
||||
static void subghz_txrx_radio_device_power_on(SubGhzTxRx* instance) {
|
||||
UNUSED(instance);
|
||||
uint8_t attempts = 0;
|
||||
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
|
||||
furi_hal_power_enable_otg();
|
||||
//CC1101 power-up time
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
Power* power = furi_record_open(RECORD_POWER);
|
||||
power_enable_otg(power, true);
|
||||
furi_record_close(RECORD_POWER);
|
||||
}
|
||||
|
||||
static void subghz_txrx_radio_device_power_off(SubGhzTxRx* instance) {
|
||||
UNUSED(instance);
|
||||
if(furi_hal_power_is_otg_enabled()) furi_hal_power_disable_otg();
|
||||
Power* power = furi_record_open(RECORD_POWER);
|
||||
power_enable_otg(power, false);
|
||||
furi_record_close(RECORD_POWER);
|
||||
}
|
||||
|
||||
SubGhzTxRx* subghz_txrx_alloc(void) {
|
||||
|
||||
Reference in New Issue
Block a user