Skip to content

Commit

Permalink
added ability to keep default tx settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudbreakdaniel committed Jun 18, 2022
1 parent e37b6e9 commit 97db0dc
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 53 deletions.
105 changes: 54 additions & 51 deletions assets/resources/subghz/assets/setting_user
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
Filetype: Flipper SubGhz Setting File
Version: 1

# Add Standard frequencies for your region
#add_standard_frequencies: true

# Default Frequency: used as default for "Read" and "Read Raw"
default_frequency: 433920000

# Frequencies used for "Read", "Read Raw" and "Frequency Analyzer"
frequency: 300000000
frequency: 302757000
frequency: 303875000
frequency: 304250000
frequency: 310000000
frequency: 312000000
frequency: 313850000
frequency: 314000000
frequency: 314350000
frequency: 315000000
frequency: 318000000
frequency: 345000000
frequency: 348000000
frequency: 387000000
frequency: 390000000
frequency: 418000000
frequency: 433075000
frequency: 433220000
frequency: 433420000
frequency: 433889000
frequency: 433920000
frequency: 434420000
frequency: 434775000
frequency: 438900000
frequency: 464000000
frequency: 779000000
frequency: 868350000
frequency: 915000000
frequency: 925000000
frequency: 928000000

# Frequencies used for hopping mode (keep this list small or flipper will miss signal)
hopper_frequency: 300000000
hopper_frequency: 310000000
hopper_frequency: 312000000
hopper_frequency: 314000000
hopper_frequency: 315000000
hopper_frequency: 318000000
hopper_frequency: 390000000
hopper_frequency: 433920000
hopper_frequency: 868350000
Filetype: Flipper SubGhz Setting File
Version: 1

# Add Standard frequencies for your region
#add_standard_frequencies: true

# Whether to ignore the default TX region settings
ignore_default_tx_region: false

# Default Frequency: used as default for "Read" and "Read Raw"
default_frequency: 433920000

# Frequencies used for "Read", "Read Raw" and "Frequency Analyzer"
frequency: 300000000
frequency: 302757000
frequency: 303875000
frequency: 304250000
frequency: 310000000
frequency: 312000000
frequency: 313850000
frequency: 314000000
frequency: 314350000
frequency: 315000000
frequency: 318000000
frequency: 345000000
frequency: 348000000
frequency: 387000000
frequency: 390000000
frequency: 418000000
frequency: 433075000
frequency: 433220000
frequency: 433420000
frequency: 433889000
frequency: 433920000
frequency: 434420000
frequency: 434775000
frequency: 438900000
frequency: 464000000
frequency: 779000000
frequency: 868350000
frequency: 915000000
frequency: 925000000
frequency: 928000000

# Frequencies used for hopping mode (keep this list small or flipper will miss signal)
hopper_frequency: 300000000
hopper_frequency: 310000000
hopper_frequency: 312000000
hopper_frequency: 314000000
hopper_frequency: 315000000
hopper_frequency: 318000000
hopper_frequency: 390000000
hopper_frequency: 433920000
hopper_frequency: 868350000
17 changes: 15 additions & 2 deletions firmware/targets/f7/furi_hal/furi_hal_subghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <furi_hal_interrupt.h>
#include <furi_hal_resources.h>

#include <lib/flipper_format/flipper_format.h>

#include <stm32wbxx_ll_dma.h>

#include <furi.h>
Expand Down Expand Up @@ -277,7 +279,18 @@ uint32_t furi_hal_subghz_set_frequency_and_path(uint32_t value) {

bool furi_hal_subghz_is_tx_allowed(uint32_t value) {
//checking regional settings
bool is_allowed = true;
bool is_allowed = false;

Storage* storage = furi_record_open("storage");
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);

if(flipper_format_file_open_existing(fff_data_file, "/ext/subghz/assets/setting_user")) {
flipper_format_read_bool(fff_data_file, "ignore_default_tx_region", &is_allowed, 1);
}

flipper_format_free(fff_data_file);
furi_record_close("storage");

switch(furi_hal_version_get_hw_region()) {
case FuriHalVersionRegionEuRu:
//433,05..434,79; 868,15..868,55
Expand Down Expand Up @@ -686,4 +699,4 @@ void furi_hal_subghz_stop_async_tx() {
(double)duty_cycle);

furi_hal_subghz.state = SubGhzStateIdle;
}
}

0 comments on commit 97db0dc

Please sign in to comment.