Skip to content

Commit

Permalink
chore: fix some compiler warnings when building firmware (#5453)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Aug 18, 2024
1 parent ce01091 commit 0186944
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion radio/src/datastructs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
PACK(union SourceNumVal {
struct {
int16_t value:10;
int16_t isSource:1;
uint16_t isSource:1;
};
uint16_t rawValue:11;
});
Expand Down
2 changes: 1 addition & 1 deletion radio/src/definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#endif

#if !defined(UNUSED)
#define UNUSED(x) ((void)(x)) /* to avoid warnings */
#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
#endif

#if !defined(__ALIGNED)
Expand Down
2 changes: 2 additions & 0 deletions radio/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext
}
#endif

#if defined(VIDEO_SWITCH)
bool videoEnabled = false;
#endif
for (uint8_t i=0; i<MAX_SPECIAL_FUNCTIONS; i++) {
const CustomFunctionData * cfn = &functions[i];
swsrc_t swtch = CFN_SWITCH(cfn);
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/colorlcd/mainview/topbar_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ rect_t TopBar::getZone(unsigned int index) const
{
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));

coord_t size = ((g_model.topbarWidgetWidth[index] - 1) * (TOPBAR_ZONE_WIDTH + PAD_TINY) + TOPBAR_ZONE_WIDTH);
Expand Down
3 changes: 1 addition & 2 deletions radio/src/gui/colorlcd/model/curveedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ class CurveDataEdit : public Window

// y value
for (uint8_t i = 0; i < count; i++) {
auto numedit = new NumberEdit(
parent,
new NumberEdit(parent,
{PTNUM_X + (i * (NUM_BTN_WIDTH + PAD_TINY)), y, NUM_BTN_WIDTH,
EdgeTxStyles::UI_ELEMENT_HEIGHT},
-100, 100, GET_VALUE(points[i + start]),
Expand Down
3 changes: 0 additions & 3 deletions radio/src/gui/navigation/navigation_x7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, int srcMin, int sr
#endif

bool isSource = false;
bool origIsSource = false;
if (i_flags & INCDEC_SOURCE_VALUE) {
SourceNumVal v;
v.rawValue = val;
// Save isSource flag;
origIsSource = isSource = v.isSource;
// Remove isSource flag;
val = v.value;
newval = v.value;
Expand Down
9 changes: 2 additions & 7 deletions radio/src/targets/common/arm/stm32/usb_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "usb_joystick.h"
#else
#include "edgetx_helpers.h"
#include "dataconstants.h"
#include "globals.h"
#endif

extern "C" {
Expand Down Expand Up @@ -203,16 +205,9 @@ void usbJoystickRestart()
USBD_RegisterClass(&hUsbDevice, &USBD_HID);
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



/*
Prepare and send new USB data packet
Expand Down
2 changes: 1 addition & 1 deletion radio/src/targets/taranis/led_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ledInit()
#endif

#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);
}
#endif
Expand Down

0 comments on commit 0186944

Please sign in to comment.