mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-19 00:48:09 -07:00
Merge remote-tracking branch 'OFW/dev' into dev
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "hid_service.h"
|
||||
#include "app_common.h"
|
||||
#include "app_common.h" // IWYU pragma: keep
|
||||
#include <ble/ble.h>
|
||||
#include <furi_ble/event_dispatcher.h>
|
||||
#include <furi_ble/gatt.h>
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#include "lp5562_reg.h"
|
||||
#include <furi_hal.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void lp5562_reset(FuriHalI2cBusHandle* handle) {
|
||||
Reg0D_Reset reg = {.value = 0xFF};
|
||||
furi_hal_i2c_write_reg_8(handle, LP5562_ADDRESS, 0x0D, *(uint8_t*)®, LP5562_I2C_TIMEOUT);
|
||||
|
||||
@@ -19,17 +19,13 @@
|
||||
|
||||
#define TAG "FapAssets"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
typedef struct {
|
||||
typedef struct FURI_PACKED {
|
||||
uint32_t magic;
|
||||
uint32_t version;
|
||||
uint32_t dirs_count;
|
||||
uint32_t files_count;
|
||||
} FlipperApplicationAssetsHeader;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
typedef enum {
|
||||
AssetsSignatureResultEqual,
|
||||
AssetsSignatureResultNotEqual,
|
||||
|
||||
@@ -18,7 +18,7 @@ struct FlipperApplication {
|
||||
|
||||
/********************** Debugger access to loader state **********************/
|
||||
|
||||
LIST_DEF(FlipperApplicationList, const FlipperApplication*, M_POD_OPLIST);
|
||||
LIST_DEF(FlipperApplicationList, const FlipperApplication*, M_POD_OPLIST); // NOLINT
|
||||
|
||||
FlipperApplicationList_t flipper_application_loaded_app_list = {0};
|
||||
static bool flipper_application_loaded_app_list_initialized = false;
|
||||
@@ -277,8 +277,10 @@ static const char* preload_status_strings[] = {
|
||||
[FlipperApplicationPreloadStatusUnspecifiedError] = "Unknown error",
|
||||
[FlipperApplicationPreloadStatusInvalidFile] = "Invalid file",
|
||||
[FlipperApplicationPreloadStatusInvalidManifest] = "Invalid file manifest",
|
||||
[FlipperApplicationPreloadStatusApiTooOld] = "Update Application to use with this Firmware (ApiTooOld)",
|
||||
[FlipperApplicationPreloadStatusApiTooNew] = "Update Firmware to use with this Application (ApiTooNew)",
|
||||
[FlipperApplicationPreloadStatusApiTooOld] =
|
||||
"Update Application to use with this Firmware (ApiTooOld)",
|
||||
[FlipperApplicationPreloadStatusApiTooNew] =
|
||||
"Update Firmware to use with this Application (ApiTooNew)",
|
||||
[FlipperApplicationPreloadStatusTargetMismatch] = "Hardware target mismatch",
|
||||
};
|
||||
|
||||
@@ -286,7 +288,8 @@ static const char* load_status_strings[] = {
|
||||
[FlipperApplicationLoadStatusSuccess] = "Success",
|
||||
[FlipperApplicationLoadStatusUnspecifiedError] = "Unknown error",
|
||||
[FlipperApplicationLoadStatusNoFreeMemory] = "Out of memory",
|
||||
[FlipperApplicationLoadStatusMissingImports] = "Update Firmware to use with this Application (MissingImports)",
|
||||
[FlipperApplicationLoadStatusMissingImports] =
|
||||
"Update Firmware to use with this Application (MissingImports)",
|
||||
};
|
||||
|
||||
const char* flipper_application_preload_status_to_string(FlipperApplicationPreloadStatus status) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <m-list.h>
|
||||
#include <m-algo.h>
|
||||
|
||||
LIST_DEF(ElfApiInterfaceList, const ElfApiInterface*, M_POD_OPLIST)
|
||||
LIST_DEF(ElfApiInterfaceList, const ElfApiInterface*, M_POD_OPLIST) // NOLINT
|
||||
#define M_OPL_ElfApiInterfaceList_t() LIST_OPLIST(ElfApiInterfaceList, M_POD_OPLIST)
|
||||
|
||||
struct CompositeApiResolver {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#define TAG "PluginManager"
|
||||
|
||||
ARRAY_DEF(FlipperApplicationList, FlipperApplication*, M_PTR_OPLIST)
|
||||
ARRAY_DEF(FlipperApplicationList, FlipperApplication*, M_PTR_OPLIST) // NOLINT
|
||||
#define M_OPL_FlipperApplicationList_t() ARRAY_OPLIST(FlipperApplicationList, M_PTR_OPLIST)
|
||||
|
||||
struct PluginManager {
|
||||
|
||||
@@ -96,7 +96,7 @@ bool protocol_pac_stanley_decoder_feed(ProtocolPACStanley* protocol, bool level,
|
||||
|
||||
if(duration > PAC_STANLEY_MAX_TIME) return false;
|
||||
|
||||
uint8_t pulses = (uint8_t)round((float)duration / PAC_STANLEY_CYCLE_LENGTH);
|
||||
uint8_t pulses = (uint8_t)roundf((float)duration / PAC_STANLEY_CYCLE_LENGTH);
|
||||
|
||||
// Handle last stopbit & preamble (1 sb, 8 bit preamble)
|
||||
if(pulses >= 9 && !protocol->got_preamble) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "iso14443_3a_poller_sync.h"
|
||||
|
||||
#include "iso14443_3a_poller_i.h"
|
||||
#include "iso14443_3a_poller_i.h" // IWYU pragma: keep
|
||||
#include <nfc/nfc_poller.h>
|
||||
|
||||
#include <furi/furi.h>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "iso14443_3b_i.h"
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "iso14443_4b_i.h"
|
||||
#include "iso14443_4b_i.h" // IWYU pragma: keep
|
||||
|
||||
#include <furi.h>
|
||||
#include <nfc/protocols/nfc_device_base_i.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "pulse_reader.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <furi_hal_gpio.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "signal_reader.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <furi_hal_gpio.h>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include "const.h"
|
||||
@@ -529,7 +529,8 @@ static bool
|
||||
bin_raw_type = BinRAWTypeGap;
|
||||
//looking for the last occurrence of gap
|
||||
ind = instance->data_raw_ind - 1;
|
||||
while((ind > 0) && (DURATION_DIFF(abs(instance->data_raw[ind]), gap) > gap_delta)) {
|
||||
while((ind > 0) &&
|
||||
(DURATION_DIFF(abs(instance->data_raw[ind]), (int32_t)gap) > gap_delta)) {
|
||||
ind--;
|
||||
}
|
||||
gap_ind = ind;
|
||||
@@ -544,10 +545,10 @@ static bool
|
||||
uint16_t bit_count = 0;
|
||||
do {
|
||||
gap_ind--;
|
||||
data_temp = (int)(round((float)(instance->data_raw[gap_ind]) / instance->te));
|
||||
data_temp = (int)(roundf((float)(instance->data_raw[gap_ind]) / instance->te));
|
||||
bin_raw_debug("%d ", data_temp);
|
||||
if(data_temp == 0) bit_count++; //there is noise in the package
|
||||
for(size_t i = 0; i < abs(data_temp); i++) {
|
||||
for(size_t i = 0; i < (size_t)abs(data_temp); i++) {
|
||||
bit_count++;
|
||||
if(ind) {
|
||||
ind--;
|
||||
@@ -563,7 +564,7 @@ static bool
|
||||
}
|
||||
}
|
||||
//split into full bytes if gap is caught
|
||||
if(DURATION_DIFF(abs(instance->data_raw[gap_ind]), gap) < gap_delta) {
|
||||
if(DURATION_DIFF(abs(instance->data_raw[gap_ind]), (int32_t)gap) < gap_delta) {
|
||||
instance->data_markup[data_markup_ind].byte_bias = ind >> 3;
|
||||
instance->data_markup[data_markup_ind++].bit_count = bit_count;
|
||||
bit_count = 0;
|
||||
@@ -807,11 +808,11 @@ static bool
|
||||
bin_raw_debug_tag(TAG, "Sequence analysis without gap\r\n");
|
||||
ind = 0;
|
||||
for(size_t i = 0; i < instance->data_raw_ind; i++) {
|
||||
int data_temp = (int)(round((float)(instance->data_raw[i]) / instance->te));
|
||||
int data_temp = (int)(roundf((float)(instance->data_raw[i]) / instance->te));
|
||||
if(data_temp == 0) break; //found an interval 2 times shorter than TE, this is noise
|
||||
bin_raw_debug("%d ", data_temp);
|
||||
|
||||
for(size_t k = 0; k < abs(data_temp); k++) {
|
||||
for(size_t k = 0; k < (size_t)abs(data_temp); k++) {
|
||||
if(data_temp > 0) {
|
||||
subghz_protocol_blocks_set_bit_array(
|
||||
true, instance->data, ind++, BIN_RAW_BUF_DATA_SIZE);
|
||||
|
||||
@@ -470,6 +470,6 @@ void subghz_protocol_decoder_intertechno_v3_get_string(void* context, FuriString
|
||||
output,
|
||||
"Ch:" CH_PATTERN " Dimm:%d%%\r\n",
|
||||
CNT_TO_CH(instance->generic.cnt),
|
||||
(int)(6.67 * (float)instance->generic.btn));
|
||||
(int)(6.67f * (float)instance->generic.btn));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t
|
||||
|
||||
instance->generic.data = instance->decoder.decode_data;
|
||||
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
||||
instance->guard_time = round((float)duration / instance->te);
|
||||
instance->guard_time = roundf((float)duration / instance->te);
|
||||
|
||||
if(instance->base.callback)
|
||||
instance->base.callback(&instance->base, instance->base.context);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "protocol_items.h"
|
||||
#include "protocol_items.h" // IWYU pragma: keep
|
||||
|
||||
const SubGhzProtocol* subghz_protocol_registry_items[] = {
|
||||
&subghz_protocol_gate_tx,
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
#include "../subghz_file_encoder_worker.h"
|
||||
|
||||
#include "../blocks/const.h"
|
||||
#include "../blocks/decoder.h"
|
||||
#include "../blocks/encoder.h"
|
||||
#include "../blocks/generic.h"
|
||||
#include "../blocks/math.h"
|
||||
|
||||
#include <flipper_format/flipper_format_i.h>
|
||||
#include <lib/toolbox/stream/stream.h>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "receiver.h"
|
||||
|
||||
#include "registry.h"
|
||||
#include "protocols/protocol_items.h"
|
||||
|
||||
#include <m-array.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "subghz_setting.h"
|
||||
#include "types.h"
|
||||
//#include "subghz_i.h"
|
||||
#include "types.h" // IWYU pragma: keep
|
||||
|
||||
#include <furi.h>
|
||||
#include <m-list.h>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "protocols/base.h"
|
||||
#include "registry.h"
|
||||
#include "protocols/protocol_items.h"
|
||||
|
||||
struct SubGhzTransmitter {
|
||||
const SubGhzProtocol* protocol;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "manchester_encoder.h"
|
||||
#include <stdio.h>
|
||||
#include <furi.h>
|
||||
|
||||
void manchester_encoder_reset(ManchesterEncoderState* state) {
|
||||
|
||||
Reference in New Issue
Block a user