fix(B&W): Avoid having constants in SRAM (#2993)
fix constness to avoid having constants in data segment .... and thus free some precious RAM
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "intmodule_serial_driver.h"
|
||||
#endif
|
||||
|
||||
#include "crossfire.h"
|
||||
#include "telemetry/crossfire.h"
|
||||
|
||||
#define CROSSFIRE_CH_BITS 11
|
||||
@@ -283,7 +284,7 @@ static void crossfireDeInitInternal(void* context)
|
||||
state->deinit();
|
||||
}
|
||||
|
||||
etx_module_driver_t CrossfireInternalDriver = {
|
||||
const etx_module_driver_t CrossfireInternalDriver = {
|
||||
.protocol = PROTOCOL_CHANNELS_CROSSFIRE,
|
||||
.init = crossfireInitInternal,
|
||||
.deinit = crossfireDeInitInternal,
|
||||
@@ -323,7 +324,7 @@ static void crossfireDeInitExternal(void* context)
|
||||
mixerSchedulerSetPeriod(EXTERNAL_MODULE, 0);
|
||||
}
|
||||
|
||||
etx_module_driver_t CrossfireExternalDriver = {
|
||||
const etx_module_driver_t CrossfireExternalDriver = {
|
||||
.protocol = PROTOCOL_CHANNELS_CROSSFIRE,
|
||||
.init = crossfireInitExternal,
|
||||
.deinit = crossfireDeInitExternal,
|
||||
|
||||
@@ -23,5 +23,5 @@
|
||||
|
||||
#include "hal/module_driver.h"
|
||||
|
||||
extern etx_module_driver_t CrossfireInternalDriver;
|
||||
extern etx_module_driver_t CrossfireExternalDriver;
|
||||
extern const etx_module_driver_t CrossfireInternalDriver;
|
||||
extern const etx_module_driver_t CrossfireExternalDriver;
|
||||
|
||||
@@ -108,7 +108,7 @@ extern uint32_t NV14internalModuleFwVersion;
|
||||
// When using packed, the pointer in here end up not being aligned, which clang and gcc complain about
|
||||
// Keep the order of the fields that the so that the size stays small
|
||||
struct mm_options_strings {
|
||||
static const char* options[];
|
||||
static const char* const options[];
|
||||
};
|
||||
|
||||
const uint8_t getMaxMultiOptions();
|
||||
@@ -118,7 +118,7 @@ struct mm_protocol_definition {
|
||||
uint8_t maxSubtype;
|
||||
bool failsafe;
|
||||
bool disable_ch_mapping;
|
||||
const char** subTypeString;
|
||||
const char* const* subTypeString;
|
||||
const char* optionsstr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user