Skip to content

Commit

Permalink
Fix typo in subghz (#1467)
Browse files Browse the repository at this point in the history
* fix typo across subghz

Co-authored-by: あく <[email protected]>
Co-authored-by: Aleksandr Kutuzov <[email protected]>
  • Loading branch information
3 people authored Jul 30, 2022
1 parent 4c39dcb commit 712a48b
Show file tree
Hide file tree
Showing 63 changed files with 107 additions and 105 deletions.
4 changes: 2 additions & 2 deletions applications/subghz/helpers/subghz_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ typedef enum {
SubGhzViewIdTestPacket,
} SubGhzViewId;

struct SubGhzPesetDefinition {
struct SubGhzPresetDefinition {
string_t name;
uint32_t frequency;
uint8_t* data;
size_t data_size;
};

typedef struct SubGhzPesetDefinition SubGhzPesetDefinition;
typedef struct SubGhzPresetDefinition SubGhzPresetDefinition;
4 changes: 2 additions & 2 deletions applications/subghz/scenes/subghz_scene_receiver_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ static bool subghz_scene_receiver_info_update_parser(void* context) {
subghz->txrx->decoder_result,
subghz_history_get_raw_data(subghz->txrx->history, subghz->txrx->idx_menu_chosen));

SubGhzPesetDefinition* preset =
subghz_history_get_presset(subghz->txrx->history, subghz->txrx->idx_menu_chosen);
SubGhzPresetDefinition* preset =
subghz_history_get_preset_def(subghz->txrx->history, subghz->txrx->idx_menu_chosen);
subghz_preset_init(
subghz,
string_get_cstr(preset->name),
Expand Down
2 changes: 1 addition & 1 deletion applications/subghz/subghz.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ SubGhz* subghz_alloc() {
//init Worker & Protocol & History & KeyBoard
subghz->lock = SubGhzLockOff;
subghz->txrx = malloc(sizeof(SubGhzTxRx));
subghz->txrx->preset = malloc(sizeof(SubGhzPesetDefinition));
subghz->txrx->preset = malloc(sizeof(SubGhzPresetDefinition));
string_init(subghz->txrx->preset->name);
subghz_preset_init(
subghz, "AM650", subghz_setting_get_default_frequency(subghz->setting), NULL, 0);
Expand Down
8 changes: 4 additions & 4 deletions applications/subghz/subghz_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
string_t item_str;
FlipperFormat* flipper_string;
uint8_t type;
SubGhzPesetDefinition* preset;
SubGhzPresetDefinition* preset;
} SubGhzHistoryItem;

ARRAY_DEF(SubGhzHistoryItemArray, SubGhzHistoryItem, M_POD_OPLIST)
Expand Down Expand Up @@ -61,7 +61,7 @@ uint32_t subghz_history_get_frequency(SubGhzHistory* instance, uint16_t idx) {
return item->preset->frequency;
}

SubGhzPesetDefinition* subghz_history_get_presset(SubGhzHistory* instance, uint16_t idx) {
SubGhzPresetDefinition* subghz_history_get_preset_def(SubGhzHistory* instance, uint16_t idx) {
furi_assert(instance);
SubGhzHistoryItem* item = SubGhzHistoryItemArray_get(instance->history->data, idx);
return item->preset;
Expand Down Expand Up @@ -139,7 +139,7 @@ void subghz_history_get_text_item_menu(SubGhzHistory* instance, string_t output,
bool subghz_history_add_to_history(
SubGhzHistory* instance,
void* context,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(instance);
furi_assert(context);

Expand All @@ -159,7 +159,7 @@ bool subghz_history_add_to_history(
string_t text;
string_init(text);
SubGhzHistoryItem* item = SubGhzHistoryItemArray_push_raw(instance->history->data);
item->preset = malloc(sizeof(SubGhzPesetDefinition));
item->preset = malloc(sizeof(SubGhzPresetDefinition));
item->type = decoder_base->protocol->type;
item->preset->frequency = preset->frequency;
string_init(item->preset->name);
Expand Down
6 changes: 3 additions & 3 deletions applications/subghz/subghz_history.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void subghz_history_reset(SubGhzHistory* instance);
*/
uint32_t subghz_history_get_frequency(SubGhzHistory* instance, uint16_t idx);

SubGhzPesetDefinition* subghz_history_get_presset(SubGhzHistory* instance, uint16_t idx);
SubGhzPresetDefinition* subghz_history_get_preset_def(SubGhzHistory* instance, uint16_t idx);

/** Get preset to history[idx]
*
Expand Down Expand Up @@ -88,13 +88,13 @@ bool subghz_history_get_text_space_left(SubGhzHistory* instance, string_t output
*
* @param instance - SubGhzHistory instance
* @param context - SubGhzProtocolCommon context
* @param preset - SubGhzPesetDefinition preset
* @param preset - SubGhzPresetDefinition preset
* @return bool;
*/
bool subghz_history_add_to_history(
SubGhzHistory* instance,
void* context,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/** Get SubGhzProtocolCommonLoad to load into the protocol decoder bin data
*
Expand Down
2 changes: 1 addition & 1 deletion applications/subghz/subghz_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct SubGhzTxRx {
SubGhzProtocolDecoderBase* decoder_result;
FlipperFormat* fff_data;

SubGhzPesetDefinition* preset;
SubGhzPresetDefinition* preset;
SubGhzHistory* history;
uint16_t idx_menu_chosen;
SubGhzTxRxState txrx_state;
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/blocks/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void subghz_block_generic_get_preset_name(const char* preset_name, string_t pres
bool subghz_block_generic_serialize(
SubGhzBlockGeneric* instance,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(instance);
bool res = false;
string_t temp_str;
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/blocks/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ void subghz_block_generic_get_preset_name(const char* preset_name, string_t pres
* Serialize data SubGhzBlockGeneric.
* @param instance Pointer to a SubGhzBlockGeneric instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_block_generic_serialize(
SubGhzBlockGeneric* instance,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzBlockGeneric.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool subghz_protocol_decoder_base_get_string(
bool subghz_protocol_decoder_base_serialize(
SubGhzProtocolDecoderBase* decoder_base,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
bool status = false;

if(decoder_base->protocol && decoder_base->protocol->decoder &&
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ bool subghz_protocol_decoder_base_get_string(
* Serialize data SubGhzProtocolDecoderBase.
* @param decoder_base Pointer to a SubGhzProtocolDecoderBase instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_base_serialize(
SubGhzProtocolDecoderBase* decoder_base,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderBase.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/came.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ uint8_t subghz_protocol_decoder_came_get_hash_data(void* context) {
bool subghz_protocol_decoder_came_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderCame* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/came.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_came_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderCame.
* @param context Pointer to a SubGhzProtocolDecoderCame instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_came_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderCame.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/came_atomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ uint8_t subghz_protocol_decoder_came_atomo_get_hash_data(void* context) {
bool subghz_protocol_decoder_came_atomo_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderCameAtomo* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/came_atomo.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ uint8_t subghz_protocol_decoder_came_atomo_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderCameAtomo.
* @param context Pointer to a SubGhzProtocolDecoderCameAtomo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_came_atomo_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderCameAtomo.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/came_twee.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ uint8_t subghz_protocol_decoder_came_twee_get_hash_data(void* context) {
bool subghz_protocol_decoder_came_twee_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderCameTwee* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/came_twee.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_came_twee_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderCameTwee.
* @param context Pointer to a SubGhzProtocolDecoderCameTwee instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_came_twee_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderCameTwee.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/chamberlain_code.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ uint8_t subghz_protocol_decoder_chamb_code_get_hash_data(void* context) {
bool subghz_protocol_decoder_chamb_code_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderChamb_Code* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/chamberlain_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_chamb_code_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderChamb_Code.
* @param context Pointer to a SubGhzProtocolDecoderChamb_Code instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_chamb_code_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderChamb_Code.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/faac_slh.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ uint8_t subghz_protocol_decoder_faac_slh_get_hash_data(void* context) {
bool subghz_protocol_decoder_faac_slh_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderFaacSLH* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/faac_slh.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ uint8_t subghz_protocol_decoder_faac_slh_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderFaacSLH.
* @param context Pointer to a SubGhzProtocolDecoderFaacSLH instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_faac_slh_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderFaacSLH.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/gate_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ uint8_t subghz_protocol_decoder_gate_tx_get_hash_data(void* context) {
bool subghz_protocol_decoder_gate_tx_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderGateTx* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/gate_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_gate_tx_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderGateTx.
* @param context Pointer to a SubGhzProtocolDecoderGateTx instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_gate_tx_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderGateTx.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/holtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ uint8_t subghz_protocol_decoder_holtek_get_hash_data(void* context) {
bool subghz_protocol_decoder_holtek_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderHoltek* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/holtek.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_holtek_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderHoltek.
* @param context Pointer to a SubGhzProtocolDecoderHoltek instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_holtek_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderHoltek.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/hormann.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ uint8_t subghz_protocol_decoder_hormann_get_hash_data(void* context) {
bool subghz_protocol_decoder_hormann_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderHormann* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/hormann.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ uint8_t subghz_protocol_decoder_hormann_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderHormann.
* @param context Pointer to a SubGhzProtocolDecoderHormann instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_hormann_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderHormann.
Expand Down
2 changes: 1 addition & 1 deletion lib/subghz/protocols/ido.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ uint8_t subghz_protocol_decoder_ido_get_hash_data(void* context) {
bool subghz_protocol_decoder_ido_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderIDo* instance = context;
return subghz_block_generic_serialize(&instance->generic, flipper_format, preset);
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/ido.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ uint8_t subghz_protocol_decoder_ido_get_hash_data(void* context);
* Serialize data SubGhzProtocolDecoderIDo.
* @param context Pointer to a SubGhzProtocolDecoderIDo instance
* @param flipper_format Pointer to a FlipperFormat instance
* @param preset The modulation on which the signal was received, SubGhzPesetDefinition
* @param preset The modulation on which the signal was received, SubGhzPresetDefinition
* @return true On success
*/
bool subghz_protocol_decoder_ido_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset);
SubGhzPresetDefinition* preset);

/**
* Deserialize data SubGhzProtocolDecoderIDo.
Expand Down
4 changes: 2 additions & 2 deletions lib/subghz/protocols/keeloq.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ bool subghz_protocol_keeloq_create_data(
uint8_t btn,
uint16_t cnt,
const char* manufacture_name,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolEncoderKeeloq* instance = context;
instance->generic.serial = serial;
Expand Down Expand Up @@ -631,7 +631,7 @@ uint8_t subghz_protocol_decoder_keeloq_get_hash_data(void* context) {
bool subghz_protocol_decoder_keeloq_serialize(
void* context,
FlipperFormat* flipper_format,
SubGhzPesetDefinition* preset) {
SubGhzPresetDefinition* preset) {
furi_assert(context);
SubGhzProtocolDecoderKeeloq* instance = context;
subghz_protocol_keeloq_check_remote_controller(
Expand Down
Loading

0 comments on commit 712a48b

Please sign in to comment.