Merge branch 'ul-dev' into xfw-dev

This commit is contained in:
Willy-JL
2023-04-07 23:40:28 +01:00
107 changed files with 3653 additions and 607 deletions

View File

@@ -147,6 +147,16 @@ void subghz_scene_receiver_on_enter(void* context) {
subghz_receiver_set_rx_callback(
subghz->txrx->receiver, subghz_scene_add_to_history_callback, subghz);
if(subghz->txrx->starline_state == SubGhzStarLineIgnoreEnable) {
SubGhzProtocolDecoderBase* protocoldecoderbase = NULL;
protocoldecoderbase =
subghz_receiver_search_decoder_base_by_name(subghz->txrx->receiver, "Star Line");
if(protocoldecoderbase) {
subghz_protocol_decoder_base_set_decoder_callback(
protocoldecoderbase, NULL, subghz->txrx->receiver);
}
}
subghz->state_notifications = SubGhzNotificationStateRx;
if(subghz->txrx->txrx_state == SubGhzTxRxStateRx) {
subghz_rx_end(subghz);

View File

@@ -6,6 +6,7 @@ enum SubGhzSettingIndex {
SubGhzSettingIndexHopping,
SubGhzSettingIndexModulation,
SubGhzSettingIndexBinRAW,
SubGhzSettingIndexIgnoreStarline,
SubGhzSettingIndexSound,
SubGhzSettingIndexLock,
SubGhzSettingIndexRAWThresholdRSSI,
@@ -68,6 +69,15 @@ const uint32_t bin_raw_value[BIN_RAW_COUNT] = {
SubGhzProtocolFlag_Decodable,
SubGhzProtocolFlag_Decodable | SubGhzProtocolFlag_BinRAW,
};
#define STAR_LINE_COUNT 2
const char* const star_line_text[STAR_LINE_COUNT] = {
"OFF",
"ON",
};
const uint32_t star_line_value[STAR_LINE_COUNT] = {
SubGhzStarLineIgnoreDisable,
SubGhzStarLineIgnoreEnable,
};
uint8_t subghz_scene_receiver_config_next_frequency(const uint32_t value, void* context) {
furi_assert(context);
@@ -217,6 +227,14 @@ static void subghz_scene_receiver_config_set_raw_threshold_rssi(VariableItem* it
subghz->txrx->raw_threshold_rssi = raw_threshold_rssi_value[index];
}
static void subghz_scene_receiver_config_set_starline(VariableItem* item) {
SubGhz* subghz = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
variable_item_set_current_value_text(item, star_line_text[index]);
subghz->txrx->starline_state = star_line_value[index];
}
static void subghz_scene_receiver_config_var_list_enter_callback(void* context, uint32_t index) {
furi_assert(context);
SubGhz* subghz = context;
@@ -291,6 +309,21 @@ void subghz_scene_receiver_config_on_enter(void* context) {
variable_item_set_current_value_text(item, bin_raw_text[value_index]);
}
if(scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneReadRAW) !=
SubGhzCustomEventManagerSet) {
item = variable_item_list_add(
subghz->variable_item_list,
"Ignore StarLine:",
STAR_LINE_COUNT,
subghz_scene_receiver_config_set_starline,
subghz);
value_index =
value_index_uint32(subghz->txrx->starline_state, star_line_value, STAR_LINE_COUNT);
variable_item_set_current_value_index(item, value_index);
variable_item_set_current_value_text(item, star_line_text[value_index]);
}
// Enable speaker, will send all incoming noises and signals to speaker so you can listen how your remote sounds like :)
item = variable_item_list_add(
subghz->variable_item_list,

View File

@@ -558,7 +558,7 @@ bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
subghz,
"AM650",
433920000,
(key & 0x00FFFFFF) | 0x04000000,
(key & 0x000FFFFF) | 0x04700000,
0x2,
0x0021,
"AN-Motors")) {