Skip to content

Commit bf98ae3

Browse files
committed
Merge pull request #9980 from iNavFlight/mmosca-sitil-mac-fix-2
Fix function prototypes and macos warnings
1 parent a1d28a5 commit bf98ae3

File tree

8 files changed

+29
-8
lines changed

8 files changed

+29
-8
lines changed

src/main/build/build_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#endif
4141

4242
#ifdef __APPLE__
43-
#define FASTRAM __attribute__ ((section("__DATA,__.fastram_bss"), aligned(4)))
43+
#define FASTRAM __attribute__ ((section("__DATA,__.fastram_bss"), aligned(8)))
4444
#else
4545
#define FASTRAM __attribute__ ((section(".fastram_bss"), aligned(4)))
4646
#endif

src/main/cms/cms_types.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626

2727
//type of elements
2828

29+
#ifndef __APPLE__
30+
#define OSD_ENTRY_ATTR __attribute__((packed))
31+
#else
32+
#define OSD_ENTRY_ATTR
33+
#endif
34+
2935
typedef enum
3036
{
3137
OME_Label,
@@ -71,7 +77,7 @@ typedef struct
7177
const void * const data;
7278
const uint8_t type; // from OSD_MenuElement
7379
uint8_t flags;
74-
} __attribute__((packed)) OSD_Entry;
80+
} OSD_ENTRY_ATTR OSD_Entry;
7581

7682
// Bits in flags
7783
#define PRINT_VALUE (1 << 0) // Value has been changed, need to redraw

src/main/config/parameter_group.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static inline uint16_t pgIsProfile(const pgRegistry_t* reg) {return (reg->size &
6464
#ifdef __APPLE__
6565
extern const pgRegistry_t __pg_registry_start[] __asm("section$start$__DATA$__pg_registry");
6666
extern const pgRegistry_t __pg_registry_end[] __asm("section$end$__DATA$__pg_registry");
67-
#define PG_REGISTER_ATTRIBUTES __attribute__ ((section("__DATA,__pg_registry"), used, aligned(4)))
67+
#define PG_REGISTER_ATTRIBUTES __attribute__ ((section("__DATA,__pg_registry"), used, aligned(8)))
6868

6969
extern const uint8_t __pg_resetdata_start[] __asm("section$start$__DATA$__pg_resetdata");
7070
extern const uint8_t __pg_resetdata_end[] __asm("section$end$__DATA$__pg_resetdata");

src/main/fc/cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static void cliRxRange(char *cmdline)
11661166
ptr = cmdline;
11671167
i = fastA2I(ptr);
11681168
if (i >= 0 && i < NON_AUX_CHANNEL_COUNT) {
1169-
int rangeMin, rangeMax;
1169+
int rangeMin = 0, rangeMax = 0;
11701170

11711171
ptr = nextArg(ptr);
11721172
if (ptr) {

src/main/flight/mixer.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,18 @@ bool areMotorsRunning(void)
725725

726726
return false;
727727
}
728+
729+
uint16_t getMaxThrottle(void) {
730+
731+
static uint16_t throttle = 0;
732+
733+
if (throttle == 0) {
734+
if (STATE(ROVER) || STATE(BOAT)) {
735+
throttle = MAX_THROTTLE_ROVER;
736+
} else {
737+
throttle = MAX_THROTTLE;
738+
}
739+
}
740+
741+
return throttle;
742+
}

src/main/flight/mixer_profile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void pgResetFn_mixerProfiles(mixerProfile_t *instance)
7979
}
8080
}
8181

82-
void activateMixerConfig(){
82+
void activateMixerConfig(void){
8383
currentMixerProfileIndex = getConfigMixerProfile();
8484
currentMixerConfig = *mixerConfig();
8585
nextMixerProfileIndex = (currentMixerProfileIndex + 1) % MAX_MIXER_PROFILE_COUNT;

src/main/io/displayport_msp_osd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ void mspOsdSerialProcess(mspProcessCommandFnPtr mspProcessCommandFn)
525525
}
526526
}
527527

528-
mspPort_t *getMspOsdPort()
528+
mspPort_t *getMspOsdPort(void)
529529
{
530530
if (mspPort.port) {
531531
return &mspPort;

src/main/io/osd_hud.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ int8_t radarGetNearestPOI(void)
122122
*/
123123
void osdHudDrawPoi(uint32_t poiDistance, int16_t poiDirection, int32_t poiAltitude, uint8_t poiType, uint16_t poiSymbol, int16_t poiP1, int16_t poiP2)
124124
{
125-
int poi_x;
126-
int poi_y;
125+
int poi_x = -1;
126+
int poi_y = -1;
127127
uint8_t center_x;
128128
uint8_t center_y;
129129
bool poi_is_oos = 0;

0 commit comments

Comments
 (0)