mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:58:54 +08:00
Fixed led and reboot linker challenges in C++ environments
This commit is contained in:
@@ -92,7 +92,10 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
#include <arch/board/board.h>
|
||||
__END_DECLS
|
||||
#include <systemlib/systemlib.h>
|
||||
#include <drivers/device/i2c.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -112,7 +115,6 @@
|
||||
#include <systemlib/perf_counter.h>
|
||||
#include <systemlib/err.h>
|
||||
|
||||
#include <systemlib/systemlib.h>
|
||||
#include <poll.h>
|
||||
#include <uORB/uORB.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
@@ -486,15 +488,15 @@ BlinkM::led()
|
||||
|
||||
/* get number of used satellites in navigation */
|
||||
num_of_used_sats = 0;
|
||||
//for(int satloop=0; satloop<20; satloop++) {
|
||||
for(int satloop=0; satloop<sizeof(vehicle_gps_position_raw.satellite_used); satloop++) {
|
||||
|
||||
for(unsigned satloop=0; satloop<sizeof(vehicle_gps_position_raw.satellite_used); satloop++) {
|
||||
if(vehicle_gps_position_raw.satellite_used[satloop] == 1) {
|
||||
num_of_used_sats++;
|
||||
}
|
||||
}
|
||||
|
||||
if(new_data_vehicle_status || no_data_vehicle_status < 3){
|
||||
if(num_of_cells == 0) {
|
||||
if (new_data_vehicle_status || no_data_vehicle_status < 3) {
|
||||
if (num_of_cells == 0) {
|
||||
/* looking for lipo cells that are connected */
|
||||
printf("<blinkm> checking cells\n");
|
||||
for(num_of_cells = 2; num_of_cells < 7; num_of_cells++) {
|
||||
@@ -831,6 +833,8 @@ BlinkM::get_firmware_version(uint8_t version[2])
|
||||
return transfer(&msg, sizeof(msg), version, 2);
|
||||
}
|
||||
|
||||
void blinkm_usage();
|
||||
|
||||
void blinkm_usage() {
|
||||
fprintf(stderr, "missing command: try 'start', 'systemstate', 'ledoff', 'list' or a script name {options}\n");
|
||||
fprintf(stderr, "options:\n");
|
||||
|
||||
@@ -60,6 +60,6 @@ __BEGIN_DECLS
|
||||
/*
|
||||
* Initialise the LED driver.
|
||||
*/
|
||||
__EXPORT extern void drv_led_start(void);
|
||||
__EXPORT void drv_led_start(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -117,4 +117,4 @@ drv_led_start(void)
|
||||
if (gLED != nullptr)
|
||||
gLED->init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user