From 7059969d2f0ca81da814a77096104e43b86ce387 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Tue, 25 Nov 2014 20:28:56 +0100 Subject: [PATCH] rc_proto: fix logs --- mainboard/rc_proto.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/mainboard/rc_proto.c b/mainboard/rc_proto.c index ffbf325..cfe250e 100644 --- a/mainboard/rc_proto.c +++ b/mainboard/rc_proto.c @@ -679,7 +679,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_hello *rch = (struct rc_proto_hello *) recvframe->data; - NOTICE(E_USER_XBEE, "recv hello len=%d", rch->datalen); + NOTICE(E_USER_RC_PROTO, "recv hello len=%d", rch->datalen); stats.hello_rx++; return 0; } @@ -689,7 +689,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) (struct rc_proto_echo_req *) recvframe->data; int8_t power = rce->power; - NOTICE(E_USER_XBEE, "recv echo len=%d", rce->datalen); + NOTICE(E_USER_RC_PROTO, "recv echo len=%d", rce->datalen); stats.echo_req_rx++; if (rc_proto_send_echo_ans(ntohll(recvframe->srcaddr), @@ -705,7 +705,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) (struct rc_proto_echo_ans *) recvframe->data; uint16_t diff; - NOTICE(E_USER_XBEE, "recv echo_ans len=%d", rce->datalen); + NOTICE(E_USER_RC_PROTO, "recv echo_ans len=%d", rce->datalen); stats.echo_ans_rx++; diff = get_time_ms() - rce->timestamp; stats.echo_ans_latency_sum += diff; @@ -717,7 +717,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_power_probe *rcpb = (struct rc_proto_power_probe *) recvframe->data; - NOTICE(E_USER_XBEE, "recv power_probe"); + NOTICE(E_USER_RC_PROTO, "recv power_probe"); if (datalen != sizeof(*rcpb)) return -1; @@ -737,7 +737,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_ack *rca = (struct rc_proto_ack *) recvframe->data; - NOTICE(E_USER_XBEE, "recv ack, ack=%d", rca->seq); + NOTICE(E_USER_RC_PROTO, "recv ack, ack=%d", rca->seq); stats.ack_rx++; return 0; } @@ -747,7 +747,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_servo *rcs = (struct rc_proto_servo *) recvframe->data; - NOTICE(E_USER_XBEE, "recv servo"); + NOTICE(E_USER_RC_PROTO, "recv servo"); if (datalen != RC_PROTO_SERVO_LEN) return -1; @@ -761,7 +761,7 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_stats *rcs = (struct rc_proto_stats *) recvframe->data; - NOTICE(E_USER_XBEE, "recv stats"); + NOTICE(E_USER_RC_PROTO, "recv stats"); if (datalen != sizeof(*rcs) + sizeof(peer_stats)) return -1; @@ -776,14 +776,12 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_gps_pos *rcmsg = (struct rc_proto_gps_pos *) recvframe->data; - NOTICE(E_USER_XBEE, "recv gps_pos"); - if (datalen != sizeof(*rcmsg)) return -1; stats.gps_pos_rx++; - printf_P(PSTR("GPS received valid=%d %"PRIu32" %" - PRIu32" %"PRIu32"\n"), + NOTICE(E_USER_RC_PROTO, "GPS received valid=%d %"PRIu32" %" + PRIu32" %"PRIu32, rcmsg->valid, rcmsg->latitude, rcmsg->longitude, rcmsg->altitude); return 0; @@ -794,13 +792,12 @@ int rc_proto_rx(struct xbee_recv_hdr *recvframe, unsigned len) struct rc_proto_imu_pos *rcmsg = (struct rc_proto_imu_pos *) recvframe->data; - NOTICE(E_USER_XBEE, "recv imu_pos"); - if (datalen != sizeof(*rcmsg)) return -1; stats.imu_pos_rx++; - printf_P(PSTR("IMU received %d %d %d\n"), + NOTICE(E_USER_RC_PROTO, + "IMU received %d %d %d", rcmsg->roll, rcmsg->pitch, rcmsg->yaw); return 0; } -- 2.39.5