chore(radio): Fix some compiler warnings when building firmware (#4058)

This commit is contained in:
philmoz
2023-09-20 11:16:48 +10:00
committed by GitHub
parent c758e80cb8
commit e4f845c844
9 changed files with 10 additions and 15 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ class SensorButton : public Button {
setNumIdState();
strAppend(s, g_model.telemetrySensors[index].label, TELEM_LABEL_LEN);
auto lbl = tsStyle.newName(lvobj, s);
tsStyle.newName(lvobj, s);
box = tsStyle.newFreshCont(lvobj);
fresh = tsStyle.newFreshIcon(box);
@@ -27,6 +27,7 @@
static const uint8_t _trimMap[MAX_TRIMS * 2] = {6, 7, 4, 5, 2, 3, 0, 1, 8, 9, 10, 11};
#if !defined(PCBNV14)
static EnumKeys get_ith_key(uint8_t i)
{
auto supported_keys = keysGetSupported();
@@ -40,6 +41,7 @@ static EnumKeys get_ith_key(uint8_t i)
// we assume: i < keysGetMaxKeys()
return (EnumKeys)0;
}
#endif
class RadioKeyDiagsWindow : public Window
{
+1 -1
View File
@@ -500,11 +500,11 @@ void RadioSdManagerPage::fileAction(const char* path, const char* name,
if (clipboard.type == CLIPBOARD_TYPE_SD_FILE) {
menu->addLine(STR_PASTE, [=]() {
static char lfn[FF_MAX_LFN + 1]; // TODO optimize that!
char destFileName[2 * CLIPBOARD_PATH_LEN + 1];
f_getcwd((TCHAR*)lfn, FF_MAX_LFN);
// prevent copying to the same directory with the same name
char* destNamePtr = clipboard.data.sd.filename;
if (!strcmp(clipboard.data.sd.directory, lfn)) {
char destFileName[2 * CLIPBOARD_PATH_LEN + 1];
destNamePtr =
strAppend(destFileName, FILE_COPY_PREFIX, CLIPBOARD_PATH_LEN);
destNamePtr = strAppend(destNamePtr, clipboard.data.sd.filename,
+1 -3
View File
@@ -213,8 +213,6 @@ void ViewTextWindow::onEvent(event_t event)
#endif
}
static void checkbox_event_handler(lv_event_t* e);
class ViewChecklistWindow : public ViewTextWindow
{
public:
@@ -321,7 +319,7 @@ class ViewChecklistWindow : public ViewTextWindow
size_t cur = 0;
for(int i=0; i<bufSize; ++i)
for(size_t i=0; i<bufSize; ++i)
{
if (buffer[i] == '\n' || buffer[i] == '\r') {
buffer[i] = 0;
@@ -135,6 +135,7 @@ void onSdManagerMenu(const char * result)
strncpy(clipboard.data.sd.filename, line, CLIPBOARD_PATH_LEN-1);
}
else if (result == STR_PASTE) {
char destFileName[2 * CLIPBOARD_PATH_LEN + 1];
f_getcwd(lfn, FF_MAX_LFN);
// if destination is dir, copy into that dir
if (IS_DIRECTORY(line)) {
@@ -144,7 +145,6 @@ void onSdManagerMenu(const char * result)
char *destNamePtr = clipboard.data.sd.filename;
if (!strcmp(clipboard.data.sd.directory, lfn)) {
// prevent copying to the same directory under the same name
char destFileName[2 * CLIPBOARD_PATH_LEN + 1];
destNamePtr =
strAppend(destFileName, FILE_COPY_PREFIX, CLIPBOARD_PATH_LEN);
destNamePtr = strAppend(destNamePtr, clipboard.data.sd.filename,
+2
View File
@@ -79,10 +79,12 @@ struct our_longjmp * global_lj = 0;
uint32_t luaExtraMemoryUsage = 0;
#endif
#if defined(USE_TRIMS_AS_BUTTONS)
static bool _is_standalone_script()
{
return scriptInternalData[0].reference == SCRIPT_STANDALONE;
}
#endif
#if defined(LUA_ALLOCATOR_TRACER)
@@ -875,7 +875,7 @@ static uint32_t r_swtchSrc(const YamlNode* node, const char* val, uint8_t val_le
}
else if (val_len > 4 && (strncmp(val, trimSwitchNames[0], 4) == 0)) {
for (int i = 0; i < sizeof(trimSwitchNames)/sizeof(const char*); i += 1) {
for (size_t i = 0; i < sizeof(trimSwitchNames)/sizeof(const char*); i += 1) {
if (strncmp(val, trimSwitchNames[i], val_len) == 0) {
ival = SWSRC_FIRST_TRIM + i;
break;
@@ -229,6 +229,7 @@ static void SetSysClock(void);
void SystemInit(void)
{
#if defined(PCBFLYSKY)
extern void backlightLowInit( void );
backlightLowInit();
#endif
/* FPU settings ------------------------------------------------------------*/
-8
View File
@@ -77,7 +77,6 @@ static MultiModuleStatus multiModuleStatus[NUM_MODULES] = {MultiModuleStatus(),
static uint8_t multiBindStatus[NUM_MODULES] = {MULTI_BIND_NONE, MULTI_BIND_NONE};
static MultiBufferState multiTelemetryBufferState[NUM_MODULES];
static uint16_t multiTelemetryLastRxTS[NUM_MODULES];
MultiModuleStatus &getMultiModuleStatus(uint8_t module)
{
@@ -104,11 +103,6 @@ void setMultiTelemetryBufferState(uint8_t module, MultiBufferState state)
multiTelemetryBufferState[module] = state;
}
static uint16_t& getMultiTelemetryLastRxTS(uint8_t module)
{
return multiTelemetryLastRxTS[module];
}
#else // !INTERNAL_MODULE_MULTI
static MultiModuleStatus multiModuleStatus;
@@ -597,8 +591,6 @@ void processMultiTelemetryData(uint8_t data, uint8_t module)
{
uint8_t * rxBuffer = getTelemetryRxBuffer(module);
uint8_t &rxBufferCount = getTelemetryRxBufferCount(module);
uint16_t &lastRxTS = getMultiTelemetryLastRxTS(module);
// debugPrintf("State: %d, byte received %02X, buflen: %d\r\n",
// getMultiTelemetryBufferState(module), data, rxBufferCount);