enter racing mode by spec function

This commit is contained in:
WismyYao
2021-01-30 13:39:09 +08:00
parent a933903e6b
commit 744bcab0b9
22 changed files with 61 additions and 23 deletions
+9 -3
View File
@@ -47,14 +47,20 @@ void Pxx2Pulses::addFlag1(uint8_t module)
else {
subType = g_model.moduleData[module].subType;
}
Pxx2Transport::addByte(subType << 4);
uint8_t flag1 = subType << 4u;
if (isFunctionActive(FUNCTION_RACING_MODE)) {
flag1 |= PXX2_CHANNELS_FLAG1_RACING_MODE;
}
Pxx2Transport::addByte(flag1);
}
void Pxx2Pulses::addPulsesValues(uint16_t low, uint16_t high)
{
Pxx2Transport::addByte(low); // Low byte of channel
Pxx2Transport::addByte(((low >> 8) & 0x0F) | (high << 4)); // 4 bits each from 2 channels
Pxx2Transport::addByte(high >> 4); // High byte of channel
Pxx2Transport::addByte(((low >> 8u) & 0x0Fu) | (high << 4u)); // 4 bits each from 2 channels
Pxx2Transport::addByte(high >> 4u); // High byte of channel
}
void Pxx2Pulses::addChannels(uint8_t module)