* 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,
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;
}
}
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;
}
}