Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Compile PX4 on ARM GCC 9 #13375

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/px4/fmu-v4/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ px4_add_board(
telemetry # all available telemetry drivers
test_ppm
tone_alarm
uavcan
#uavcan

MODULES
airspeed_selector
Expand Down
2 changes: 1 addition & 1 deletion platforms/nuttx/NuttX/nuttx
7 changes: 4 additions & 3 deletions src/drivers/px4io/px4io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class PX4IO : public cdev::CDev
/**
* Trampoline to the worker task
*/
static void task_main_trampoline(int argc, char *argv[]);
static int task_main_trampoline(int argc, char *argv[]);

/**
* worker task
Expand Down Expand Up @@ -876,7 +876,7 @@ PX4IO::init()
SCHED_DEFAULT,
SCHED_PRIORITY_ACTUATOR_OUTPUTS,
1500,
(main_t)&PX4IO::task_main_trampoline,
(px4_main_t)&PX4IO::task_main_trampoline,
nullptr);

if (_task < 0) {
Expand All @@ -887,10 +887,11 @@ PX4IO::init()
return OK;
}

void
int
PX4IO::task_main_trampoline(int argc, char *argv[])
{
g_dev->task_main();
return 0;
}

void
Expand Down
3 changes: 2 additions & 1 deletion src/drivers/telemetry/iridiumsbd/IridiumSBD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ int IridiumSBD::ioctl(struct file *filp, int cmd, unsigned long arg)
// private functions //
///////////////////////////////////////////////////////////////////////

void IridiumSBD::main_loop_helper(int argc, char *argv[])
int IridiumSBD::main_loop_helper(int argc, char *argv[])
{
// start the main loop and stay in it
IridiumSBD::instance->main_loop(argc, argv);
Expand All @@ -225,6 +225,7 @@ void IridiumSBD::main_loop_helper(int argc, char *argv[])
IridiumSBD::instance = nullptr;

PX4_WARN("stopped");
return 0;
}

void IridiumSBD::main_loop(int argc, char *argv[])
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/telemetry/iridiumsbd/IridiumSBD.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class IridiumSBD : public cdev::CDev
/*
* Entry point of the task, has to be a static function
*/
static void main_loop_helper(int argc, char *argv[]);
static int main_loop_helper(int argc, char *argv[]);

/*
* Main driver loop
Expand Down
1 change: 1 addition & 0 deletions src/lib/parameters/flashparams/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ target_compile_options(flashparams
PRIVATE
-Wno-sign-compare # TODO: fix this
-Wno-cast-align # TODO: fix and enable
-Wno-address-of-packed-member # TODO: fix this
)

target_link_libraries(flashparams PRIVATE nuttx_arch)
1 change: 1 addition & 0 deletions src/systemcmds/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ px4_add_module(
-Wno-unused-but-set-variable
-Wno-unused-result
-Wno-unused-variable
-Wno-vla-larger-than
SRCS
${srcs}
DEPENDS
Expand Down
10 changes: 5 additions & 5 deletions src/systemcmds/tests/test_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ cycletime(void)
int test_time(int argc, char *argv[])
{
hrt_abstime h, c;
int64_t lowdelta, maxdelta = 0;
int64_t delta, deltadelta;
int lowdelta, maxdelta = 0;
int delta, deltadelta;

/* enable the cycle counter */
(*(unsigned long *)0xe000edfc) |= (1 << 24); /* DEMCR |= DEMCR_TRCENA */
Expand All @@ -96,7 +96,7 @@ int test_time(int argc, char *argv[])

px4_leave_critical_section(flags);

delta += h - c;
delta += (int)(h - c);
}

lowdelta = abs(delta / 100);
Expand All @@ -113,15 +113,15 @@ int test_time(int argc, char *argv[])

px4_leave_critical_section(flags);

delta = abs(h - c);
delta = abs((int)(h - c));
deltadelta = abs(delta - lowdelta);

if (deltadelta > maxdelta) {
maxdelta = deltadelta;
}

if (deltadelta > 1000) {
fprintf(stderr, "h %" PRIu64 " c %" PRIu64 " d %" PRId64 "\n", h, c, delta - lowdelta);
fprintf(stderr, "h %" PRIu64 " c %" PRIu64 " d %d\n", h, c, delta - lowdelta);
}
}

Expand Down