mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
minor build fixes and ignored warnings for GCC 9 (#14159)
- px4io task_main_trampoline add return - iridiumsbd main_loop_helper add return - drivers/uavcan ignore Wcast-align, Wdeprecated-copy, and Waddress-of-packed-member for now - flashparams ignore Wvla-larger-than - test_time fix printf type
This commit is contained in:
@@ -303,7 +303,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Trampoline to the worker task
|
* 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
|
* worker task
|
||||||
@@ -882,7 +882,7 @@ PX4IO::init()
|
|||||||
SCHED_DEFAULT,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_ACTUATOR_OUTPUTS,
|
SCHED_PRIORITY_ACTUATOR_OUTPUTS,
|
||||||
1500,
|
1500,
|
||||||
(main_t)&PX4IO::task_main_trampoline,
|
(px4_main_t)&PX4IO::task_main_trampoline,
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
if (_task < 0) {
|
if (_task < 0) {
|
||||||
@@ -893,10 +893,11 @@ PX4IO::init()
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
PX4IO::task_main_trampoline(int argc, char *argv[])
|
PX4IO::task_main_trampoline(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
g_dev->task_main();
|
g_dev->task_main();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ int IridiumSBD::ioctl(struct file *filp, int cmd, unsigned long arg)
|
|||||||
// private functions //
|
// 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
|
// start the main loop and stay in it
|
||||||
IridiumSBD::instance->main_loop(argc, argv);
|
IridiumSBD::instance->main_loop(argc, argv);
|
||||||
@@ -225,6 +225,7 @@ void IridiumSBD::main_loop_helper(int argc, char *argv[])
|
|||||||
IridiumSBD::instance = nullptr;
|
IridiumSBD::instance = nullptr;
|
||||||
|
|
||||||
PX4_WARN("stopped");
|
PX4_WARN("stopped");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IridiumSBD::main_loop(int argc, char *argv[])
|
void IridiumSBD::main_loop(int argc, char *argv[])
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ private:
|
|||||||
/*
|
/*
|
||||||
* Entry point of the task, has to be a static function
|
* 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
|
* Main driver loop
|
||||||
|
|||||||
@@ -71,7 +71,11 @@ add_definitions(
|
|||||||
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
|
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_compile_options(-Wno-cast-align) # TODO: fix and enable
|
add_compile_options(
|
||||||
|
-Wno-cast-align # TODO: fix and enable
|
||||||
|
-Wno-deprecated-copy # TODO: fix
|
||||||
|
-Wno-address-of-packed-member
|
||||||
|
)
|
||||||
add_subdirectory(${LIBUAVCAN_DIR} libuavcan EXCLUDE_FROM_ALL)
|
add_subdirectory(${LIBUAVCAN_DIR} libuavcan EXCLUDE_FROM_ALL)
|
||||||
add_dependencies(uavcan prebuild_targets)
|
add_dependencies(uavcan prebuild_targets)
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ target_compile_options(flashparams
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
-Wno-sign-compare # TODO: fix this
|
-Wno-sign-compare # TODO: fix this
|
||||||
-Wno-cast-align # TODO: fix and enable
|
-Wno-cast-align # TODO: fix and enable
|
||||||
|
-Wno-address-of-packed-member # TODO: fix this
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(flashparams PRIVATE nuttx_arch)
|
target_link_libraries(flashparams PRIVATE nuttx_arch)
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ px4_add_module(
|
|||||||
-Wno-unused-but-set-variable
|
-Wno-unused-but-set-variable
|
||||||
-Wno-unused-result
|
-Wno-unused-result
|
||||||
-Wno-unused-variable
|
-Wno-unused-variable
|
||||||
|
-Wno-vla-larger-than
|
||||||
SRCS
|
SRCS
|
||||||
${srcs}
|
${srcs}
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ cycletime(void)
|
|||||||
int test_time(int argc, char *argv[])
|
int test_time(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
hrt_abstime h, c;
|
hrt_abstime h, c;
|
||||||
int64_t lowdelta, maxdelta = 0;
|
int lowdelta, maxdelta = 0;
|
||||||
int64_t delta, deltadelta;
|
int delta, deltadelta;
|
||||||
|
|
||||||
/* enable the cycle counter */
|
/* enable the cycle counter */
|
||||||
(*(unsigned long *)0xe000edfc) |= (1 << 24); /* DEMCR |= DEMCR_TRCENA */
|
(*(unsigned long *)0xe000edfc) |= (1 << 24); /* DEMCR |= DEMCR_TRCENA */
|
||||||
@@ -111,7 +111,7 @@ int test_time(int argc, char *argv[])
|
|||||||
|
|
||||||
px4_leave_critical_section(flags);
|
px4_leave_critical_section(flags);
|
||||||
|
|
||||||
delta = abs(h - c);
|
delta = h - c;
|
||||||
deltadelta = abs(delta - lowdelta);
|
deltadelta = abs(delta - lowdelta);
|
||||||
|
|
||||||
if (deltadelta > maxdelta) {
|
if (deltadelta > maxdelta) {
|
||||||
@@ -119,7 +119,7 @@ int test_time(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (deltadelta > 1000) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user