Couple of optimizations

This commit is contained in:
pascallanger
2016-07-28 20:58:12 +02:00
parent fd4ff00ee2
commit 8ea42ea432
7 changed files with 27 additions and 18 deletions

View File

@@ -117,11 +117,10 @@ static void __attribute__((unused)) ESKY_send_packet(uint8_t bind)
// For arithmetic simplicity, channels are repeated in rf_channels array
if (hopping_frequency_no == 0)
{
const uint8_t ch[]={AILERON, ELEVATOR, THROTTLE, RUDDER, AUX1, AUX2};
for (uint8_t i = 0; i < 6; i++)
{
packet[i*2] = Servo_data[ch[i]]>>8; //high byte of servo timing(1000-2000us)
packet[i*2+1] = Servo_data[ch[i]]&0xFF; //low byte of servo timing(1000-2000us)
packet[i*2] = Servo_data[CH_AETR[i]]>>8; //high byte of servo timing(1000-2000us)
packet[i*2+1] = Servo_data[CH_AETR[i]]&0xFF; //low byte of servo timing(1000-2000us)
}
}
rf_ch = hopping_frequency[hopping_frequency_no];