@@ -74,6 +74,7 @@ int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks
74
74
// Debugging versions are in IRremote.cpp
75
75
#endif
76
76
77
+ #ifdef NEC
77
78
void IRsend::sendNEC (unsigned long data, int nbits)
78
79
{
79
80
enableIROut (38 );
@@ -93,7 +94,9 @@ void IRsend::sendNEC(unsigned long data, int nbits)
93
94
mark (NEC_BIT_MARK);
94
95
space (0 );
95
96
}
97
+ #endif
96
98
99
+ #ifdef WHYNTER
97
100
void IRsend::sendWhynter (unsigned long data, int nbits) {
98
101
enableIROut (38 );
99
102
mark (WHYNTER_ZERO_MARK);
@@ -114,7 +117,9 @@ void IRsend::sendWhynter(unsigned long data, int nbits) {
114
117
mark (WHYNTER_ZERO_MARK);
115
118
space (WHYNTER_ZERO_SPACE);
116
119
}
120
+ #endif
117
121
122
+ #ifdef SONY
118
123
void IRsend::sendSony (unsigned long data, int nbits) {
119
124
enableIROut (40 );
120
125
mark (SONY_HDR_MARK);
@@ -132,6 +137,7 @@ void IRsend::sendSony(unsigned long data, int nbits) {
132
137
data <<= 1 ;
133
138
}
134
139
}
140
+ #endif
135
141
136
142
void IRsend::sendRaw (unsigned int buf[], int len, int hz)
137
143
{
@@ -200,6 +206,8 @@ void IRsend::sendRC6(unsigned long data, int nbits)
200
206
}
201
207
space (0 ); // Turn off at end
202
208
}
209
+
210
+ #ifdef PANASONIC
203
211
void IRsend::sendPanasonic (unsigned int address, unsigned long data) {
204
212
enableIROut (35 );
205
213
mark (PANASONIC_HDR_MARK);
@@ -227,6 +235,9 @@ void IRsend::sendPanasonic(unsigned int address, unsigned long data) {
227
235
mark (PANASONIC_BIT_MARK);
228
236
space (0 );
229
237
}
238
+ #endif
239
+
240
+ #ifdef JVC
230
241
void IRsend::sendJVC (unsigned long data, int nbits, int repeat)
231
242
{
232
243
enableIROut (38 );
@@ -249,7 +260,9 @@ void IRsend::sendJVC(unsigned long data, int nbits, int repeat)
249
260
mark (JVC_BIT_MARK);
250
261
space (0 );
251
262
}
263
+ #endif
252
264
265
+ #ifdef SAMSUNG
253
266
void IRsend::sendSAMSUNG (unsigned long data, int nbits)
254
267
{
255
268
enableIROut (38 );
@@ -269,6 +282,7 @@ void IRsend::sendSAMSUNG(unsigned long data, int nbits)
269
282
mark (SAMSUNG_BIT_MARK);
270
283
space (0 );
271
284
}
285
+ #endif
272
286
273
287
void IRsend::mark (int time) {
274
288
// Sends an IR mark for the specified number of microseconds.
@@ -440,48 +454,70 @@ int IRrecv::decode(decode_results *results) {
440
454
if (irparams.rcvstate != STATE_STOP) {
441
455
return ERR;
442
456
}
457
+ #ifdef NEC
443
458
#ifdef DEBUG
444
459
Serial.println (" Attempting NEC decode" );
445
460
#endif
446
461
if (decodeNEC (results)) {
447
462
return DECODED;
448
463
}
464
+ #endif
465
+
466
+ #ifdef SONY
449
467
#ifdef DEBUG
450
468
Serial.println (" Attempting Sony decode" );
451
469
#endif
452
470
if (decodeSony (results)) {
453
471
return DECODED;
454
472
}
473
+ #endif
474
+
475
+ #ifdef SANYO
455
476
#ifdef DEBUG
456
477
Serial.println (" Attempting Sanyo decode" );
457
478
#endif
458
479
if (decodeSanyo (results)) {
459
480
return DECODED;
460
481
}
482
+ #endif
483
+
484
+ #ifdef MITSUBISHI
461
485
#ifdef DEBUG
462
486
Serial.println (" Attempting Mitsubishi decode" );
463
487
#endif
464
488
if (decodeMitsubishi (results)) {
465
489
return DECODED;
466
490
}
491
+ #endif
492
+
493
+ #ifdef RC5
467
494
#ifdef DEBUG
468
495
Serial.println (" Attempting RC5 decode" );
469
496
#endif
470
497
if (decodeRC5 (results)) {
471
498
return DECODED;
472
499
}
500
+ #endif
501
+
502
+ #ifdef RC6
473
503
#ifdef DEBUG
474
504
Serial.println (" Attempting RC6 decode" );
475
505
#endif
476
506
if (decodeRC6 (results)) {
477
507
return DECODED;
478
508
}
509
+ #endif
510
+
511
+ #ifdef PANASONIC
479
512
#ifdef DEBUG
480
513
Serial.println (" Attempting Panasonic decode" );
481
514
#endif
482
515
if (decodePanasonic (results)) {
483
516
return DECODED;
484
517
}
518
+ #endif
519
+
520
+ #ifdef JVC
485
521
#ifdef DEBUG
486
522
Serial.println (" Attempting LG decode" );
487
523
#endif
@@ -494,6 +530,9 @@ int IRrecv::decode(decode_results *results) {
494
530
if (decodeJVC (results)) {
495
531
return DECODED;
496
532
}
533
+ #endif
534
+
535
+ #ifdef SAMSUNG
497
536
#ifdef DEBUG
498
537
Serial.println (" Attempting SAMSUNG decode" );
499
538
#endif
@@ -507,12 +546,15 @@ int IRrecv::decode(decode_results *results) {
507
546
return DECODED;
508
547
}
509
548
// Aiwa RC-T501
549
+ #ifdef AIWA_RC_T501
510
550
#ifdef DEBUG
511
551
Serial.println (" Attempting Aiwa RC-T501 decode" );
512
552
#endif
513
553
if (decodeAiwaRCT501 (results)) {
514
554
return DECODED;
515
555
}
556
+ #endif
557
+
516
558
// decodeHash returns a hash on any input.
517
559
// Thus, it needs to be last in the list.
518
560
// If you add any decodes, add them before this.
@@ -524,6 +566,7 @@ int IRrecv::decode(decode_results *results) {
524
566
return ERR;
525
567
}
526
568
569
+ #ifdef NEC
527
570
// NECs have a repeat only 4 items long
528
571
long IRrecv::decodeNEC (decode_results *results) {
529
572
long data = 0 ;
@@ -572,7 +615,9 @@ long IRrecv::decodeNEC(decode_results *results) {
572
615
results->decode_type = NEC;
573
616
return DECODED;
574
617
}
618
+ #endif
575
619
620
+ #ifdef SONY
576
621
long IRrecv::decodeSony (decode_results *results) {
577
622
long data = 0 ;
578
623
if (irparams.rawlen < 2 * SONY_BITS + 2 ) {
@@ -586,7 +631,11 @@ long IRrecv::decodeSony(decode_results *results) {
586
631
// Serial.print("IR Gap found: ");
587
632
results->bits = 0 ;
588
633
results->value = REPEAT;
634
+ #ifdef SANYO
589
635
results->decode_type = SANYO;
636
+ #else
637
+ results->decode_type = UNKNOWN;
638
+ #endif
590
639
return DECODED;
591
640
}
592
641
offset++;
@@ -624,6 +673,7 @@ long IRrecv::decodeSony(decode_results *results) {
624
673
results->decode_type = SONY;
625
674
return DECODED;
626
675
}
676
+ #endif
627
677
628
678
long IRrecv::decodeWhynter (decode_results *results) {
629
679
long data = 0 ;
@@ -684,6 +734,7 @@ long IRrecv::decodeWhynter(decode_results *results) {
684
734
}
685
735
686
736
737
+ #ifdef SANYO
687
738
// I think this is a Sanyo decoder - serial = SA 8650B
688
739
// Looks like Sony except for timings, 48 chars of data and time/space different
689
740
long IRrecv::decodeSanyo (decode_results *results) {
@@ -747,7 +798,9 @@ long IRrecv::decodeSanyo(decode_results *results) {
747
798
results->decode_type = SANYO;
748
799
return DECODED;
749
800
}
801
1C6A
+ #endif
750
802
803
+ #ifdef MITSUBISHI
751
804
// Looks like Sony except for timings, 48 chars of data and time/space different
752
805
long IRrecv::decodeMitsubishi (decode_results *results) {
753
806
// Serial.print("?!? decoding Mitsubishi:");Serial.print(irparams.rawlen); Serial.print(" want "); Serial.println( 2 * MITSUBISHI_BITS + 2);
@@ -811,7 +864,7 @@ long IRrecv::decodeMitsubishi(decode_results *results) {
811
864
results->decode_type = MITSUBISHI;
812
865
return DECODED;
813
866
}
814
-
867
+ # endif
815
868
816
869
// Gets one undecoded level at a time from the raw buffer.
817
870
// The RC5/6 decoding is easier if the data is broken into time intervals.
@@ -858,6 +911,7 @@ int IRrecv::getRClevel(decode_results *results, int *offset, int *used, int t1)
858
911
#endif
859
912
return val;
860
913
}
914
+ #endif
861
915
862
916
long IRrecv::decodeRC5 (decode_results *results) {
863
917
if (irparams.rawlen < MIN_RC5_SAMPLES + 2 ) {
@@ -944,6 +998,8 @@ long IRrecv::decodeRC6(decode_results *results) {
944
998
results->decode_type = RC6;
945
999
return DECODED;
946
1000
}
1001
+
1002
+ #ifdef PANASONIC
947
1003
long IRrecv::decodePanasonic (decode_results *results) {
948
1004
unsigned long long data = 0 ;
949
1005
int offset = 1 ;
@@ -977,7 +1033,9 @@ long IRrecv::decodePanasonic(decode_results *results) {
977
1033
results->bits = PANASONIC_BITS;
978
1034
return DECODED;
979
1035
}
1036
+ #endif
980
1037
1038
+ #ifdef LG
981
1039
long IRrecv::decodeLG (decode_results *results) {
982
1040
long data = 0 ;
983
1041
int offset = 1 ; // Skip first space
@@ -1023,6 +1081,9 @@ long IRrecv::decodeLG(decode_results *results) {
1023
1081
}
1024
1082
1025
1083
1084
+ #endif
1085
+
1086
+ #ifdef JVC
1026
1087
long IRrecv::decodeJVC (decode_results *results) {
1027
1088
long data = 0 ;
1028
1089
int offset = 1 ; // Skip first space
@@ -1074,7 +1135,9 @@ long IRrecv::decodeJVC(decode_results *results) {
1074
1135
results->decode_type = JVC;
1075
1136
return DECODED;
1076
1137
}
1138
+ #endif
1077
1139
1140
+ #ifdef SAMSUNG
1078
1141
// SAMSUNGs have a repeat only 4 items long
1079
1142
long IRrecv::decodeSAMSUNG (decode_results *results) {
1080
1143
long data = 0 ;
@@ -1123,13 +1186,15 @@ long IRrecv::decodeSAMSUNG(decode_results *results) {
1123
1186
results->decode_type = SAMSUNG;
1124
1187
return DECODED;
1125
1188
}
1189
+ #endif
1126
1190
1127
1191
/* *
1128
1192
* Aiwa system
1129
1193
* Remote control RC-T501
1130
1194
* Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501
1131
1195
*
1132
1196
*/
1197
+ #ifdef AIWA_RC_T501
1133
1198
long IRrecv::decodeAiwaRCT501 (decode_results *results) {
1134
1199
int data = 0 ;
1135
1200
int offset = 1 ; // skip first garbage read
@@ -1183,6 +1248,8 @@ long IRrecv::decodeAiwaRCT501(decode_results *results) {
1183
1248
return DECODED;
1184
1249
}
1185
1250
1251
+ #endif
1252
+
1186
1253
/* -----------------------------------------------------------------------
1187
1254
* hashdecode - decode an arbitrary IR code.
1188
1255
* Instead of decoding using a standard encoding scheme
@@ -1259,7 +1326,9 @@ i.e. use 0x1C10 instead of 0x0000000000001C10 which is listed in the
1259
1326
linked LIRC file.
1260
1327
*/
1261
1328
1262
- void IRsend::sendSharpRaw (unsigned long data, int nbits) {
1329
+ #ifdef IRsendSHARP
1330
+ void IRsend::sendSharp (unsigned long data, int nbits) {
1331
+ unsigned long invertdata = data ^ SHARP_TOGGLE_MASK;
1263
1332
enableIROut (38 );
1264
1333
1265
1334
// Sending codes in bursts of 3 (normal, inverted, normal) makes transmission
@@ -1289,7 +1358,11 @@ void IRsend::sendSharp(unsigned int address, unsigned int command) {
1289
1358
sendSharpRaw ((address << 10 ) | (command << 2 ) | 2 , 15 );
1290
1359
}
1291
1360
1292
- void IRsend::sendDISH (unsigned long data, int nbits) {
1361
+ #endif
1362
+
1363
+ #ifdef IRsendDISH
1364
+ void IRsend::sendDISH (unsigned long data, int nbits)
1365
+ {
1293
1366
enableIROut (56 );
1294
1367
mark (DISH_HDR_MARK);
1295
1368
space (DISH_HDR_SPACE);
@@ -1305,13 +1378,15 @@ void IRsend::sendDISH(unsigned long data, int nbits) {
1305
1378
data <<= 1 ;
1306
1379
}
1307
1380
}
1308
-
1381
+ # endif
1309
1382
/* *
1310
1383
* Aiwa system
1311
1384
* Remote control RC-T501
1312
1385
* Lirc file http://lirc.sourceforge.net/remotes/aiwa/RC-T501
1313
1386
*
1314
1387
*/
1388
+
1389
+ #ifdef AIWA_RC_T501
1315
1390
void IRsend::sendAiwaRCT501 (int code) {
1316
1391
// PRE-DATA, 26 bits, 0x227EEC0
1317
1392
long int pre = 0x227EEC0 ;
@@ -1354,4 +1429,5 @@ void IRsend::sendAiwaRCT501(int code) {
1354
1429
1355
1430
mark (AIWA_RC_T501_BIT_MARK);
1356
1431
space (0 );
1357
- }
1432
+ }
1433
+ #endif
0 commit comments