]> git.droids-corp.org - fpv.git/commitdiff
rc_proto: fix logs
authorOlivier Matz <zer0@droids-corp.org>
Tue, 25 Nov 2014 19:28:56 +0000 (20:28 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Tue, 25 Nov 2014 19:38:44 +0000 (20:38 +0100)
mainboard/rc_proto.c

index ffbf3258f67dd3b64ed21b6184aeab2d315e971c..cfe250eefb4a0db624af080829c3856fea0a6df3 100644 (file)
@@ -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;
                }