mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
[FL-3867] Code formatting update (#3765)
* clang-format: AllowShortEnumsOnASingleLine: false * clang-format: InsertNewlineAtEOF: true * clang-format: Standard: c++20 * clang-format: AlignConsecutiveBitFields * clang-format: AlignConsecutiveMacros * clang-format: RemoveParentheses: ReturnStatement * clang-format: RemoveSemicolon: true * Restored RemoveParentheses: Leave, retained general changes for it * formatting: fixed logging TAGs * Formatting update for dev Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <lib/subghz/subghz_tx_rx_worker.h>
|
||||
|
||||
#define TAG "SubGhzChat"
|
||||
|
||||
#define SUBGHZ_CHAT_WORKER_TIMEOUT_BETWEEN_MESSAGES 500
|
||||
|
||||
struct SubGhzChatWorker {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <float_tools.h>
|
||||
|
||||
#define TAG "SubGhzThresholdRssi"
|
||||
|
||||
#define THRESHOLD_RSSI_LOW_COUNT 10
|
||||
|
||||
struct SubGhzThresholdRssi {
|
||||
|
||||
@@ -508,22 +508,19 @@ SubGhzProtocolDecoderBase* subghz_txrx_get_decoder(SubGhzTxRx* instance) {
|
||||
|
||||
bool subghz_txrx_protocol_is_serializable(SubGhzTxRx* instance) {
|
||||
furi_assert(instance);
|
||||
return (
|
||||
(instance->decoder_result->protocol->flag & SubGhzProtocolFlag_Save) ==
|
||||
SubGhzProtocolFlag_Save);
|
||||
return (instance->decoder_result->protocol->flag & SubGhzProtocolFlag_Save) ==
|
||||
SubGhzProtocolFlag_Save;
|
||||
}
|
||||
|
||||
bool subghz_txrx_protocol_is_transmittable(SubGhzTxRx* instance, bool check_type) {
|
||||
furi_assert(instance);
|
||||
const SubGhzProtocol* protocol = instance->decoder_result->protocol;
|
||||
if(check_type) {
|
||||
return (
|
||||
((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||
protocol->encoder->deserialize && protocol->type == SubGhzProtocolTypeStatic);
|
||||
return ((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||
protocol->encoder->deserialize && protocol->type == SubGhzProtocolTypeStatic;
|
||||
}
|
||||
return (
|
||||
((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||
protocol->encoder->deserialize);
|
||||
return ((protocol->flag & SubGhzProtocolFlag_Send) == SubGhzProtocolFlag_Send) &&
|
||||
protocol->encoder->deserialize;
|
||||
}
|
||||
|
||||
void subghz_txrx_receiver_set_filter(SubGhzTxRx* instance, SubGhzProtocolFlag filter) {
|
||||
@@ -609,4 +606,4 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance) {
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency) {
|
||||
furi_assert(instance);
|
||||
return subghz_devices_is_frequency_valid(instance->radio_device, frequency);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,4 +333,4 @@ const char* subghz_txrx_radio_device_get_name(SubGhzTxRx* instance);
|
||||
* @param instance Pointer to a SubGhzTxRx
|
||||
* @return bool True if the frequency is valid
|
||||
*/
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
bool subghz_txrx_radio_device_is_frequecy_valid(SubGhzTxRx* instance, uint32_t frequency);
|
||||
|
||||
@@ -93,4 +93,4 @@ SubGhzProtocolStatus subghz_txrx_gen_secplus_v2_protocol(
|
||||
SubGhzProtocolStatus subghz_txrx_gen_secplus_v1_protocol(
|
||||
SubGhzTxRx* instance,
|
||||
const char* name_preset,
|
||||
uint32_t frequency);
|
||||
uint32_t frequency);
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
#include <lib/subghz/protocols/raw.h>
|
||||
#include <toolbox/path.h>
|
||||
|
||||
#define RAW_FILE_NAME "Raw_signal_"
|
||||
#define TAG "SubGhzSceneReadRaw"
|
||||
|
||||
#define RAW_FILE_NAME "Raw_signal_"
|
||||
|
||||
bool subghz_scene_read_raw_update_filename(SubGhz* subghz) {
|
||||
bool ret = false;
|
||||
//set the path to read the file
|
||||
|
||||
@@ -1203,7 +1203,7 @@ static bool
|
||||
subghz_on_system_start_istream_read(pb_istream_t* istream, pb_byte_t* buf, size_t count) {
|
||||
File* file = istream->state;
|
||||
size_t ret = storage_file_read(file, buf, count);
|
||||
return (count == ret);
|
||||
return count == ret;
|
||||
}
|
||||
|
||||
static bool subghz_on_system_start_istream_decode_band(
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#define SUBGHZ_HISTORY_MAX 50
|
||||
#define SUBGHZ_HISTORY_MAX 50
|
||||
#define SUBGHZ_HISTORY_FREE_HEAP 20480
|
||||
|
||||
#define TAG "SubGhzHistory"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -408,7 +408,7 @@ void subghz_unlock(SubGhz* subghz) {
|
||||
|
||||
bool subghz_is_locked(SubGhz* subghz) {
|
||||
furi_assert(subghz);
|
||||
return (subghz->lock == SubGhzLockOn);
|
||||
return subghz->lock == SubGhzLockOn;
|
||||
}
|
||||
|
||||
void subghz_rx_key_state_set(SubGhz* subghz, SubGhzRxKeyState state) {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <m-array.h>
|
||||
|
||||
#define FRAME_HEIGHT 12
|
||||
#define MAX_LEN_PX 111
|
||||
#define MENU_ITEMS 4u
|
||||
#define UNLOCK_CNT 3
|
||||
#define MAX_LEN_PX 111
|
||||
#define MENU_ITEMS 4u
|
||||
#define UNLOCK_CNT 3
|
||||
|
||||
#define SUBGHZ_RAW_THRESHOLD_MIN -90.0f
|
||||
|
||||
@@ -145,7 +145,7 @@ void subghz_view_receiver_add_item_to_menu(
|
||||
SubGhzReceiverMenuItemArray_push_raw(model->history->data);
|
||||
item_menu->item_str = furi_string_alloc_set(name);
|
||||
item_menu->type = type;
|
||||
if((model->idx == model->history_item - 1)) {
|
||||
if(model->idx == model->history_item - 1) {
|
||||
model->history_item++;
|
||||
model->idx++;
|
||||
} else {
|
||||
|
||||
@@ -46,8 +46,7 @@ typedef struct {
|
||||
} SubGhzFrequencyAnalyzerModel;
|
||||
|
||||
static inline uint8_t rssi_sanitize(float rssi) {
|
||||
return (
|
||||
!float_is_equal(rssi, 0.f) ? (uint8_t)(rssi - SUBGHZ_FREQUENCY_ANALYZER_THRESHOLD) : 0);
|
||||
return !float_is_equal(rssi, 0.f) ? (uint8_t)(rssi - SUBGHZ_FREQUENCY_ANALYZER_THRESHOLD) : 0;
|
||||
}
|
||||
|
||||
void subghz_frequency_analyzer_set_callback(
|
||||
|
||||
@@ -6,9 +6,11 @@
|
||||
#include <gui/elements.h>
|
||||
|
||||
#include <assets_icons.h>
|
||||
#define SUBGHZ_READ_RAW_RSSI_HISTORY_SIZE 100
|
||||
|
||||
#define TAG "SubGhzReadRaw"
|
||||
|
||||
#define SUBGHZ_READ_RAW_RSSI_HISTORY_SIZE 100
|
||||
|
||||
struct SubGhzReadRAW {
|
||||
View* view;
|
||||
SubGhzReadRAWCallback callback;
|
||||
|
||||
Reference in New Issue
Block a user