chore: fix some compiler warnings when building firmware (#5453)

This commit is contained in:
philmoz
2024-08-18 11:57:11 +10:00
committed by GitHub
parent ce01091eea
commit 01869444c8
8 changed files with 9 additions and 16 deletions
+1 -1
View File
@@ -65,7 +65,7 @@
PACK(union SourceNumVal { PACK(union SourceNumVal {
struct { struct {
int16_t value:10; int16_t value:10;
int16_t isSource:1; uint16_t isSource:1;
}; };
uint16_t rawValue:11; uint16_t rawValue:11;
}); });
+1 -1
View File
@@ -42,7 +42,7 @@
#endif #endif
#if !defined(UNUSED) #if !defined(UNUSED)
#define UNUSED(x) ((void)(x)) /* to avoid warnings */ #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
#endif #endif
#if !defined(__ALIGNED) #if !defined(__ALIGNED)
+2
View File
@@ -157,7 +157,9 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
} }
#endif #endif
#if defined(VIDEO_SWITCH)
bool videoEnabled = false; bool videoEnabled = false;
#endif
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) { for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
const CustomFunctionData * cfn = &functions[i]; const CustomFunctionData * cfn = &functions[i];
swsrc_t swtch = CFN_SWITCH(cfn); swsrc_t swtch = CFN_SWITCH(cfn);
@@ -61,7 +61,7 @@ rect_t TopBar::getZone(unsigned int index) const
{ {
coord_t x = MENU_HEADER_BUTTONS_LEFT + 1; coord_t x = MENU_HEADER_BUTTONS_LEFT + 1;
for (int i = 0; i < index; i += 1) for (unsigned int i = 0; i < index; i += 1)
x += (g_model.topbarWidgetWidth[i] * (TOPBAR_ZONE_WIDTH + PAD_TINY)); x += (g_model.topbarWidgetWidth[i] * (TOPBAR_ZONE_WIDTH + PAD_TINY));
coord_t size = ((g_model.topbarWidgetWidth[index] - 1) * (TOPBAR_ZONE_WIDTH + PAD_TINY) + TOPBAR_ZONE_WIDTH); coord_t size = ((g_model.topbarWidgetWidth[index] - 1) * (TOPBAR_ZONE_WIDTH + PAD_TINY) + TOPBAR_ZONE_WIDTH);
+1 -2
View File
@@ -166,8 +166,7 @@ class CurveDataEdit : public Window
// y value // y value
for (uint8_t i = 0; i < count; i++) { for (uint8_t i = 0; i < count; i++) {
auto numedit = new NumberEdit( new NumberEdit(parent,
parent,
{PTNUM_X + (i * (NUM_BTN_WIDTH + PAD_TINY)), y, NUM_BTN_WIDTH, {PTNUM_X + (i * (NUM_BTN_WIDTH + PAD_TINY)), y, NUM_BTN_WIDTH,
EdgeTxStyles::UI_ELEMENT_HEIGHT}, EdgeTxStyles::UI_ELEMENT_HEIGHT},
-100, 100, GET_VALUE(points[i + start]), -100, 100, GET_VALUE(points[i + start]),
@@ -51,12 +51,9 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, int srcMin, int sr
#endif #endif
bool isSource = false; bool isSource = false;
bool origIsSource = false;
if (i_flags & INCDEC_SOURCE_VALUE) { if (i_flags & INCDEC_SOURCE_VALUE) {
SourceNumVal v; SourceNumVal v;
v.rawValue = val; v.rawValue = val;
// Save isSource flag;
origIsSource = isSource = v.isSource;
// Remove isSource flag; // Remove isSource flag;
val = v.value; val = v.value;
newval = v.value; newval = v.value;
@@ -23,6 +23,8 @@
#include "usb_joystick.h" #include "usb_joystick.h"
#else #else
#include "edgetx_helpers.h" #include "edgetx_helpers.h"
#include "dataconstants.h"
#include "globals.h"
#endif #endif
extern "C" { extern "C" {
@@ -203,16 +205,9 @@ void usbJoystickRestart()
USBD_RegisterClass(&hUsbDevice, &USBD_HID); USBD_RegisterClass(&hUsbDevice, &USBD_HID);
USBD_Start(&hUsbDevice); USBD_Start(&hUsbDevice);
} }
#else
// TODO: fix after HAL conversion is complete
#warning channelOutputs should come from "globals.h"
#define MAX_OUTPUT_CHANNELS 32
extern int16_t channelOutputs[MAX_OUTPUT_CHANNELS];
#endif #endif
/* /*
Prepare and send new USB data packet Prepare and send new USB data packet
+1 -1
View File
@@ -45,7 +45,7 @@ void ledInit()
#endif #endif
#if defined(FUNCTION_SWITCHES) #if defined(FUNCTION_SWITCHES)
for (int i = 0; i < DIM(fsLeds); i++) { for (size_t i = 0; i < DIM(fsLeds); i++) {
gpio_init(fsLeds[i], GPIO_OUT, GPIO_PIN_SPEED_LOW); gpio_init(fsLeds[i], GPIO_OUT, GPIO_PIN_SPEED_LOW);
} }
#endif #endif