* Start of send and decode functions ************************************/ * Here we process the structured data, and call the send raw data function * @param aMode one of LEGO_MODE_EXTENDED, LEGO_MODE_COMBO, LEGO_MODE_SINGLE */
| 111 | * @param aMode one of LEGO_MODE_EXTENDED, LEGO_MODE_COMBO, LEGO_MODE_SINGLE |
| 112 | */ |
| 113 | void IRsend::sendLegoPowerFunctions(uint8_t aChannel, uint8_t aCommand, uint8_t aMode, bool aDoSend5Times) { |
| 114 | aChannel &= 0x0F; // allow toggle and escape bits too |
| 115 | aCommand &= 0x0F; |
| 116 | aMode &= 0x0F; |
| 117 | uint8_t tParity = 0xF ^ aChannel ^ aMode ^ aCommand; |
| 118 | // send 4 bit channel, 4 bit mode, 4 bit command, 4 bit parity |
| 119 | uint16_t tRawData = (((aChannel << LEGO_MODE_BITS) | aMode) << (LEGO_COMMAND_BITS + LEGO_PARITY_BITS)) |
| 120 | | (aCommand << LEGO_PARITY_BITS) | tParity; |
| 121 | sendLegoPowerFunctions(tRawData, aChannel, aDoSend5Times); |
| 122 | } |
| 123 | |
| 124 | void IRsend::sendLegoPowerFunctions(uint16_t aRawData, uint8_t aChannel, bool aDoSend5Times) { |
| 125 |
nothing calls this directly
no outgoing calls
no test coverage detected