mirror of https://github.com/ArduPilot/ardupilot
MAVLink: use enum ap_message and remove unused param argument
saves us another 200 bytes of text
This commit is contained in:
parent
9fed709be2
commit
83492f92f2
|
@ -56,7 +56,7 @@ public:
|
||||||
/// @param id ID of the message to send.
|
/// @param id ID of the message to send.
|
||||||
/// @param param Explicit message parameter.
|
/// @param param Explicit message parameter.
|
||||||
///
|
///
|
||||||
void send_message(uint8_t id, int32_t param = 0) {}
|
void send_message(enum ap_message id) {}
|
||||||
|
|
||||||
/// Send a text message.
|
/// Send a text message.
|
||||||
///
|
///
|
||||||
|
@ -140,7 +140,7 @@ public:
|
||||||
GCS_MAVLINK(AP_Var::Key key);
|
GCS_MAVLINK(AP_Var::Key key);
|
||||||
void update(void);
|
void update(void);
|
||||||
void init(FastSerial *port);
|
void init(FastSerial *port);
|
||||||
void send_message(uint8_t id, uint32_t param = 0);
|
void send_message(enum ap_message id);
|
||||||
void send_text(uint8_t severity, const char *str);
|
void send_text(uint8_t severity, const char *str);
|
||||||
void send_text(uint8_t severity, const prog_char_t *str);
|
void send_text(uint8_t severity, const prog_char_t *str);
|
||||||
void acknowledge(uint8_t id, uint8_t sum1, uint8_t sum2);
|
void acknowledge(uint8_t id, uint8_t sum1, uint8_t sum2);
|
||||||
|
|
|
@ -139,7 +139,7 @@ GCS_MAVLINK::data_stream_send(uint16_t freqMin, uint16_t freqMax)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
GCS_MAVLINK::send_message(uint8_t id, uint32_t param)
|
GCS_MAVLINK::send_message(enum ap_message id)
|
||||||
{
|
{
|
||||||
mavlink_send_message(chan,id, packet_drops);
|
mavlink_send_message(chan,id, packet_drops);
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,7 +291,7 @@ static void NOINLINE send_current_waypoint(mavlink_channel_t chan)
|
||||||
|
|
||||||
|
|
||||||
// try to send a message, return false if it won't fit in the serial tx buffer
|
// try to send a message, return false if it won't fit in the serial tx buffer
|
||||||
static bool mavlink_try_send_message(mavlink_channel_t chan, uint8_t id, uint16_t packet_drops)
|
static bool mavlink_try_send_message(mavlink_channel_t chan, enum ap_message id, uint16_t packet_drops)
|
||||||
{
|
{
|
||||||
int payload_space = comm_get_txspace(chan) - MAVLINK_NUM_NON_PAYLOAD_BYTES;
|
int payload_space = comm_get_txspace(chan) - MAVLINK_NUM_NON_PAYLOAD_BYTES;
|
||||||
|
|
||||||
|
@ -395,13 +395,13 @@ static bool mavlink_try_send_message(mavlink_channel_t chan, uint8_t id, uint16_
|
||||||
|
|
||||||
#define MAX_DEFERRED_MESSAGES MSG_RETRY_DEFERRED
|
#define MAX_DEFERRED_MESSAGES MSG_RETRY_DEFERRED
|
||||||
static struct mavlink_queue {
|
static struct mavlink_queue {
|
||||||
uint8_t deferred_messages[MAX_DEFERRED_MESSAGES];
|
enum ap_message deferred_messages[MAX_DEFERRED_MESSAGES];
|
||||||
uint8_t next_deferred_message;
|
uint8_t next_deferred_message;
|
||||||
uint8_t num_deferred_messages;
|
uint8_t num_deferred_messages;
|
||||||
} mavlink_queue[2];
|
} mavlink_queue[2];
|
||||||
|
|
||||||
// send a message using mavlink
|
// send a message using mavlink
|
||||||
static void mavlink_send_message(mavlink_channel_t chan, uint8_t id, uint16_t packet_drops)
|
static void mavlink_send_message(mavlink_channel_t chan, enum ap_message id, uint16_t packet_drops)
|
||||||
{
|
{
|
||||||
uint8_t i, nextid;
|
uint8_t i, nextid;
|
||||||
struct mavlink_queue *q = &mavlink_queue[(uint8_t)chan];
|
struct mavlink_queue *q = &mavlink_queue[(uint8_t)chan];
|
||||||
|
|
Loading…
Reference in New Issue