Skip to content

Commit

Permalink
[tests] Remove and fix warnings (paparazzi#2877)
Browse files Browse the repository at this point in the history
  • Loading branch information
fvantienen committed May 9, 2022
1 parent 5d8a967 commit 5f64a1c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions sw/airborne/boards/ardrone/navdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ ssize_t full_read(int fd, uint8_t *buf, size_t count)
static void send_navdata(struct transport_tx *trans, struct link_device *dev)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
pprz_msg_send_ARDRONE_NAVDATA(trans, dev, AC_ID,
&navdata.measure.taille,
Expand Down
4 changes: 2 additions & 2 deletions sw/airborne/modules/gps/gps_ubx_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void gps_i2c_msg_ready(struct GpsUbxI2C *p, long fd);
/** check if a new character is available
* @param p unused
*/
uint8_t gps_i2c_char_available(struct GpsUbxI2C *p);
int gps_i2c_char_available(struct GpsUbxI2C *p);

/** get a new char
* @param p unused
Expand Down Expand Up @@ -147,7 +147,7 @@ void gps_i2c_msg_ready(struct GpsUbxI2C *p __attribute__((unused)), long fd __at
gps_i2c.tx_rdy = FALSE;
}

uint8_t gps_i2c_char_available(struct GpsUbxI2C *p __attribute__((unused)))
int gps_i2c_char_available(struct GpsUbxI2C *p __attribute__((unused)))
{
return (((int)gps_i2c.rx_buf_avail - (int)gps_i2c.rx_buf_idx) > 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ uint8_t listLength;
static uint8_t bindIdx;
static int8_t bindOffset;

typedef uint8_t handlePacketFn(uint8_t * const packet, uint8_t * const protocolState);
typedef rx_spi_received_e handlePacketFn(uint8_t * const packet, uint8_t * const protocolState);
typedef rx_spi_received_e processFrameFn(uint8_t * const packet);
typedef void setRcDataFn(uint16_t *rcData, const uint8_t *payload);

Expand Down
9 changes: 9 additions & 0 deletions sw/include/message_pragmas.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@
#define VALUE(x) VALUE_TO_STRING(x)

/* some convenience macros to print debug/config messages at compile time */
#if defined(PPRZ_TESTS)
#define WARNING(x)
#define MESSAGE(x)
#define TODO(x)
#define INFO(x)
#define INFO_VALUE(x,v)
#define INFO_VAR(var)
#else
#define WARNING(x) DO_PRAGMA(GCC warning #x)
#define MESSAGE(x) DO_PRAGMA(message (x))
#define TODO(x) DO_PRAGMA(message ("TODO - " x))
#define INFO(x) DO_PRAGMA(message ("Info: " x))
#define INFO_VALUE(x,v) DO_PRAGMA(message ("Info: " x VALUE(v)))
#define INFO_VAR(var) DO_PRAGMA(message ("INFO: " #var " = " VALUE(var)))
#endif

/* only if PRINT_CONFIG is true */
#if PRINT_CONFIG
Expand Down
5 changes: 0 additions & 5 deletions tests/modules/generated/airframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@
#define IMU_BODY_TO_IMU_PSI 0


#define SECTION_AHRS 1
#define AHRS_H_X 0.3892503
#define AHRS_H_Y 0.0017972
#define AHRS_H_Z 0.9211303

#define SECTION_INS 1
#define INS_H_X 0.3892503
#define INS_H_Y 0.0017972
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"-I../../var/include",
"-I../../tests/modules",
"-Imodules", "-DPERIODIC_TELEMETRY",
"-DDOWNLINK",
"-DPPRZ_TESTS", "-DDOWNLINK",
"-DBOARD_CONFIG=\"../../tests/modules/dummy.h\""]


Expand Down

0 comments on commit 5f64a1c

Please sign in to comment.