From 381b53f9276dc9a358ec8607c9ce40e8a87aaf1c Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Tue, 25 Nov 2014 23:20:43 +0100 Subject: [PATCH] rc_proto: imu and gps send at pow 4 --- mainboard/rc_proto.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mainboard/rc_proto.c b/mainboard/rc_proto.c index cfe250e..cca8a78 100644 --- a/mainboard/rc_proto.c +++ b/mainboard/rc_proto.c @@ -128,6 +128,8 @@ static struct callout rc_proto_timer; * the previous PL value (0 or 4) so we can alternate. */ int8_t power_level_global = -1; +#define POW_IMU_GPS 4 + /* update power level when we receive the answer from DB. The request is sent by * rc_proto_rx_power_probe(). */ static int8_t update_power_level(int8_t retcode, void *frame, unsigned len, @@ -844,10 +846,7 @@ static void rc_proto_cb(struct callout_mgr *cm, struct callout *tim, void *arg) if (rc_proto_flags & RC_PROTO_FLAGS_TX_GPS_POS) { diff = t - prev_gps_pos; if (diff > rc_proto_timers.send_gps_pos_ms) { - pow_probe++; - if (pow_probe > 4) - pow_probe = 0; - rc_proto_send_gps_pos(rc_proto_dstaddr, pow_probe); + rc_proto_send_gps_pos(rc_proto_dstaddr, POW_IMU_GPS); prev_gps_pos = t; } } @@ -856,10 +855,7 @@ static void rc_proto_cb(struct callout_mgr *cm, struct callout *tim, void *arg) if (rc_proto_flags & RC_PROTO_FLAGS_TX_IMU_POS) { diff = t - prev_imu_pos; if (diff > rc_proto_timers.send_imu_pos_ms) { - pow_probe++; - if (pow_probe > 4) - pow_probe = 0; - rc_proto_send_imu_pos(rc_proto_dstaddr, pow_probe); + rc_proto_send_imu_pos(rc_proto_dstaddr, POW_IMU_GPS); prev_imu_pos = t; } } -- 2.20.1