fix coding style for gps drivers

This commit is contained in:
Beat Küng
2016-04-11 11:23:01 +02:00
committed by tumbili
parent 851340eccc
commit 215aa78f30
4 changed files with 7 additions and 3 deletions
+2
View File
@@ -497,6 +497,7 @@ int ASHTECH::handle_message(int len)
if (this_msg_num == all_msg_num) {
end = tot_sv_visible - (this_msg_num - 1) * 4;
_gps_position->satellites_used = tot_sv_visible;
if (_satellite_info) {
_satellite_info->count = satellite_info_s::SAT_INFO_MAX_SATELLITES;
_satellite_info->timestamp = hrt_absolute_time();
@@ -671,6 +672,7 @@ int ASHTECH::configure(unsigned &baudrate)
for (unsigned int baud_i = 0; baud_i < sizeof(baudrates_to_try) / sizeof(baudrates_to_try[0]); baud_i++) {
baudrate = baudrates_to_try[baud_i];
set_baudrate(_fd, baudrate);
if (write(_fd, comm, sizeof(comm)) != sizeof(comm)) {
return 1;
}
+3 -1
View File
@@ -214,7 +214,9 @@ GPS::~GPS()
px4_task_delete(_task);
}
if (_Sat_Info) delete (_Sat_Info);
if (_Sat_Info) {
delete(_Sat_Info);
}
g_dev = nullptr;
+1 -1
View File
@@ -367,7 +367,6 @@ UBX::receive(const unsigned timeout)
/* abort after timeout if no useful packets received */
if (time_started + timeout * 1000 < hrt_absolute_time()) {
UBX_DEBUG("cur=%li, start=%li", hrt_absolute_time()/1000, time_started/1000);
UBX_DEBUG("timed out, returning");
return -1;
}
@@ -663,6 +662,7 @@ UBX::payload_rx_init()
/* don't attempt for every message to disable, some might not be disabled */
_disable_cmd_last = t;
UBX_DEBUG("ubx disabling msg 0x%04x", SWAP16((unsigned)_rx_msg));
if (!configure_message_rate(_rx_msg, 0)) {
ret = -1;
}
+1 -1
View File
@@ -78,7 +78,7 @@ __EXPORT const char *getprogname(void);
#include <errno.h>
#include <px4_tasks.h>
#define err(eval, ...) do { PX4_ERR(__VA_ARGS__); PX4_ERR("Task exited with errno=%i\n", errno); \
px4_task_exit(eval); } while(0)
px4_task_exit(eval); } while(0)
#define errx(eval, ...) do { PX4_ERR(__VA_ARGS__); px4_task_exit(eval); } while(0)
#define warn(...) PX4_WARN(__VA_ARGS__)
#define warnx(...) PX4_WARN(__VA_ARGS__)