fixed repeated sending of code

This commit is contained in:
he.so 2020-02-26 19:46:44 +01:00
parent bc584468af
commit 8dbfa7d6b5

View File

@ -113,14 +113,15 @@ void CmdSendButton(void)
for(int repeat = 0; repeat <= 1; repeat++) for(int repeat = 0; repeat <= 1; repeat++)
{ {
digitalWrite(TX_PORT, LOW); // CC1101 in TX Mode+ uint64_t bitsToSend = jaroliftDevice.pack;
digitalWrite(TX_PORT, LOW);
delayMicroseconds(1150); delayMicroseconds(1150);
SendSyncPreamble(13); SendSyncPreamble(13);
delayMicroseconds(3500); delayMicroseconds(3500);
for(int i=72; i>0; i--) for(int i=72; i>0; i--)
{ {
SendBit(jaroliftDevice.pack & 0x0000000000000001); SendBit(bitsToSend & 0x0000000000000001);
jaroliftDevice.pack >>= 1; bitsToSend >>= 1;
} }
DEBUG_DRIVER_LOG(LOG_LEVEL_DEBUG_MORE, PSTR("finished sending bits at %d"), micros()); DEBUG_DRIVER_LOG(LOG_LEVEL_DEBUG_MORE, PSTR("finished sending bits at %d"), micros());