-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathIRsmallDProtocolCheck.h
82 lines (66 loc) · 1.99 KB
/
IRsmallDProtocolCheck.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* IRsmallDProtocolCheck - Protocol selection check
*
* This file is part of the IRsmallDecoder library for Arduino
* Copyright (c) 2020 Luis Carvalho
*
*
* Notes:
* - It will redefine as '1' and check if there is more than one defined.
* - The user could do the 'define as 1', but it's best to keep it simple (for him/her)
* - The #undef is just to avoid a compile warning...
*/
#ifndef IRsmallD_ProtocolCheck_h
#define IRsmallD_ProtocolCheck_h
#ifdef IR_SMALLD_NEC
#undef IR_SMALLD_NEC
#define IR_SMALLD_NEC 1
#endif
#ifdef IR_SMALLD_NECx
#undef IR_SMALLD_NECx
#define IR_SMALLD_NECx 1
#endif
#ifdef IR_SMALLD_RC5
#undef IR_SMALLD_RC5
#define IR_SMALLD_RC5 1
#endif
#ifdef IR_SMALLD_SIRC12
#undef IR_SMALLD_SIRC12
#define IR_SMALLD_SIRC12 1
#endif
#ifdef IR_SMALLD_SIRC15
#undef IR_SMALLD_SIRC15
#define IR_SMALLD_SIRC15 1
#endif
#ifdef IR_SMALLD_SIRC20
#undef IR_SMALLD_SIRC20
#define IR_SMALLD_SIRC20 1
#endif
#ifdef IR_SMALLD_SIRC
#undef IR_SMALLD_SIRC
#define IR_SMALLD_SIRC 1
#endif
#ifdef IR_SMALLD_SAMSUNG
#undef IR_SMALLD_SAMSUNG
#define IR_SMALLD_SAMSUNG 1
#endif
#ifdef IR_SMALLD_SAMSUNG32
#undef IR_SMALLD_SAMSUNG32
#define IR_SMALLD_SAMSUNG32 1
#endif
#define IR_SMALLD_CHECSUM \
( IR_SMALLD_NEC \
+ IR_SMALLD_NECx \
+ IR_SMALLD_RC5 \
+ IR_SMALLD_SIRC12 \
+ IR_SMALLD_SIRC15 \
+ IR_SMALLD_SIRC20 \
+ IR_SMALLD_SIRC \
+ IR_SMALLD_SAMSUNG \
+ IR_SMALLD_SAMSUNG32 )
//if IR_SMALLD_CHECSUM == 1 then it's OK (there's one and only one #define...)
#if IR_SMALLD_CHECSUM == 0
#error Protocol not defined or misspelled... Check IRsmallDecoder Library documentation
#elif IR_SMALLD_CHECSUM > 1
#error Only one protocol is allowed... Check IRsmallDecoder Library documentation
#endif
#endif