mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-27 01:58:09 -07:00
libs: stricter constness for saving RAM with .rodata section; fbt: sdk: fixed signature generation for nested const params
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "protocol_ds1971.h"
|
||||
#include "protocol_ds_generic.h"
|
||||
|
||||
const iButtonProtocolDallasBase* ibutton_protocols_dallas[] = {
|
||||
const iButtonProtocolDallasBase* const ibutton_protocols_dallas[] = {
|
||||
[iButtonProtocolDS1990] = &ibutton_protocol_ds1990,
|
||||
[iButtonProtocolDS1992] = &ibutton_protocol_ds1992,
|
||||
[iButtonProtocolDS1996] = &ibutton_protocol_ds1996,
|
||||
|
||||
@@ -14,4 +14,4 @@ typedef enum {
|
||||
iButtonProtocolDSMax,
|
||||
} iButtonProtocolDallas;
|
||||
|
||||
extern const iButtonProtocolDallasBase* ibutton_protocols_dallas[];
|
||||
extern const iButtonProtocolDallasBase* const ibutton_protocols_dallas[];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "protocol_cyfral.h"
|
||||
#include "protocol_metakom.h"
|
||||
|
||||
const ProtocolBase* ibutton_protocols_misc[] = {
|
||||
const ProtocolBase* const ibutton_protocols_misc[] = {
|
||||
[iButtonProtocolMiscCyfral] = &ibutton_protocol_misc_cyfral,
|
||||
[iButtonProtocolMiscMetakom] = &ibutton_protocol_misc_metakom,
|
||||
/* Add new misc protocols here */
|
||||
|
||||
@@ -8,4 +8,4 @@ typedef enum {
|
||||
iButtonProtocolMiscMax,
|
||||
} iButtonProtocolMisc;
|
||||
|
||||
extern const ProtocolBase* ibutton_protocols_misc[];
|
||||
extern const ProtocolBase* const ibutton_protocols_misc[];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "dallas/protocol_group_dallas.h"
|
||||
#include "misc/protocol_group_misc.h"
|
||||
|
||||
const iButtonProtocolGroupBase* ibutton_protocol_groups[] = {
|
||||
const iButtonProtocolGroupBase* const ibutton_protocol_groups[] = {
|
||||
[iButtonProtocolGroupDallas] = &ibutton_protocol_group_dallas,
|
||||
[iButtonProtocolGroupMisc] = &ibutton_protocol_group_misc,
|
||||
};
|
||||
|
||||
@@ -8,4 +8,4 @@ typedef enum {
|
||||
iButtonProtocolGroupMax
|
||||
} iButtonProtocolGroup;
|
||||
|
||||
extern const iButtonProtocolGroupBase* ibutton_protocol_groups[];
|
||||
extern const iButtonProtocolGroupBase* const ibutton_protocol_groups[];
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "protocol_gproxii.h"
|
||||
#include "protocol_noralsy.h"
|
||||
|
||||
const ProtocolBase* lfrfid_protocols[] = {
|
||||
const ProtocolBase* const lfrfid_protocols[] = {
|
||||
[LFRFIDProtocolEM4100] = &protocol_em4100,
|
||||
[LFRFIDProtocolEM410032] = &protocol_em4100_32,
|
||||
[LFRFIDProtocolEM410016] = &protocol_em4100_16,
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef enum {
|
||||
LFRFIDProtocolMax,
|
||||
} LFRFIDProtocol;
|
||||
|
||||
extern const ProtocolBase* lfrfid_protocols[];
|
||||
extern const ProtocolBase* const lfrfid_protocols[];
|
||||
|
||||
typedef enum {
|
||||
LFRFIDWriteTypeT5577,
|
||||
|
||||
@@ -21,7 +21,7 @@ typedef struct {
|
||||
uint8_t chk;
|
||||
} ProtocolNexwatchMagic;
|
||||
|
||||
ProtocolNexwatchMagic magic_items[] = {
|
||||
static ProtocolNexwatchMagic magic_items[] = {
|
||||
{0xBE, "Quadrakey", 0},
|
||||
{0x88, "Nexkey", 0},
|
||||
{0x86, "Honeywell", 0}};
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef struct {
|
||||
uint8_t cmd_start_byte;
|
||||
size_t cmd_len_bits;
|
||||
size_t command_num;
|
||||
MfClassicListenerCommandHandler* handler;
|
||||
const MfClassicListenerCommandHandler* handler;
|
||||
} MfClassicListenerCmd;
|
||||
|
||||
static void mf_classic_listener_prepare_emulation(MfClassicListener* instance) {
|
||||
@@ -441,42 +441,42 @@ static MfClassicListenerCommand
|
||||
return command;
|
||||
}
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_halt_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_halt_handlers[] = {
|
||||
mf_classic_listener_halt_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_auth_key_a_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_auth_key_a_handlers[] = {
|
||||
mf_classic_listener_auth_key_a_handler,
|
||||
mf_classic_listener_auth_second_part_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_auth_key_b_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_auth_key_b_handlers[] = {
|
||||
mf_classic_listener_auth_key_b_handler,
|
||||
mf_classic_listener_auth_second_part_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_read_block_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_read_block_handlers[] = {
|
||||
mf_classic_listener_read_block_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_write_block_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_write_block_handlers[] = {
|
||||
mf_classic_listener_write_block_first_part_handler,
|
||||
mf_classic_listener_write_block_second_part_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_value_dec_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_value_dec_handlers[] = {
|
||||
mf_classic_listener_value_dec_handler,
|
||||
mf_classic_listener_value_data_receive_handler,
|
||||
mf_classic_listener_value_transfer_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_value_inc_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_value_inc_handlers[] = {
|
||||
mf_classic_listener_value_inc_handler,
|
||||
mf_classic_listener_value_data_receive_handler,
|
||||
mf_classic_listener_value_transfer_handler,
|
||||
};
|
||||
|
||||
static MfClassicListenerCommandHandler mf_classic_listener_value_restore_handlers[] = {
|
||||
static const MfClassicListenerCommandHandler mf_classic_listener_value_restore_handlers[] = {
|
||||
mf_classic_listener_value_restore_handler,
|
||||
mf_classic_listener_value_data_receive_handler,
|
||||
mf_classic_listener_value_transfer_handler,
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
* When implementing a new protocol, add its implementation
|
||||
* here under its own index defined in nfc_protocol.h.
|
||||
*/
|
||||
const NfcDeviceBase* nfc_devices[NfcProtocolNum] = {
|
||||
const NfcDeviceBase* const nfc_devices[NfcProtocolNum] = {
|
||||
[NfcProtocolIso14443_3a] = &nfc_device_iso14443_3a,
|
||||
[NfcProtocolIso14443_3b] = &nfc_device_iso14443_3b,
|
||||
[NfcProtocolIso14443_4a] = &nfc_device_iso14443_4a,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NfcDeviceBase* nfc_devices[];
|
||||
extern const NfcDeviceBase* const nfc_devices[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <nfc/protocols/slix/slix_listener_defs.h>
|
||||
#include <nfc/protocols/felica/felica_listener_defs.h>
|
||||
|
||||
const NfcListenerBase* nfc_listeners_api[NfcProtocolNum] = {
|
||||
const NfcListenerBase* const nfc_listeners_api[NfcProtocolNum] = {
|
||||
[NfcProtocolIso14443_3a] = &nfc_listener_iso14443_3a,
|
||||
[NfcProtocolIso14443_3b] = NULL,
|
||||
[NfcProtocolIso14443_4a] = &nfc_listener_iso14443_4a,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NfcListenerBase* nfc_listeners_api[NfcProtocolNum];
|
||||
extern const NfcListenerBase* const nfc_listeners_api[NfcProtocolNum];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <nfc/protocols/slix/slix_poller_defs.h>
|
||||
#include <nfc/protocols/st25tb/st25tb_poller_defs.h>
|
||||
|
||||
const NfcPollerBase* nfc_pollers_api[NfcProtocolNum] = {
|
||||
const NfcPollerBase* const nfc_pollers_api[NfcProtocolNum] = {
|
||||
[NfcProtocolIso14443_3a] = &nfc_poller_iso14443_3a,
|
||||
[NfcProtocolIso14443_3b] = &nfc_poller_iso14443_3b,
|
||||
[NfcProtocolIso14443_4a] = &nfc_poller_iso14443_4a,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const NfcPollerBase* nfc_pollers_api[NfcProtocolNum];
|
||||
extern const NfcPollerBase* const nfc_pollers_api[NfcProtocolNum];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "protocol_items.h" // IWYU pragma: keep
|
||||
|
||||
const SubGhzProtocol* subghz_protocol_registry_items[] = {
|
||||
const SubGhzProtocol* const subghz_protocol_registry_items[] = {
|
||||
&subghz_protocol_gate_tx,
|
||||
&subghz_protocol_keeloq,
|
||||
&subghz_protocol_star_line,
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct SubGhzProtocolRegistry SubGhzProtocolRegistry;
|
||||
typedef struct SubGhzProtocol SubGhzProtocol;
|
||||
|
||||
struct SubGhzProtocolRegistry {
|
||||
const SubGhzProtocol** items;
|
||||
const SubGhzProtocol* const* items;
|
||||
const size_t size;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
#include "protocol_dict.h"
|
||||
|
||||
struct ProtocolDict {
|
||||
const ProtocolBase** base;
|
||||
const ProtocolBase* const* base;
|
||||
size_t count;
|
||||
void* data[];
|
||||
};
|
||||
|
||||
ProtocolDict* protocol_dict_alloc(const ProtocolBase** protocols, size_t count) {
|
||||
ProtocolDict* protocol_dict_alloc(const ProtocolBase* const* protocols, size_t count) {
|
||||
furi_check(protocols);
|
||||
|
||||
ProtocolDict* dict = malloc(sizeof(ProtocolDict) + (sizeof(void*) * count));
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef int32_t ProtocolId;
|
||||
#define PROTOCOL_NO (-1)
|
||||
#define PROTOCOL_ALL_FEATURES (0xFFFFFFFF)
|
||||
|
||||
ProtocolDict* protocol_dict_alloc(const ProtocolBase** protocols, size_t protocol_count);
|
||||
ProtocolDict* protocol_dict_alloc(const ProtocolBase* const* protocols, size_t protocol_count);
|
||||
|
||||
void protocol_dict_free(ProtocolDict* dict);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user