thermferm/rc-switch.c

changeset 652
16d3d4b58b5b
parent 213
2317b8d644fa
equal deleted inserted replaced
651:da166cb8470f 652:16d3d4b58b5b
1 /***************************************************************************** 1 /*****************************************************************************
2 * Copyright (C) 2014 2 * Copyright (C) 2014-2024
3 * 3 *
4 * Michiel Broek <mbroek at mbse dot eu> 4 * Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * This file is part of the mbsePi-apps 6 * This file is part of the mbsePi-apps
7 * 7 *
23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 23 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 *****************************************************************************/ 24 *****************************************************************************/
25 25
26 #include "thermferm.h" 26 #include "thermferm.h"
27 #include "xutil.h" 27 #include "xutil.h"
28 #include "delay.h"
28 #include "rc-switch.h" 29 #include "rc-switch.h"
29 30
30 #ifdef HAVE_WIRINGPI_H 31 #ifdef HAVE_WIRINGPI_H
31 32
32 33
592 if (rcReceiverInterruptPin != -1) { 593 if (rcReceiverInterruptPin != -1) {
593 disableReceive(); 594 disableReceive();
594 disabled_Receive = TRUE; 595 disabled_Receive = TRUE;
595 } 596 }
596 digitalWrite(rcTransmitterPin, bHighFirst ? HIGH : LOW); 597 digitalWrite(rcTransmitterPin, bHighFirst ? HIGH : LOW);
597 delayMicroseconds( rcPulseLength * nFirstPulses); 598 uDelay(rcPulseLength * nFirstPulses);
599 // delayMicroseconds( rcPulseLength * nFirstPulses);
598 digitalWrite(rcTransmitterPin, bHighFirst ? LOW : HIGH); 600 digitalWrite(rcTransmitterPin, bHighFirst ? LOW : HIGH);
599 delayMicroseconds( rcPulseLength * nSecondPulses); 601 uDelay(rcPulseLength * nSecondPulses);
602 // delayMicroseconds( rcPulseLength * nSecondPulses);
600 603
601 if (disabled_Receive) { 604 if (disabled_Receive) {
602 enableReceiveIRQ(nReceiverInterrupt_backup); 605 enableReceiveIRQ(nReceiverInterrupt_backup);
603 } 606 }
604 } 607 }
661 transmit(1,10,TRUE); 664 transmit(1,10,TRUE);
662 } else if (rcProtocol == TYPE_C) { 665 } else if (rcProtocol == TYPE_C) {
663 transmit(4,71,TRUE); 666 transmit(4,71,TRUE);
664 } else if (rcProtocol == TYPE_D) { 667 } else if (rcProtocol == TYPE_D) {
665 transmit(0,1,FALSE); 668 transmit(0,1,FALSE);
666 delayMicroseconds(80000); 669 mDelay(80);
670 // delayMicroseconds(80000);
667 } 671 }
668 } 672 }
669 673
670 674
671 675

mercurial