mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-06 07:15:45 +00:00
Testing experimental NEC-48 support (#1463)
This commit is contained in:
@ -194,7 +194,11 @@ size_t IRsend::write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats) {
|
||||
* Order of protocols is in guessed relevance :-)
|
||||
*/
|
||||
if (tProtocol == NEC) {
|
||||
sendNEC(tAddress, tCommand, aNumberOfRepeats);
|
||||
if (aIRSendData->numberOfBits == 48) {
|
||||
sendNEC48(tAddress, tCommand, aNumberOfRepeats);
|
||||
} else {
|
||||
sendNEC(tAddress, tCommand, aNumberOfRepeats);
|
||||
}
|
||||
|
||||
} else if (tProtocol == SAMSUNG) {
|
||||
sendSamsung(tAddress, tCommand, aNumberOfRepeats);
|
||||
|
||||
@ -522,6 +522,7 @@ public:
|
||||
void sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
|
||||
void sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS);
|
||||
// NEC variants
|
||||
void sendNEC48(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
|
||||
void sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
|
||||
void sendApple(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
|
||||
|
||||
|
||||
@ -152,6 +152,19 @@ void IRsend::sendNEC2(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOf
|
||||
sendPulseDistanceWidth(&NEC2ProtocolConstants, computeNECRawDataAndChecksum(aAddress, aCommand), NEC_BITS, aNumberOfRepeats);
|
||||
}
|
||||
|
||||
/*
|
||||
* Experimental nec48 protocol based by:
|
||||
* aCommand contains command and E variable
|
||||
*/
|
||||
void IRsend::sendNEC48(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
|
||||
|
||||
uint32_t necRawArray[2];
|
||||
necRawArray[0] = computeNECRawDataAndChecksum(aAddress, aCommand >> 8);
|
||||
uint8_t eValue = aCommand & 0x00FF;
|
||||
necRawArray[1] = (uint32_t) ((~eValue) << 8) | eValue;
|
||||
sendPulseDistanceWidthFromArray(&NECProtocolConstants, (uint32_t *) &necRawArray, NEC_BITS + 16, aNumberOfRepeats);
|
||||
}
|
||||
|
||||
/*
|
||||
* Repeat commands should be sent in a 110 ms raster.
|
||||
* There is NO delay after the last sent repeat!
|
||||
|
||||
Reference in New Issue
Block a user