@@ -72,6 +72,7 @@ int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks
72
72
// Debugging versions are in IRremote.cpp
73
73
#endif
74
74
75
+ #ifdef IRsendNEC
75
76
void IRsend::sendNEC (unsigned long data, int nbits)
76
77
{
77
78
enableIROut (38 );
@@ -91,7 +92,9 @@ void IRsend::sendNEC(unsigned long data, int nbits)
91
92
mark (NEC_BIT_MARK);
92
93
space (0 );
93
94
}
95
+ #endif
94
96
97
+ #ifdef IRsendSONY
95
98
void IRsend::sendSony (unsigned long data, int nbits) {
96
99
enableIROut (40 );
97
100
mark (SONY_HDR_MARK);
@@ -109,7 +112,9 @@ void IRsend::sendSony(unsigned long data, int nbits) {
109
112
data <<= 1 ;
110
113
}
111
114
}
115
+ #endif
112
116
117
+ #ifdef IRsendRAW
113
118
void IRsend::sendRaw (unsigned int buf[], int len, int hz)
114
119
{
115
120
enableIROut (hz);
@@ -123,7 +128,9 @@ void IRsend::sendRaw(unsigned int buf[], int len, int hz)
123
128
}
124
129
space (0 ); // Just to be sure
125
130
}
131
+ #endif
126
132
133
+ #ifdef IRsendRC5
127
134
// Note: first bit must be a one (start bit)
128
135
void IRsend::sendRC5 (unsigned long data, int nbits)
129
136
{
@@ -145,7 +152,9 @@ void IRsend::sendRC5(unsigned long data, int nbits)
145
152
}
146
153
space (0 ); // Turn off at end
147
154
}
155
+ #endif
148
156
157
+ #ifdef IRsendRC6
149
158
// Caller needs to take care of flipping the toggle bit
150
159
void IRsend::sendRC6 (unsigned long data, int nbits)
151
160
{
@@ -177,6 +186,9 @@ void IRsend::sendRC6(unsigned long data, int nbits)
177
186
}
178
187
space (0 ); // Turn off at end
179
188
}
189
+ #endif
190
+
191
+ #ifdef IRsendPANASONIC
180
192
void IRsend::sendPanasonic (unsigned int address, unsigned long data) {
181
193
enableIROut (35 );
182
194
mark (PANASONIC_HDR_MARK);
@@ -204,6 +216,9 @@ void IRsend::sendPanasonic(unsigned int address, unsigned long data) {
204
216
mark (PANASONIC_BIT_MARK);
205
217
space (0 );
206
218
}
219
+ #endif
220
+
221
+ #ifdef IRsendJVC
207
222
void IRsend::sendJVC (unsigned long data, int nbits, int repeat)
208
223
{
209
224
enableIROut (38 );
@@ -226,7 +241,9 @@ void IRsend::sendJVC(unsigned long data, int nbits, int repeat)
226
241
mark (JVC_BIT_MARK);
227
242
space (0 );
228
243
}
244
+ #endif
229
245
246
+ #ifdef IRsendSAMSUNG
230
247
void IRsend::sendSAMSUNG (unsigned long data, int nbits)
231
248
{
232
249
enableIROut (38 );
@@ -246,6 +263,7 @@ void IRsend::sendSAMSUNG(unsigned long data, int nbits)
246
263
mark (SAMSUNG_BIT_MARK);
247
264
space (0 );
248
265
}
266
+ #endif
249
267
250
268
void IRsend::mark (int time) {
251
269
// Sends an IR mark for the specified number of microseconds.
@@ -417,60 +435,87 @@ int IRrecv::decode(decode_results *results) {
417
435
if (irparams.rcvstate != STATE_STOP) {
418
436
return ERR;
419
437
}
438
+ #ifdef NEC
420
439
#ifdef DEBUG
421
440
Serial.println (" Attempting NEC decode" );
422
441
#endif
423
442
if (decodeNEC (results)) {
424
443
return DECODED;
425
444
}
445
+ #endif
446
+
447
+ #ifdef SONY
426
448
#ifdef DEBUG
427
449
Serial.println (" Attempting Sony decode" );
428
450
#endif
429
451
if (decodeSony (results)) {
430
452
return DECODED;
431
453
}
454
+ #endif
455
+
456
+ #ifdef SANYO
432
457
#ifdef DEBUG
433
458
Serial.println (" Attempting Sanyo decode" );
434
459
#endif
435
460
if (decodeSanyo (results)) {
436
461
return DECODED;
437
462
}
463
+ #endif
464
+
465
+ #ifdef MITSUBISHI
438
466
#ifdef DEBUG
439
467
Serial.println (" Attempting Mitsubishi decode" );
440
468
#endif
441
469
if (decodeMitsubishi (results)) {
442
470
return DECODED;
443
471
}
472
+ #endif
473
+
474
+ #ifdef RC5
444
475
#ifdef DEBUG
445
476
Serial.println (" Attempting RC5 decode" );
446
477
#endif
447
478
if (decodeRC5 (results)) {
448
479
return DECODED;
449
480
}
481
+ #endif
482
+
483
+ #ifdef RC6
450
484
#ifdef DEBUG
451
485
Serial.println (" Attempting RC6 decode" );
452
486
#endif
453
487
if (decodeRC6 (results)) {
454
488
return DECODED;
455
489
}
490
+ #endif
491
+
492
+ #ifdef PANASONIC
456
493
#ifdef DEBUG
457
494
Serial.println (" Attempting Panasonic decode" );
458
495
#endif
459
496
if (decodePanasonic (results)) {
460
497
return DECODED;
461
498
}
499
+ #endif
500
+
501
+ #ifdef JVC
462
502
#ifdef DEBUG
463
503
Serial.println (" Attempting JVC decode" );
464
504
#endif
465
505
if (decodeJVC (results)) {
466
506
return DECODED;
467
507
}
508
+ #endif
509
+
510
+ #ifdef SAMSUNG
468
511
#ifdef DEBUG
469
512
Serial.println (" Attempting SAMSUNG decode" );
470
513
#endif
471
514
if (decodeSAMSUNG (results)) {
472
515
return DECODED;
473
516
}
517
+ #endif
518
+
474
519
// decodeHash returns a hash on any input.
475
520
// Thus, it needs to be last in the list.
476
521
// If you add any decodes, add them before this.
@@ -482,6 +527,7 @@ int IRrecv::decode(decode_results *results) {
482
527
return ERR;
483
528
}
484
529
530
+ #ifdef NEC
485
531
// NECs have a repeat only 4 items long
486
532
long IRrecv::decodeNEC (decode_results *results) {
487
533
long data = 0 ;
@@ -530,7 +576,9 @@ long IRrecv::decodeNEC(decode_results *results) {
530
576
results->decode_type = NEC;
531
577
return DECODED;
532
578
}
579
+ #endif
533
580
581
+ #ifdef SONY
534
582
long IRrecv::decodeSony (decode_results *results) {
535
583
long data = 0 ;
536
584
if (irparams.rawlen < 2 * SONY_BITS + 2 ) {
@@ -544,7 +592,11 @@ long IRrecv::decodeSony(decode_results *results) {
544
592
// Serial.print("IR Gap found: ");
545
593
results->bits = 0 ;
546
594
results->value = REPEAT;
595
+ #ifdef SANYO
547
596
results->decode_type = SANYO;
597
+ #else
598
+ results->decode_type = UNKNOWN;
599
+ #endif
548
600
return DECODED;
549
601
}
550
602
offset++;
@@ -582,7 +634,9 @@ long IRrecv::decodeSony(decode_results *results) {
582
634
results->decode_type = SONY;
583
635
return DECODED;
584
636
}
637
+ #endif
585
638
639
+ #ifdef SANYO
586
640
// I think this is a Sanyo decoder - serial = SA 8650B
587
641
// Looks like Sony except for timings, 48 chars of data and time/space different
588
642
long IRrecv::decodeSanyo (decode_results *results) {
@@ -646,7 +700,9 @@ long IRrecv::decodeSanyo(decode_results *results) {
646
700
results->decode_type = SANYO;
647
701
return DECODED;
648
702
}
703
+ #endif
649
704
705
+ #ifdef MITSUBISHI
650
706
// Looks like Sony except for timings, 48 chars of data and time/space different
651
707
long IRrecv::decodeMitsubishi (decode_results *results) {
652
708
// Serial.print("?!? decoding Mitsubishi:");Serial.print(irparams.rawlen); Serial.print(" want "); Serial.println( 2 * MITSUBISHI_BITS + 2);
@@ -710,8 +766,9 @@ long IRrecv::decodeMitsubishi(decode_results *results) {
710
766
results->decode_type = MITSUBISHI;
711
767
return DECODED;
712
768
}
769
+ #endif
713
770
714
-
771
+ # if defined(RC5) || defined(RC6)
715
772
// Gets one undecoded level at a time from the raw buffer.
716
773
// The RC5/6 decoding is easier if the data is broken into time intervals.
717
774
// E.g. if the buffer has MARK for 2 time intervals and SPACE for 1,
@@ -757,7 +814,9 @@ int IRrecv::getRClevel(decode_results *results, int *offset, int *used, int t1)
757
814
#endif
758
815
return val;
759
816
}
817
+ #endif
760
818
819
+ #ifdef RC5
761
820
long IRrecv::decodeRC5 (decode_results *results) {
762
821
if (irparams.rawlen < MIN_RC5_SAMPLES + 2 ) {
763
822
return ERR;
@@ -792,7 +851,9 @@ long IRrecv::decodeRC5(decode_results *results) {
792
851
results->decode_type = RC5;
793
852
return DECODED;
794
853
}
854
+ #endif
795
855
856
+ #ifdef RC6
796
857
long IRrecv::decodeRC6 (decode_results *results) {
797
858
if (results->rawlen < MIN_RC6_SAMPLES) {
798
859
return ERR;
@@ -843,6 +904,9 @@ long IRrecv::decodeRC6(decode_results *results) {
843
904
results->decode_type = RC6;
844
905
return DECODED;
845
906
}
907
+ #endif
908
+
909
+ #ifdef PANASONIC
846
910
long IRrecv::decodePanasonic (decode_results *results) {
847
911
unsigned long long data = 0 ;
848
912
int offset = 1 ;
@@ -876,6 +940,9 @@ long IRrecv::decodePanasonic(decode_results *results) {
876
940
results->bits = PANASONIC_BITS;
877
941
return DECODED;
878
942
}
943
+ #endif
944
+
945
+ #ifdef JVC
879
946
long IRrecv::decodeJVC (decode_results *results) {
880
947
long data = 0 ;
881
948
int offset = 1 ; // Skip first space
@@ -927,7 +994,9 @@ long IRrecv::decodeJVC(decode_results *results) {
927
994
results->decode_type = JVC;
928
995
return DECODED;
929
996
}
997
+ #endif
930
998
999
+ #ifdef SAMSUNG
931
1000
// SAMSUNGs have a repeat only 4 items long
932
1001
long IRrecv::decodeSAMSUNG (decode_results *results) {
933
1002
long data = 0 ;
@@ -976,6 +1045,7 @@ long IRrecv::decodeSAMSUNG(decode_results *results) {
976
1045
results->decode_type = SAMSUNG;
977
1046
return DECODED;
978
1047
}
1048
+ #endif
979
1049
980
1050
/* -----------------------------------------------------------------------
981
1051
* hashdecode - decode an arbitrary IR code.
@@ -1052,7 +1122,7 @@ For the DISH codes, only send the last for characters of the hex.
1052
1122
i.e. use 0x1C10 instead of 0x0000000000001C10 which is listed in the
1053
1123
linked LIRC file.
1054
1124
*/
1055
-
1125
+ # ifdef IRsendSHARP
1056
1126
void IRsend::sendSharp (unsigned long data, int nbits) {
1057
1127
unsigned long invertdata = data ^ SHARP_TOGGLE_MASK;
1058
1128
enableIROut (38 );
@@ -1086,7 +1156,9 @@ void IRsend::sendSharp(unsigned long data, int nbits) {
1086
1156
space (SHARP_ZERO_SPACE);
1087
1157
delay (46 );
1088
1158
}
1159
+ #endif
1089
1160
1161
+ #ifdef IRsendDISH
1090
1162
void IRsend::sendDISH (unsigned long data, int nbits)
1091
1163
{
1092
1164
enableIROut (56 );
@@ -1104,3 +1176,4 @@ void IRsend::sendDISH(unsigned long data, int nbits)
1104
1176
data <<= 1 ;
1105
1177
}
1106
1178
}
1179
+ #endif
0 commit comments