]>
Commit | Line | Data |
---|---|---|
1 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2 | * irmp.c - infrared multi-protocol decoder, supports several remote control protocols\r | |
3 | *\r | |
4 | * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de\r | |
5 | *\r | |
6 | * $Id: irmp.c,v 1.192 2017/02/17 09:13:06 fm Exp $\r | |
7 | *\r | |
8 | * Supported AVR mikrocontrollers:\r | |
9 | *\r | |
10 | * ATtiny87, ATtiny167\r | |
11 | * ATtiny45, ATtiny85\r | |
12 | * ATtiny44, ATtiny84\r | |
13 | * ATmega8, ATmega16, ATmega32\r | |
14 | * ATmega162\r | |
15 | * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P\r | |
16 | * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P\r | |
17 | *\r | |
18 | * This program is free software; you can redistribute it and/or modify\r | |
19 | * it under the terms of the GNU General Public License as published by\r | |
20 | * the Free Software Foundation; either version 2 of the License, or\r | |
21 | * (at your option) any later version.\r | |
22 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
23 | */\r | |
24 | \r | |
25 | #include "irmp.h"\r | |
26 | \r | |
27 | #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1\r | |
28 | # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1\r | |
29 | #else\r | |
30 | # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0\r | |
31 | #endif\r | |
32 | \r | |
33 | #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1\r | |
34 | # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1\r | |
35 | #else\r | |
36 | # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0\r | |
37 | #endif\r | |
38 | \r | |
39 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \\r | |
40 | IRMP_SUPPORT_S100_PROTOCOL == 1 || \\r | |
41 | IRMP_SUPPORT_RC6_PROTOCOL == 1 || \\r | |
42 | IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \\r | |
43 | IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \\r | |
44 | IRMP_SUPPORT_IR60_PROTOCOL == 1 || \\r | |
45 | IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \\r | |
46 | IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \\r | |
47 | IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
48 | # define IRMP_SUPPORT_MANCHESTER 1\r | |
49 | #else\r | |
50 | # define IRMP_SUPPORT_MANCHESTER 0\r | |
51 | #endif\r | |
52 | \r | |
53 | #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
54 | # define IRMP_SUPPORT_SERIAL 1\r | |
55 | #else\r | |
56 | # define IRMP_SUPPORT_SERIAL 0\r | |
57 | #endif\r | |
58 | \r | |
59 | #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec\r | |
60 | \r | |
61 | #define MIN_TOLERANCE_00 1.0 // -0%\r | |
62 | #define MAX_TOLERANCE_00 1.0 // +0%\r | |
63 | \r | |
64 | #define MIN_TOLERANCE_02 0.98 // -2%\r | |
65 | #define MAX_TOLERANCE_02 1.02 // +2%\r | |
66 | \r | |
67 | #define MIN_TOLERANCE_03 0.97 // -3%\r | |
68 | #define MAX_TOLERANCE_03 1.03 // +3%\r | |
69 | \r | |
70 | #define MIN_TOLERANCE_05 0.95 // -5%\r | |
71 | #define MAX_TOLERANCE_05 1.05 // +5%\r | |
72 | \r | |
73 | #define MIN_TOLERANCE_10 0.9 // -10%\r | |
74 | #define MAX_TOLERANCE_10 1.1 // +10%\r | |
75 | \r | |
76 | #define MIN_TOLERANCE_15 0.85 // -15%\r | |
77 | #define MAX_TOLERANCE_15 1.15 // +15%\r | |
78 | \r | |
79 | #define MIN_TOLERANCE_20 0.8 // -20%\r | |
80 | #define MAX_TOLERANCE_20 1.2 // +20%\r | |
81 | \r | |
82 | #define MIN_TOLERANCE_30 0.7 // -30%\r | |
83 | #define MAX_TOLERANCE_30 1.3 // +30%\r | |
84 | \r | |
85 | #define MIN_TOLERANCE_40 0.6 // -40%\r | |
86 | #define MAX_TOLERANCE_40 1.4 // +40%\r | |
87 | \r | |
88 | #define MIN_TOLERANCE_50 0.5 // -50%\r | |
89 | #define MAX_TOLERANCE_50 1.5 // +50%\r | |
90 | \r | |
91 | #define MIN_TOLERANCE_60 0.4 // -60%\r | |
92 | #define MAX_TOLERANCE_60 1.6 // +60%\r | |
93 | \r | |
94 | #define MIN_TOLERANCE_70 0.3 // -70%\r | |
95 | #define MAX_TOLERANCE_70 1.7 // +70%\r | |
96 | \r | |
97 | #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
98 | #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
99 | #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
100 | #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:\r | |
101 | # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))\r | |
102 | #else // only 5% + 1 to avoid conflict with RC6:\r | |
103 | # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
104 | #endif\r | |
105 | #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
106 | #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
107 | #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
108 | #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
109 | #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
110 | #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
111 | \r | |
112 | #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
113 | #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
114 | #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
115 | #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
116 | #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
117 | #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
118 | #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
119 | #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
120 | #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
121 | #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
122 | #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
123 | #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
124 | // autodetect nec repetition frame within 50 msec:\r | |
125 | // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms\r | |
126 | #if 0\r | |
127 | #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r | |
128 | #else\r | |
129 | #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)\r | |
130 | #endif\r | |
131 | \r | |
132 | #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
133 | #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
134 | #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
135 | #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
136 | #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
137 | #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
138 | #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
139 | #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
140 | #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
141 | #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
142 | \r | |
143 | #define SAMSUNGAH_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
144 | #define SAMSUNGAH_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
145 | #define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
146 | #define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
147 | #define SAMSUNGAH_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
148 | #define SAMSUNGAH_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
149 | #define SAMSUNGAH_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
150 | #define SAMSUNGAH_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
151 | #define SAMSUNGAH_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
152 | #define SAMSUNGAH_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
153 | \r | |
154 | #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
155 | #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
156 | #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
157 | #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
158 | #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
159 | #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
160 | #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
161 | #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
162 | #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
163 | #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
164 | \r | |
165 | #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
166 | #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
167 | #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
168 | #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
169 | #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
170 | #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
171 | #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
172 | #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
173 | #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
174 | #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
175 | \r | |
176 | #define MITSU_HEAVY_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
177 | #define MITSU_HEAVY_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
178 | #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
179 | #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
180 | #define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
181 | #define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
182 | #define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
183 | #define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
184 | #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
185 | #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
186 | \r | |
187 | #define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
188 | #define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
189 | #define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
190 | #define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
191 | #define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
192 | #define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
193 | #define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
194 | #define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
195 | #define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
196 | #define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
197 | \r | |
198 | #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
199 | #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
200 | #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
201 | #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
202 | #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
203 | #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
204 | #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
205 | #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
206 | #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
207 | #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
208 | \r | |
209 | #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
210 | #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
211 | #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
212 | #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
213 | #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
214 | #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
215 | #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
216 | #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
217 | #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
218 | #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
219 | \r | |
220 | \r | |
221 | #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:\r | |
222 | #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
223 | #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
224 | #else\r | |
225 | #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
226 | #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
227 | #endif\r | |
228 | \r | |
229 | #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
230 | #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
231 | \r | |
232 | #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:\r | |
233 | #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
234 | #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
235 | #else\r | |
236 | #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
237 | #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
238 | #endif\r | |
239 | \r | |
240 | #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
241 | #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
242 | \r | |
243 | #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
244 | #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
245 | #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
246 | #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
247 | // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON\r | |
248 | #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
249 | #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
250 | #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
251 | \r | |
252 | #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
253 | #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
254 | #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
255 | #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
256 | #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
257 | #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
258 | \r | |
259 | #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
260 | #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
261 | #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
262 | #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
263 | #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
264 | #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
265 | #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
266 | #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800\r | |
267 | #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
268 | #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600\r | |
269 | \r | |
270 | #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
271 | #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
272 | #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
273 | #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
274 | #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
275 | #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
276 | #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
277 | #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
278 | #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
279 | #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
280 | \r | |
281 | #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
282 | #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
283 | #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
284 | #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
285 | #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
286 | #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
287 | #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
288 | #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
289 | #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
290 | #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
291 | #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
292 | #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
293 | \r | |
294 | #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
295 | #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
296 | #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
297 | #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
298 | #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
299 | #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
300 | #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
301 | #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
302 | #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
303 | #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
304 | #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
305 | #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
306 | \r | |
307 | #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
308 | #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
309 | #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
310 | #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
311 | #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
312 | #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
313 | #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
314 | #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
315 | #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
316 | #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
317 | #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
318 | #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
319 | \r | |
320 | #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
321 | #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
322 | #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
323 | #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
324 | #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
325 | #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
326 | #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
327 | #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
328 | #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
329 | #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
330 | #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
331 | #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX ((PAUSE_LEN)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) // value must be below IRMP_TIMEOUT\r | |
332 | #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
333 | #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
334 | #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
335 | #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
336 | #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
337 | #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
338 | #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
339 | #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
340 | #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
341 | #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
342 | #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
343 | #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
344 | #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
345 | #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
346 | \r | |
347 | #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))\r | |
348 | #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
349 | #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
350 | #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
351 | #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
352 | #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)\r | |
353 | #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
354 | \r | |
355 | #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
356 | #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
357 | #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
358 | #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
359 | #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
360 | #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
361 | #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
362 | #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
363 | \r | |
364 | #define FDC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX\r | |
365 | #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))\r | |
366 | #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
367 | #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))\r | |
368 | #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
369 | #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)\r | |
370 | #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
371 | #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
372 | #if 0\r | |
373 | #define FDC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255\r | |
374 | #else\r | |
375 | #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1\r | |
376 | #endif\r | |
377 | #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
378 | \r | |
379 | #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
380 | #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
381 | #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
382 | #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
383 | #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
384 | #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
385 | #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
386 | #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
387 | #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
388 | #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
389 | \r | |
390 | #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
391 | #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
392 | #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!\r | |
393 | #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!\r | |
394 | #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
395 | #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
396 | #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
397 | #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
398 | #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
399 | #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
400 | // autodetect JVC repetition frame within 50 msec:\r | |
401 | #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r | |
402 | \r | |
403 | #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
404 | #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
405 | #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
406 | #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
407 | #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
408 | #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
409 | #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
410 | #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
411 | #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
412 | #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
413 | #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
414 | #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
415 | #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r | |
416 | \r | |
417 | #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
418 | #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
419 | #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
420 | #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
421 | #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
422 | #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
423 | #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
424 | #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
425 | #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
426 | #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
427 | #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
428 | #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
429 | #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
430 | #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
431 | \r | |
432 | #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
433 | #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
434 | #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
435 | #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
436 | #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))\r | |
437 | #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))\r | |
438 | #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))\r | |
439 | #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))\r | |
440 | \r | |
441 | #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
442 | #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
443 | #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
444 | #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
445 | #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
446 | #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
447 | #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
448 | #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
449 | #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)\r | |
450 | #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)\r | |
451 | \r | |
452 | #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
453 | #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
454 | #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
455 | #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
456 | #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
457 | #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
458 | #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
459 | #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
460 | #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
461 | #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
462 | #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)\r | |
463 | \r | |
464 | #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
465 | #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
466 | #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
467 | #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
468 | #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
469 | #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
470 | #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
471 | #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
472 | \r | |
473 | #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
474 | #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
475 | #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
476 | #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
477 | #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
478 | #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
479 | #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
480 | #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
481 | \r | |
482 | #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
483 | #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
484 | #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
485 | #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
486 | #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
487 | #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
488 | #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
489 | #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
490 | \r | |
491 | #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
492 | #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
493 | #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
494 | #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)\r | |
495 | #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
496 | #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
497 | #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
498 | #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
499 | #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)\r | |
500 | #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)\r | |
501 | // autodetect TELEFUNKEN repetition frame within 50 msec:\r | |
502 | // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)\r | |
503 | \r | |
504 | #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
505 | #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
506 | #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
507 | #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
508 | #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))\r | |
509 | #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
510 | #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
511 | #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
512 | #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
513 | #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))\r | |
514 | #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
515 | #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
516 | #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
517 | #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
518 | \r | |
519 | #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
520 | #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
521 | #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
522 | #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
523 | #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
524 | #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
525 | #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
526 | #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
527 | #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
528 | #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
529 | #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
530 | #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
531 | #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)\r | |
532 | #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)\r | |
533 | \r | |
534 | #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
535 | #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
536 | #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
537 | #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
538 | #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))\r | |
539 | #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
540 | #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
541 | #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
542 | #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
543 | #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))\r | |
544 | #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
545 | #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
546 | #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
547 | #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
548 | \r | |
549 | #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r | |
550 | #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r | |
551 | #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r | |
552 | #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r | |
553 | #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r | |
554 | #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r | |
555 | #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r | |
556 | #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r | |
557 | #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)\r | |
558 | #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)\r | |
559 | \r | |
560 | #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
561 | #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
562 | #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)\r | |
563 | #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)\r | |
564 | #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))\r | |
565 | #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
566 | #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
567 | #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
568 | #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
569 | #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))\r | |
570 | #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
571 | #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
572 | #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)\r | |
573 | #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)\r | |
574 | \r | |
575 | #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!\r | |
576 | \r | |
577 | #ifdef ANALYZE\r | |
578 | # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }\r | |
579 | # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }\r | |
580 | # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }\r | |
581 | # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }\r | |
582 | # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }\r | |
583 | static int silent;\r | |
584 | static int time_counter;\r | |
585 | static int verbose;\r | |
586 | \r | |
587 | /******************************* not every PIC compiler knows variadic macros :-(\r | |
588 | #else\r | |
589 | # define ANALYZE_PUTCHAR(a)\r | |
590 | # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)\r | |
591 | # define ANALYZE_PRINTF(...)\r | |
592 | # define ANALYZE_ONLY_NORMAL_PRINTF(...)\r | |
593 | # endif\r | |
594 | # define ANALYZE_NEWLINE()\r | |
595 | *********************************/\r | |
596 | #endif\r | |
597 | \r | |
598 | #if IRMP_USE_CALLBACK == 1\r | |
599 | static void (*irmp_callback_ptr) (uint_fast8_t);\r | |
600 | #endif // IRMP_USE_CALLBACK == 1\r | |
601 | \r | |
602 | #define PARITY_CHECK_OK 1\r | |
603 | #define PARITY_CHECK_FAILED 0\r | |
604 | \r | |
605 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
606 | * Protocol names\r | |
607 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
608 | */\r | |
609 | #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1\r | |
610 | static const char proto_unknown[] PROGMEM = "UNKNOWN";\r | |
611 | static const char proto_sircs[] PROGMEM = "SIRCS";\r | |
612 | static const char proto_nec[] PROGMEM = "NEC";\r | |
613 | static const char proto_samsung[] PROGMEM = "SAMSUNG";\r | |
614 | static const char proto_matsushita[] PROGMEM = "MATSUSH";\r | |
615 | static const char proto_kaseikyo[] PROGMEM = "KASEIKYO";\r | |
616 | static const char proto_recs80[] PROGMEM = "RECS80";\r | |
617 | static const char proto_rc5[] PROGMEM = "RC5";\r | |
618 | static const char proto_denon[] PROGMEM = "DENON";\r | |
619 | static const char proto_rc6[] PROGMEM = "RC6";\r | |
620 | static const char proto_samsung32[] PROGMEM = "SAMSG32";\r | |
621 | static const char proto_apple[] PROGMEM = "APPLE";\r | |
622 | static const char proto_recs80ext[] PROGMEM = "RECS80EX";\r | |
623 | static const char proto_nubert[] PROGMEM = "NUBERT";\r | |
624 | static const char proto_bang_olufsen[] PROGMEM = "BANG OLU";\r | |
625 | static const char proto_grundig[] PROGMEM = "GRUNDIG";\r | |
626 | static const char proto_nokia[] PROGMEM = "NOKIA";\r | |
627 | static const char proto_siemens[] PROGMEM = "SIEMENS";\r | |
628 | static const char proto_fdc[] PROGMEM = "FDC";\r | |
629 | static const char proto_rccar[] PROGMEM = "RCCAR";\r | |
630 | static const char proto_jvc[] PROGMEM = "JVC";\r | |
631 | static const char proto_rc6a[] PROGMEM = "RC6A";\r | |
632 | static const char proto_nikon[] PROGMEM = "NIKON";\r | |
633 | static const char proto_ruwido[] PROGMEM = "RUWIDO";\r | |
634 | static const char proto_ir60[] PROGMEM = "IR60";\r | |
635 | static const char proto_kathrein[] PROGMEM = "KATHREIN";\r | |
636 | static const char proto_netbox[] PROGMEM = "NETBOX";\r | |
637 | static const char proto_nec16[] PROGMEM = "NEC16";\r | |
638 | static const char proto_nec42[] PROGMEM = "NEC42";\r | |
639 | static const char proto_lego[] PROGMEM = "LEGO";\r | |
640 | static const char proto_thomson[] PROGMEM = "THOMSON";\r | |
641 | static const char proto_bose[] PROGMEM = "BOSE";\r | |
642 | static const char proto_a1tvbox[] PROGMEM = "A1TVBOX";\r | |
643 | static const char proto_ortek[] PROGMEM = "ORTEK";\r | |
644 | static const char proto_telefunken[] PROGMEM = "TELEFUNKEN";\r | |
645 | static const char proto_roomba[] PROGMEM = "ROOMBA";\r | |
646 | static const char proto_rcmm32[] PROGMEM = "RCMM32";\r | |
647 | static const char proto_rcmm24[] PROGMEM = "RCMM24";\r | |
648 | static const char proto_rcmm12[] PROGMEM = "RCMM12";\r | |
649 | static const char proto_speaker[] PROGMEM = "SPEAKER";\r | |
650 | static const char proto_lgair[] PROGMEM = "LGAIR";\r | |
651 | static const char proto_samsung48[] PROGMEM = "SAMSG48";\r | |
652 | static const char proto_merlin[] PROGMEM = "MERLIN";\r | |
653 | static const char proto_pentax[] PROGMEM = "PENTAX";\r | |
654 | static const char proto_fan[] PROGMEM = "FAN";\r | |
655 | static const char proto_s100[] PROGMEM = "S100";\r | |
656 | static const char proto_acp24[] PROGMEM = "ACP24";\r | |
657 | static const char proto_technics[] PROGMEM = "TECHNICS";\r | |
658 | static const char proto_panasonic[] PROGMEM = "PANASONIC";\r | |
659 | static const char proto_mitsu_heavy[] PROGMEM = "MITSU_HEAVY";\r | |
660 | static const char proto_vincent[] PROGMEM = "VINCENT";\r | |
661 | static const char proto_samsungah[] PROGMEM = "SAMSUNGAH";\r | |
662 | \r | |
663 | static const char proto_radio1[] PROGMEM = "RADIO1";\r | |
664 | \r | |
665 | const char * const\r | |
666 | irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =\r | |
667 | {\r | |
668 | proto_unknown,\r | |
669 | proto_sircs,\r | |
670 | proto_nec,\r | |
671 | proto_samsung,\r | |
672 | proto_matsushita,\r | |
673 | proto_kaseikyo,\r | |
674 | proto_recs80,\r | |
675 | proto_rc5,\r | |
676 | proto_denon,\r | |
677 | proto_rc6,\r | |
678 | proto_samsung32,\r | |
679 | proto_apple,\r | |
680 | proto_recs80ext,\r | |
681 | proto_nubert,\r | |
682 | proto_bang_olufsen,\r | |
683 | proto_grundig,\r | |
684 | proto_nokia,\r | |
685 | proto_siemens,\r | |
686 | proto_fdc,\r | |
687 | proto_rccar,\r | |
688 | proto_jvc,\r | |
689 | proto_rc6a,\r | |
690 | proto_nikon,\r | |
691 | proto_ruwido,\r | |
692 | proto_ir60,\r | |
693 | proto_kathrein,\r | |
694 | proto_netbox,\r | |
695 | proto_nec16,\r | |
696 | proto_nec42,\r | |
697 | proto_lego,\r | |
698 | proto_thomson,\r | |
699 | proto_bose,\r | |
700 | proto_a1tvbox,\r | |
701 | proto_ortek,\r | |
702 | proto_telefunken,\r | |
703 | proto_roomba,\r | |
704 | proto_rcmm32,\r | |
705 | proto_rcmm24,\r | |
706 | proto_rcmm12,\r | |
707 | proto_speaker,\r | |
708 | proto_lgair,\r | |
709 | proto_samsung48,\r | |
710 | proto_merlin,\r | |
711 | proto_pentax,\r | |
712 | proto_fan,\r | |
713 | proto_s100,\r | |
714 | proto_acp24,\r | |
715 | proto_technics,\r | |
716 | proto_panasonic,\r | |
717 | proto_mitsu_heavy,\r | |
718 | proto_vincent,\r | |
719 | proto_samsungah,\r | |
720 | proto_radio1\r | |
721 | };\r | |
722 | \r | |
723 | #endif\r | |
724 | \r | |
725 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
726 | * Logging\r | |
727 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
728 | */\r | |
729 | #if IRMP_LOGGING == 1 // logging via UART\r | |
730 | \r | |
731 | #if defined(ARM_STM32F4XX)\r | |
732 | # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2\r | |
733 | # define STM32_UART_CLOCK RCC_APB1Periph_USART2\r | |
734 | # define STM32_GPIO_PORT GPIOA\r | |
735 | # define STM32_GPIO_PIN GPIO_Pin_2\r | |
736 | # define STM32_GPIO_SOURCE GPIO_PinSource2\r | |
737 | # define STM32_UART_AF GPIO_AF_USART2\r | |
738 | # define STM32_UART_COM USART2\r | |
739 | # define STM32_UART_BAUD 115200 // 115200 Baud\r | |
740 | # include "stm32f4xx_usart.h"\r | |
741 | #elif defined(ARM_STM32F10X)\r | |
742 | # define STM32_UART_COM USART3 // UART3 on PB10\r | |
743 | #elif defined(LIBOPENCM3) //\r | |
744 | # include <libopencm3/stm32/usart.h>\r | |
745 | # define STM32_UART_COM USART2 // UART2 on PA2\r | |
746 | # define STM32_UART_GPIO_PORT GPIOA\r | |
747 | # define STM32_UART_GPIO_PIN GPIO2\r | |
748 | # define STM32_UART_COM_RCC RCC_USART2\r | |
749 | # define STM32_UART_GPIO_RCC RCC_GPIOA\r | |
750 | # define STM32_UART_BAUD 115200 // 115200 Baud\r | |
751 | #elif defined(ARDUINO) // Arduino Serial implementation\r | |
752 | # if defined(USB_SERIAL)\r | |
753 | # include "usb_serial.h"\r | |
754 | # else\r | |
755 | # error USB_SERIAL not defined in ARDUINO Environment\r | |
756 | # endif\r | |
757 | #else\r | |
758 | # if IRMP_EXT_LOGGING == 1 // use external logging\r | |
759 | # include "irmpextlog.h"\r | |
760 | # else // normal UART log (IRMP_EXT_LOGGING == 0)\r | |
761 | # define BAUD 9600L\r | |
762 | # ifndef UNIX_OR_WINDOWS\r | |
763 | # include <util/setbaud.h>\r | |
764 | # endif\r | |
765 | \r | |
766 | #ifdef UBRR0H\r | |
767 | \r | |
768 | #define UART0_UBRRH UBRR0H\r | |
769 | #define UART0_UBRRL UBRR0L\r | |
770 | #define UART0_UCSRA UCSR0A\r | |
771 | #define UART0_UCSRB UCSR0B\r | |
772 | #define UART0_UCSRC UCSR0C\r | |
773 | #define UART0_UDRE_BIT_VALUE (1<<UDRE0)\r | |
774 | #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)\r | |
775 | #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)\r | |
776 | #ifdef URSEL0\r | |
777 | #define UART0_URSEL_BIT_VALUE (1<<URSEL0)\r | |
778 | #else\r | |
779 | #define UART0_URSEL_BIT_VALUE (0)\r | |
780 | #endif\r | |
781 | #define UART0_TXEN_BIT_VALUE (1<<TXEN0)\r | |
782 | #define UART0_UDR UDR0\r | |
783 | #define UART0_U2X U2X0\r | |
784 | \r | |
785 | #else\r | |
786 | \r | |
787 | #define UART0_UBRRH UBRRH\r | |
788 | #define UART0_UBRRL UBRRL\r | |
789 | #define UART0_UCSRA UCSRA\r | |
790 | #define UART0_UCSRB UCSRB\r | |
791 | #define UART0_UCSRC UCSRC\r | |
792 | #define UART0_UDRE_BIT_VALUE (1<<UDRE)\r | |
793 | #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)\r | |
794 | #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)\r | |
795 | #ifdef URSEL\r | |
796 | #define UART0_URSEL_BIT_VALUE (1<<URSEL)\r | |
797 | #else\r | |
798 | #define UART0_URSEL_BIT_VALUE (0)\r | |
799 | #endif\r | |
800 | #define UART0_TXEN_BIT_VALUE (1<<TXEN)\r | |
801 | #define UART0_UDR UDR\r | |
802 | #define UART0_U2X U2X\r | |
803 | \r | |
804 | #endif //UBRR0H\r | |
805 | #endif //IRMP_EXT_LOGGING\r | |
806 | #endif //ARM_STM32F4XX\r | |
807 | \r | |
808 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
809 | * Initialize UART\r | |
810 | * @details Initializes UART\r | |
811 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
812 | */\r | |
813 | void\r | |
814 | irmp_uart_init (void)\r | |
815 | {\r | |
816 | #ifndef UNIX_OR_WINDOWS\r | |
817 | #if defined(ARM_STM32F4XX)\r | |
818 | GPIO_InitTypeDef GPIO_InitStructure;\r | |
819 | USART_InitTypeDef USART_InitStructure;\r | |
820 | \r | |
821 | // Clock enable vom TX Pin\r | |
822 | RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK, ENABLE);\r | |
823 | \r | |
824 | // Clock enable der UART\r | |
825 | RCC_APB1PeriphClockCmd(STM32_UART_CLOCK, ENABLE);\r | |
826 | \r | |
827 | // UART Alternative-Funktion mit dem IO-Pin verbinden\r | |
828 | GPIO_PinAFConfig(STM32_GPIO_PORT,STM32_GPIO_SOURCE,STM32_UART_AF);\r | |
829 | \r | |
830 | // UART als Alternative-Funktion mit PushPull\r | |
831 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;\r | |
832 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;\r | |
833 | GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r | |
834 | GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;\r | |
835 | \r | |
836 | // TX-Pin\r | |
837 | GPIO_InitStructure.GPIO_Pin = STM32_GPIO_PIN;\r | |
838 | GPIO_Init(STM32_GPIO_PORT, &GPIO_InitStructure);\r | |
839 | \r | |
840 | // Oversampling\r | |
841 | USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);\r | |
842 | \r | |
843 | // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS\r | |
844 | USART_InitStructure.USART_BaudRate = STM32_UART_BAUD;\r | |
845 | USART_InitStructure.USART_WordLength = USART_WordLength_8b;\r | |
846 | USART_InitStructure.USART_StopBits = USART_StopBits_1;\r | |
847 | USART_InitStructure.USART_Parity = USART_Parity_No;\r | |
848 | USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;\r | |
849 | USART_InitStructure.USART_Mode = USART_Mode_Tx;\r | |
850 | USART_Init(STM32_UART_COM, &USART_InitStructure);\r | |
851 | \r | |
852 | // UART enable\r | |
853 | USART_Cmd(STM32_UART_COM, ENABLE);\r | |
854 | \r | |
855 | #elif defined(ARM_STM32F10X)\r | |
856 | GPIO_InitTypeDef GPIO_InitStructure;\r | |
857 | USART_InitTypeDef USART_InitStructure;\r | |
858 | \r | |
859 | // Clock enable vom TX Pin\r | |
860 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); // UART3 an PB10\r | |
861 | \r | |
862 | // Clock enable der UART\r | |
863 | RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE);\r | |
864 | \r | |
865 | // UART als Alternative-Funktion mit PushPull\r | |
866 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;\r | |
867 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;\r | |
868 | \r | |
869 | // TX-Pin\r | |
870 | GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;\r | |
871 | GPIO_Init(GPIOB, &GPIO_InitStructure);\r | |
872 | \r | |
873 | // Oversampling\r | |
874 | USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);\r | |
875 | \r | |
876 | // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS\r | |
877 | USART_InitStructure.USART_BaudRate = 115200;\r | |
878 | USART_InitStructure.USART_WordLength = USART_WordLength_8b;\r | |
879 | USART_InitStructure.USART_StopBits = USART_StopBits_1;\r | |
880 | USART_InitStructure.USART_Parity = USART_Parity_No;\r | |
881 | USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;\r | |
882 | USART_InitStructure.USART_Mode = USART_Mode_Tx;\r | |
883 | USART_Init(STM32_UART_COM, &USART_InitStructure);\r | |
884 | \r | |
885 | // UART enable\r | |
886 | USART_Cmd(STM32_UART_COM, ENABLE);\r | |
887 | \r | |
888 | #elif defined(LIBOPENCM3)\r | |
889 | rcc_periph_clock_enable(STM32_UART_COM_RCC);\r | |
890 | /* Setup GPIO pin for USART TX */\r | |
891 | rcc_periph_clock_enable(STM32_UART_GPIO_RCC);\r | |
892 | gpio_set_mode(STM32_UART_GPIO_PORT, GPIO_MODE_OUTPUT_2_MHZ,\r | |
893 | GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, STM32_UART_GPIO_PIN);\r | |
894 | \r | |
895 | /* Setup UART parameters. */\r | |
896 | usart_set_baudrate(STM32_UART_COM, STM32_UART_BAUD);\r | |
897 | usart_set_databits(STM32_UART_COM, 8);\r | |
898 | usart_set_stopbits(STM32_UART_COM, USART_STOPBITS_1);\r | |
899 | usart_set_parity(STM32_UART_COM, USART_PARITY_NONE);\r | |
900 | usart_set_flow_control(STM32_UART_COM, USART_FLOWCONTROL_NONE);\r | |
901 | usart_set_mode(STM32_UART_COM, USART_MODE_TX_RX);\r | |
902 | /* Finally enable the USART. */\r | |
903 | usart_enable(STM32_UART_COM);\r | |
904 | \r | |
905 | #elif defined(ARDUINO)\r | |
906 | // we use the Arduino Serial Imlementation\r | |
907 | // you have to call Serial.begin(SER_BAUD); in Arduino setup() function\r | |
908 | \r | |
909 | #elif defined (__AVR_XMEGA__)\r | |
910 | \r | |
911 | PMIC.CTRL |= PMIC_HILVLEN_bm;\r | |
912 | \r | |
913 | USARTC1.BAUDCTRLB = 0;\r | |
914 | USARTC1.BAUDCTRLA = F_CPU / 153600 - 1;\r | |
915 | USARTC1.CTRLA = USART_RXCINTLVL_HI_gc; // high INT level (receive)\r | |
916 | USARTC1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; // activated RX and TX\r | |
917 | USARTC1.CTRLC = USART_CHSIZE_8BIT_gc; // 8 Bit\r | |
918 | PORTC.DIR |= (1<<7); // TXD is output\r | |
919 | PORTC.DIR &= ~(1<<6);\r | |
920 | \r | |
921 | #else\r | |
922 | \r | |
923 | #if (IRMP_EXT_LOGGING == 0) // use UART\r | |
924 | UART0_UBRRH = UBRRH_VALUE; // set baud rate\r | |
925 | UART0_UBRRL = UBRRL_VALUE;\r | |
926 | \r | |
927 | #if USE_2X\r | |
928 | UART0_UCSRA |= (1<<UART0_U2X);\r | |
929 | #else\r | |
930 | UART0_UCSRA &= ~(1<<UART0_U2X);\r | |
931 | #endif\r | |
932 | \r | |
933 | UART0_UCSRC = UART0_UCSZ1_BIT_VALUE | UART0_UCSZ0_BIT_VALUE | UART0_URSEL_BIT_VALUE;\r | |
934 | UART0_UCSRB |= UART0_TXEN_BIT_VALUE; // enable UART TX\r | |
935 | #else // other log method\r | |
936 | initextlog();\r | |
937 | #endif //IRMP_EXT_LOGGING\r | |
938 | #endif //ARM_STM32F4XX\r | |
939 | #endif // UNIX_OR_WINDOWS\r | |
940 | }\r | |
941 | \r | |
942 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
943 | * Send character\r | |
944 | * @details Sends character\r | |
945 | * @param ch character to be transmitted\r | |
946 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
947 | */\r | |
948 | void\r | |
949 | irmp_uart_putc (unsigned char ch)\r | |
950 | {\r | |
951 | #ifndef UNIX_OR_WINDOWS\r | |
952 | #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)\r | |
953 | // warten bis altes Byte gesendet wurde\r | |
954 | while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET)\r | |
955 | {\r | |
956 | ;\r | |
957 | }\r | |
958 | \r | |
959 | USART_SendData(STM32_UART_COM, ch);\r | |
960 | \r | |
961 | if (ch == '\n')\r | |
962 | {\r | |
963 | while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET);\r | |
964 | USART_SendData(STM32_UART_COM, '\r');\r | |
965 | }\r | |
966 | \r | |
967 | #elif defined(LIBOPENCM3)\r | |
968 | if (ch == '\n') {\r | |
969 | usart_send_blocking(STM32_UART_COM, '\r');\r | |
970 | }\r | |
971 | usart_send_blocking(STM32_UART_COM, ch);\r | |
972 | \r | |
973 | #elif defined(ARDUINO)\r | |
974 | // we use the Arduino Serial Imlementation\r | |
975 | usb_serial_putchar(ch);\r | |
976 | \r | |
977 | #else\r | |
978 | #if (IRMP_EXT_LOGGING == 0)\r | |
979 | \r | |
980 | # if defined (__AVR_XMEGA__)\r | |
981 | while (!(USARTC1.STATUS & USART_DREIF_bm))\r | |
982 | {\r | |
983 | ;\r | |
984 | }\r | |
985 | \r | |
986 | USARTC1.DATA = ch;\r | |
987 | \r | |
988 | # else // AVR_MEGA\r | |
989 | while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))\r | |
990 | {\r | |
991 | ;\r | |
992 | }\r | |
993 | \r | |
994 | UART0_UDR = ch;\r | |
995 | \r | |
996 | # endif // __AVR_XMEGA__\r | |
997 | \r | |
998 | #else\r | |
999 | \r | |
1000 | sendextlog(ch); // use external log\r | |
1001 | \r | |
1002 | #endif // IRMP_EXT_LOGGING\r | |
1003 | #endif // ARM_STM32F4XX\r | |
1004 | #else\r | |
1005 | fputc (ch, stderr);\r | |
1006 | #endif // UNIX_OR_WINDOWS\r | |
1007 | }\r | |
1008 | \r | |
1009 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
1010 | * Log IR signal\r | |
1011 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
1012 | */\r | |
1013 | \r | |
1014 | #define STARTCYCLES 2 // min count of zeros before start of logging\r | |
1015 | #define ENDBITS 1000 // number of sequenced highbits to detect end\r | |
1016 | #define DATALEN 700 // log buffer size\r | |
1017 | \r | |
1018 | static void\r | |
1019 | irmp_log (uint_fast8_t val)\r | |
1020 | {\r | |
1021 | static uint8_t buf[DATALEN]; // logging buffer\r | |
1022 | static uint_fast16_t buf_idx; // index\r | |
1023 | static uint_fast8_t startcycles; // current number of start-zeros\r | |
1024 | static uint_fast16_t cnt; // counts sequenced highbits - to detect end\r | |
1025 | static uint_fast8_t last_val = 1;\r | |
1026 | \r | |
1027 | if (! val && (startcycles < STARTCYCLES) && !buf_idx) // prevent that single random zeros init logging\r | |
1028 | {\r | |
1029 | startcycles++;\r | |
1030 | }\r | |
1031 | else\r | |
1032 | {\r | |
1033 | startcycles = 0;\r | |
1034 | \r | |
1035 | if (! val || buf_idx != 0) // start or continue logging on "0", "1" cannot init logging\r | |
1036 | {\r | |
1037 | if (last_val == val)\r | |
1038 | {\r | |
1039 | cnt++;\r | |
1040 | \r | |
1041 | if (val && cnt > ENDBITS) // if high received then look at log-stop condition\r | |
1042 | { // if stop condition is true, output on uart\r | |
1043 | uint_fast8_t i8;\r | |
1044 | uint_fast16_t i;\r | |
1045 | uint_fast16_t j;\r | |
1046 | uint_fast8_t v = '1';\r | |
1047 | uint_fast16_t d;\r | |
1048 | \r | |
1049 | for (i8 = 0; i8 < STARTCYCLES; i8++)\r | |
1050 | {\r | |
1051 | irmp_uart_putc ('0'); // the ignored starting zeros\r | |
1052 | }\r | |
1053 | \r | |
1054 | for (i = 0; i < buf_idx; i++)\r | |
1055 | {\r | |
1056 | d = buf[i];\r | |
1057 | \r | |
1058 | if (d == 0xff)\r | |
1059 | {\r | |
1060 | i++;\r | |
1061 | d = buf[i];\r | |
1062 | i++;\r | |
1063 | d |= ((uint_fast16_t) buf[i] << 8);\r | |
1064 | }\r | |
1065 | \r | |
1066 | for (j = 0; j < d; j++)\r | |
1067 | {\r | |
1068 | irmp_uart_putc (v);\r | |
1069 | }\r | |
1070 | \r | |
1071 | v = (v == '1') ? '0' : '1';\r | |
1072 | }\r | |
1073 | \r | |
1074 | for (i8 = 0; i8 < 20; i8++)\r | |
1075 | {\r | |
1076 | irmp_uart_putc ('1');\r | |
1077 | }\r | |
1078 | \r | |
1079 | irmp_uart_putc ('\n');\r | |
1080 | buf_idx = 0;\r | |
1081 | last_val = 1;\r | |
1082 | cnt = 0;\r | |
1083 | }\r | |
1084 | }\r | |
1085 | else if (buf_idx < DATALEN - 3)\r | |
1086 | {\r | |
1087 | if (cnt >= 0xff)\r | |
1088 | {\r | |
1089 | buf[buf_idx++] = 0xff;\r | |
1090 | buf[buf_idx++] = (cnt & 0xff);\r | |
1091 | buf[buf_idx] = (cnt >> 8);\r | |
1092 | }\r | |
1093 | else\r | |
1094 | {\r | |
1095 | buf[buf_idx] = cnt;\r | |
1096 | }\r | |
1097 | \r | |
1098 | buf_idx++;\r | |
1099 | cnt = 1;\r | |
1100 | last_val = val;\r | |
1101 | }\r | |
1102 | }\r | |
1103 | }\r | |
1104 | }\r | |
1105 | \r | |
1106 | #else\r | |
1107 | #define irmp_log(val)\r | |
1108 | #endif //IRMP_LOGGING\r | |
1109 | \r | |
1110 | typedef struct\r | |
1111 | {\r | |
1112 | uint_fast8_t protocol; // ir protocol\r | |
1113 | uint_fast8_t pulse_1_len_min; // minimum length of pulse with bit value 1\r | |
1114 | uint_fast8_t pulse_1_len_max; // maximum length of pulse with bit value 1\r | |
1115 | uint_fast8_t pause_1_len_min; // minimum length of pause with bit value 1\r | |
1116 | uint_fast8_t pause_1_len_max; // maximum length of pause with bit value 1\r | |
1117 | uint_fast8_t pulse_0_len_min; // minimum length of pulse with bit value 0\r | |
1118 | uint_fast8_t pulse_0_len_max; // maximum length of pulse with bit value 0\r | |
1119 | uint_fast8_t pause_0_len_min; // minimum length of pause with bit value 0\r | |
1120 | uint_fast8_t pause_0_len_max; // maximum length of pause with bit value 0\r | |
1121 | uint_fast8_t address_offset; // address offset\r | |
1122 | uint_fast8_t address_end; // end of address\r | |
1123 | uint_fast8_t command_offset; // command offset\r | |
1124 | uint_fast8_t command_end; // end of command\r | |
1125 | uint_fast8_t complete_len; // complete length of frame\r | |
1126 | uint_fast8_t stop_bit; // flag: frame has stop bit\r | |
1127 | uint_fast8_t lsb_first; // flag: LSB first\r | |
1128 | uint_fast8_t flags; // some flags\r | |
1129 | } IRMP_PARAMETER;\r | |
1130 | \r | |
1131 | #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r | |
1132 | \r | |
1133 | static const PROGMEM IRMP_PARAMETER sircs_param =\r | |
1134 | {\r | |
1135 | IRMP_SIRCS_PROTOCOL, // protocol: ir protocol\r | |
1136 | SIRCS_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1137 | SIRCS_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1138 | SIRCS_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1139 | SIRCS_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1140 | SIRCS_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1141 | SIRCS_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1142 | SIRCS_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1143 | SIRCS_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1144 | SIRCS_ADDRESS_OFFSET, // address_offset: address offset\r | |
1145 | SIRCS_ADDRESS_OFFSET + SIRCS_ADDRESS_LEN, // address_end: end of address\r | |
1146 | SIRCS_COMMAND_OFFSET, // command_offset: command offset\r | |
1147 | SIRCS_COMMAND_OFFSET + SIRCS_COMMAND_LEN, // command_end: end of command\r | |
1148 | SIRCS_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1149 | SIRCS_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1150 | SIRCS_LSB, // lsb_first: flag: LSB first\r | |
1151 | SIRCS_FLAGS // flags: some flags\r | |
1152 | };\r | |
1153 | \r | |
1154 | #endif\r | |
1155 | \r | |
1156 | #if IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
1157 | \r | |
1158 | static const PROGMEM IRMP_PARAMETER nec_param =\r | |
1159 | {\r | |
1160 | IRMP_NEC_PROTOCOL, // protocol: ir protocol\r | |
1161 | NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1162 | NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1163 | NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1164 | NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1165 | NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1166 | NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1167 | NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1168 | NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1169 | NEC_ADDRESS_OFFSET, // address_offset: address offset\r | |
1170 | NEC_ADDRESS_OFFSET + NEC_ADDRESS_LEN, // address_end: end of address\r | |
1171 | NEC_COMMAND_OFFSET, // command_offset: command offset\r | |
1172 | NEC_COMMAND_OFFSET + NEC_COMMAND_LEN, // command_end: end of command\r | |
1173 | NEC_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1174 | NEC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1175 | NEC_LSB, // lsb_first: flag: LSB first\r | |
1176 | NEC_FLAGS // flags: some flags\r | |
1177 | };\r | |
1178 | \r | |
1179 | static const PROGMEM IRMP_PARAMETER nec_rep_param =\r | |
1180 | {\r | |
1181 | IRMP_NEC_PROTOCOL, // protocol: ir protocol\r | |
1182 | NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1183 | NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1184 | NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1185 | NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1186 | NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1187 | NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1188 | NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1189 | NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1190 | 0, // address_offset: address offset\r | |
1191 | 0, // address_end: end of address\r | |
1192 | 0, // command_offset: command offset\r | |
1193 | 0, // command_end: end of command\r | |
1194 | 0, // complete_len: complete length of frame\r | |
1195 | NEC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1196 | NEC_LSB, // lsb_first: flag: LSB first\r | |
1197 | NEC_FLAGS // flags: some flags\r | |
1198 | };\r | |
1199 | \r | |
1200 | #endif\r | |
1201 | \r | |
1202 | #if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r | |
1203 | \r | |
1204 | static const PROGMEM IRMP_PARAMETER nec42_param =\r | |
1205 | {\r | |
1206 | IRMP_NEC42_PROTOCOL, // protocol: ir protocol\r | |
1207 | NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1208 | NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1209 | NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1210 | NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1211 | NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1212 | NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1213 | NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1214 | NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1215 | NEC42_ADDRESS_OFFSET, // address_offset: address offset\r | |
1216 | NEC42_ADDRESS_OFFSET + NEC42_ADDRESS_LEN, // address_end: end of address\r | |
1217 | NEC42_COMMAND_OFFSET, // command_offset: command offset\r | |
1218 | NEC42_COMMAND_OFFSET + NEC42_COMMAND_LEN, // command_end: end of command\r | |
1219 | NEC42_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1220 | NEC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1221 | NEC_LSB, // lsb_first: flag: LSB first\r | |
1222 | NEC_FLAGS // flags: some flags\r | |
1223 | };\r | |
1224 | \r | |
1225 | #endif\r | |
1226 | \r | |
1227 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r | |
1228 | \r | |
1229 | static const PROGMEM IRMP_PARAMETER lgair_param =\r | |
1230 | {\r | |
1231 | IRMP_LGAIR_PROTOCOL, // protocol: ir protocol\r | |
1232 | NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1233 | NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1234 | NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1235 | NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1236 | NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1237 | NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1238 | NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1239 | NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1240 | LGAIR_ADDRESS_OFFSET, // address_offset: address offset\r | |
1241 | LGAIR_ADDRESS_OFFSET + LGAIR_ADDRESS_LEN, // address_end: end of address\r | |
1242 | LGAIR_COMMAND_OFFSET, // command_offset: command offset\r | |
1243 | LGAIR_COMMAND_OFFSET + LGAIR_COMMAND_LEN, // command_end: end of command\r | |
1244 | LGAIR_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1245 | NEC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1246 | NEC_LSB, // lsb_first: flag: LSB first\r | |
1247 | NEC_FLAGS // flags: some flags\r | |
1248 | };\r | |
1249 | \r | |
1250 | #endif\r | |
1251 | \r | |
1252 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
1253 | \r | |
1254 | static const PROGMEM IRMP_PARAMETER samsung_param =\r | |
1255 | {\r | |
1256 | IRMP_SAMSUNG_PROTOCOL, // protocol: ir protocol\r | |
1257 | SAMSUNG_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1258 | SAMSUNG_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1259 | SAMSUNG_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1260 | SAMSUNG_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1261 | SAMSUNG_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1262 | SAMSUNG_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1263 | SAMSUNG_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1264 | SAMSUNG_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1265 | SAMSUNG_ADDRESS_OFFSET, // address_offset: address offset\r | |
1266 | SAMSUNG_ADDRESS_OFFSET + SAMSUNG_ADDRESS_LEN, // address_end: end of address\r | |
1267 | SAMSUNG_COMMAND_OFFSET, // command_offset: command offset\r | |
1268 | SAMSUNG_COMMAND_OFFSET + SAMSUNG_COMMAND_LEN, // command_end: end of command\r | |
1269 | SAMSUNG_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1270 | SAMSUNG_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1271 | SAMSUNG_LSB, // lsb_first: flag: LSB first\r | |
1272 | SAMSUNG_FLAGS // flags: some flags\r | |
1273 | };\r | |
1274 | \r | |
1275 | #endif\r | |
1276 | \r | |
1277 | #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1\r | |
1278 | \r | |
1279 | static const PROGMEM IRMP_PARAMETER samsungah_param =\r | |
1280 | {\r | |
1281 | IRMP_SAMSUNGAH_PROTOCOL, // protocol: ir protocol\r | |
1282 | SAMSUNGAH_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1283 | SAMSUNGAH_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1284 | SAMSUNGAH_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1285 | SAMSUNGAH_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1286 | SAMSUNGAH_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1287 | SAMSUNGAH_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1288 | SAMSUNGAH_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1289 | SAMSUNGAH_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1290 | SAMSUNGAH_ADDRESS_OFFSET, // address_offset: address offset\r | |
1291 | SAMSUNGAH_ADDRESS_OFFSET + SAMSUNGAH_ADDRESS_LEN, // address_end: end of address\r | |
1292 | SAMSUNGAH_COMMAND_OFFSET, // command_offset: command offset\r | |
1293 | SAMSUNGAH_COMMAND_OFFSET + SAMSUNGAH_COMMAND_LEN, // command_end: end of command\r | |
1294 | SAMSUNGAH_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1295 | SAMSUNGAH_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1296 | SAMSUNGAH_LSB, // lsb_first: flag: LSB first\r | |
1297 | SAMSUNGAH_FLAGS // flags: some flags\r | |
1298 | };\r | |
1299 | \r | |
1300 | #endif\r | |
1301 | \r | |
1302 | #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r | |
1303 | \r | |
1304 | static const PROGMEM IRMP_PARAMETER telefunken_param =\r | |
1305 | {\r | |
1306 | IRMP_TELEFUNKEN_PROTOCOL, // protocol: ir protocol\r | |
1307 | TELEFUNKEN_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1308 | TELEFUNKEN_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1309 | TELEFUNKEN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1310 | TELEFUNKEN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1311 | TELEFUNKEN_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1312 | TELEFUNKEN_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1313 | TELEFUNKEN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1314 | TELEFUNKEN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1315 | TELEFUNKEN_ADDRESS_OFFSET, // address_offset: address offset\r | |
1316 | TELEFUNKEN_ADDRESS_OFFSET + TELEFUNKEN_ADDRESS_LEN, // address_end: end of address\r | |
1317 | TELEFUNKEN_COMMAND_OFFSET, // command_offset: command offset\r | |
1318 | TELEFUNKEN_COMMAND_OFFSET + TELEFUNKEN_COMMAND_LEN, // command_end: end of command\r | |
1319 | TELEFUNKEN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1320 | TELEFUNKEN_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1321 | TELEFUNKEN_LSB, // lsb_first: flag: LSB first\r | |
1322 | TELEFUNKEN_FLAGS // flags: some flags\r | |
1323 | };\r | |
1324 | \r | |
1325 | #endif\r | |
1326 | \r | |
1327 | #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r | |
1328 | \r | |
1329 | static const PROGMEM IRMP_PARAMETER matsushita_param =\r | |
1330 | {\r | |
1331 | IRMP_MATSUSHITA_PROTOCOL, // protocol: ir protocol\r | |
1332 | MATSUSHITA_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1333 | MATSUSHITA_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1334 | MATSUSHITA_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1335 | MATSUSHITA_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1336 | MATSUSHITA_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1337 | MATSUSHITA_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1338 | MATSUSHITA_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1339 | MATSUSHITA_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1340 | MATSUSHITA_ADDRESS_OFFSET, // address_offset: address offset\r | |
1341 | MATSUSHITA_ADDRESS_OFFSET + MATSUSHITA_ADDRESS_LEN, // address_end: end of address\r | |
1342 | MATSUSHITA_COMMAND_OFFSET, // command_offset: command offset\r | |
1343 | MATSUSHITA_COMMAND_OFFSET + MATSUSHITA_COMMAND_LEN, // command_end: end of command\r | |
1344 | MATSUSHITA_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1345 | MATSUSHITA_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1346 | MATSUSHITA_LSB, // lsb_first: flag: LSB first\r | |
1347 | MATSUSHITA_FLAGS // flags: some flags\r | |
1348 | };\r | |
1349 | \r | |
1350 | #endif\r | |
1351 | \r | |
1352 | #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
1353 | \r | |
1354 | static const PROGMEM IRMP_PARAMETER kaseikyo_param =\r | |
1355 | {\r | |
1356 | IRMP_KASEIKYO_PROTOCOL, // protocol: ir protocol\r | |
1357 | KASEIKYO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1358 | KASEIKYO_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1359 | KASEIKYO_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1360 | KASEIKYO_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1361 | KASEIKYO_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1362 | KASEIKYO_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1363 | KASEIKYO_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1364 | KASEIKYO_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1365 | KASEIKYO_ADDRESS_OFFSET, // address_offset: address offset\r | |
1366 | KASEIKYO_ADDRESS_OFFSET + KASEIKYO_ADDRESS_LEN, // address_end: end of address\r | |
1367 | KASEIKYO_COMMAND_OFFSET, // command_offset: command offset\r | |
1368 | KASEIKYO_COMMAND_OFFSET + KASEIKYO_COMMAND_LEN, // command_end: end of command\r | |
1369 | KASEIKYO_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1370 | KASEIKYO_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1371 | KASEIKYO_LSB, // lsb_first: flag: LSB first\r | |
1372 | KASEIKYO_FLAGS // flags: some flags\r | |
1373 | };\r | |
1374 | \r | |
1375 | #endif\r | |
1376 | \r | |
1377 | #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r | |
1378 | \r | |
1379 | static const PROGMEM IRMP_PARAMETER panasonic_param =\r | |
1380 | {\r | |
1381 | IRMP_PANASONIC_PROTOCOL, // protocol: ir protocol\r | |
1382 | PANASONIC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1383 | PANASONIC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1384 | PANASONIC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1385 | PANASONIC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1386 | PANASONIC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1387 | PANASONIC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1388 | PANASONIC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1389 | PANASONIC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1390 | PANASONIC_ADDRESS_OFFSET, // address_offset: address offset\r | |
1391 | PANASONIC_ADDRESS_OFFSET + PANASONIC_ADDRESS_LEN, // address_end: end of address\r | |
1392 | PANASONIC_COMMAND_OFFSET, // command_offset: command offset\r | |
1393 | PANASONIC_COMMAND_OFFSET + PANASONIC_COMMAND_LEN, // command_end: end of command\r | |
1394 | PANASONIC_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1395 | PANASONIC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1396 | PANASONIC_LSB, // lsb_first: flag: LSB first\r | |
1397 | PANASONIC_FLAGS // flags: some flags\r | |
1398 | };\r | |
1399 | \r | |
1400 | #endif\r | |
1401 | \r | |
1402 | #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r | |
1403 | \r | |
1404 | static const PROGMEM IRMP_PARAMETER mitsu_heavy_param =\r | |
1405 | {\r | |
1406 | IRMP_MITSU_HEAVY_PROTOCOL, // protocol: ir protocol\r | |
1407 | MITSU_HEAVY_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1408 | MITSU_HEAVY_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1409 | MITSU_HEAVY_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1410 | MITSU_HEAVY_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1411 | MITSU_HEAVY_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1412 | MITSU_HEAVY_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1413 | MITSU_HEAVY_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1414 | MITSU_HEAVY_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1415 | MITSU_HEAVY_ADDRESS_OFFSET, // address_offset: address offset\r | |
1416 | MITSU_HEAVY_ADDRESS_OFFSET + MITSU_HEAVY_ADDRESS_LEN, // address_end: end of address\r | |
1417 | MITSU_HEAVY_COMMAND_OFFSET, // command_offset: command offset\r | |
1418 | MITSU_HEAVY_COMMAND_OFFSET + MITSU_HEAVY_COMMAND_LEN, // command_end: end of command\r | |
1419 | MITSU_HEAVY_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1420 | MITSU_HEAVY_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1421 | MITSU_HEAVY_LSB, // lsb_first: flag: LSB first\r | |
1422 | MITSU_HEAVY_FLAGS // flags: some flags\r | |
1423 | };\r | |
1424 | \r | |
1425 | #endif\r | |
1426 | \r | |
1427 | #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r | |
1428 | \r | |
1429 | static const PROGMEM IRMP_PARAMETER vincent_param =\r | |
1430 | {\r | |
1431 | IRMP_VINCENT_PROTOCOL, // protocol: ir protocol\r | |
1432 | VINCENT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1433 | VINCENT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1434 | VINCENT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1435 | VINCENT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1436 | VINCENT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1437 | VINCENT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1438 | VINCENT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1439 | VINCENT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1440 | VINCENT_ADDRESS_OFFSET, // address_offset: address offset\r | |
1441 | VINCENT_ADDRESS_OFFSET + VINCENT_ADDRESS_LEN, // address_end: end of address\r | |
1442 | VINCENT_COMMAND_OFFSET, // command_offset: command offset\r | |
1443 | VINCENT_COMMAND_OFFSET + VINCENT_COMMAND_LEN, // command_end: end of command\r | |
1444 | VINCENT_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1445 | VINCENT_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1446 | VINCENT_LSB, // lsb_first: flag: LSB first\r | |
1447 | VINCENT_FLAGS // flags: some flags\r | |
1448 | };\r | |
1449 | \r | |
1450 | #endif\r | |
1451 | \r | |
1452 | #if IRMP_SUPPORT_RECS80_PROTOCOL == 1\r | |
1453 | \r | |
1454 | static const PROGMEM IRMP_PARAMETER recs80_param =\r | |
1455 | {\r | |
1456 | IRMP_RECS80_PROTOCOL, // protocol: ir protocol\r | |
1457 | RECS80_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1458 | RECS80_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1459 | RECS80_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1460 | RECS80_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1461 | RECS80_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1462 | RECS80_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1463 | RECS80_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1464 | RECS80_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1465 | RECS80_ADDRESS_OFFSET, // address_offset: address offset\r | |
1466 | RECS80_ADDRESS_OFFSET + RECS80_ADDRESS_LEN, // address_end: end of address\r | |
1467 | RECS80_COMMAND_OFFSET, // command_offset: command offset\r | |
1468 | RECS80_COMMAND_OFFSET + RECS80_COMMAND_LEN, // command_end: end of command\r | |
1469 | RECS80_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1470 | RECS80_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1471 | RECS80_LSB, // lsb_first: flag: LSB first\r | |
1472 | RECS80_FLAGS // flags: some flags\r | |
1473 | };\r | |
1474 | \r | |
1475 | #endif\r | |
1476 | \r | |
1477 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1\r | |
1478 | \r | |
1479 | static const PROGMEM IRMP_PARAMETER rc5_param =\r | |
1480 | {\r | |
1481 | IRMP_RC5_PROTOCOL, // protocol: ir protocol\r | |
1482 | RC5_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1483 | RC5_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1484 | RC5_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1485 | RC5_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1486 | 0, // pulse_0_len_min: here: not used\r | |
1487 | 0, // pulse_0_len_max: here: not used\r | |
1488 | 0, // pause_0_len_min: here: not used\r | |
1489 | 0, // pause_0_len_max: here: not used\r | |
1490 | RC5_ADDRESS_OFFSET, // address_offset: address offset\r | |
1491 | RC5_ADDRESS_OFFSET + RC5_ADDRESS_LEN, // address_end: end of address\r | |
1492 | RC5_COMMAND_OFFSET, // command_offset: command offset\r | |
1493 | RC5_COMMAND_OFFSET + RC5_COMMAND_LEN, // command_end: end of command\r | |
1494 | RC5_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1495 | RC5_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1496 | RC5_LSB, // lsb_first: flag: LSB first\r | |
1497 | RC5_FLAGS // flags: some flags\r | |
1498 | };\r | |
1499 | \r | |
1500 | #endif\r | |
1501 | \r | |
1502 | #if IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
1503 | \r | |
1504 | static const PROGMEM IRMP_PARAMETER s100_param =\r | |
1505 | {\r | |
1506 | IRMP_S100_PROTOCOL, // protocol: ir protocol\r | |
1507 | S100_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1508 | S100_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1509 | S100_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1510 | S100_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1511 | 0, // pulse_0_len_min: here: not used\r | |
1512 | 0, // pulse_0_len_max: here: not used\r | |
1513 | 0, // pause_0_len_min: here: not used\r | |
1514 | 0, // pause_0_len_max: here: not used\r | |
1515 | S100_ADDRESS_OFFSET, // address_offset: address offset\r | |
1516 | S100_ADDRESS_OFFSET + S100_ADDRESS_LEN, // address_end: end of address\r | |
1517 | S100_COMMAND_OFFSET, // command_offset: command offset\r | |
1518 | S100_COMMAND_OFFSET + S100_COMMAND_LEN, // command_end: end of command\r | |
1519 | S100_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1520 | S100_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1521 | S100_LSB, // lsb_first: flag: LSB first\r | |
1522 | S100_FLAGS // flags: some flags\r | |
1523 | };\r | |
1524 | \r | |
1525 | #endif\r | |
1526 | \r | |
1527 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
1528 | \r | |
1529 | static const PROGMEM IRMP_PARAMETER denon_param =\r | |
1530 | {\r | |
1531 | IRMP_DENON_PROTOCOL, // protocol: ir protocol\r | |
1532 | DENON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1533 | DENON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1534 | DENON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1535 | DENON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1536 | DENON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1537 | DENON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1538 | DENON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1539 | DENON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1540 | DENON_ADDRESS_OFFSET, // address_offset: address offset\r | |
1541 | DENON_ADDRESS_OFFSET + DENON_ADDRESS_LEN, // address_end: end of address\r | |
1542 | DENON_COMMAND_OFFSET, // command_offset: command offset\r | |
1543 | DENON_COMMAND_OFFSET + DENON_COMMAND_LEN, // command_end: end of command\r | |
1544 | DENON_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1545 | DENON_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1546 | DENON_LSB, // lsb_first: flag: LSB first\r | |
1547 | DENON_FLAGS // flags: some flags\r | |
1548 | };\r | |
1549 | \r | |
1550 | #endif\r | |
1551 | \r | |
1552 | #if IRMP_SUPPORT_RC6_PROTOCOL == 1\r | |
1553 | \r | |
1554 | static const PROGMEM IRMP_PARAMETER rc6_param =\r | |
1555 | {\r | |
1556 | IRMP_RC6_PROTOCOL, // protocol: ir protocol\r | |
1557 | \r | |
1558 | RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1559 | RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1560 | RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1561 | RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1562 | 0, // pulse_0_len_min: here: not used\r | |
1563 | 0, // pulse_0_len_max: here: not used\r | |
1564 | 0, // pause_0_len_min: here: not used\r | |
1565 | 0, // pause_0_len_max: here: not used\r | |
1566 | RC6_ADDRESS_OFFSET, // address_offset: address offset\r | |
1567 | RC6_ADDRESS_OFFSET + RC6_ADDRESS_LEN, // address_end: end of address\r | |
1568 | RC6_COMMAND_OFFSET, // command_offset: command offset\r | |
1569 | RC6_COMMAND_OFFSET + RC6_COMMAND_LEN, // command_end: end of command\r | |
1570 | RC6_COMPLETE_DATA_LEN_SHORT, // complete_len: complete length of frame\r | |
1571 | RC6_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1572 | RC6_LSB, // lsb_first: flag: LSB first\r | |
1573 | RC6_FLAGS // flags: some flags\r | |
1574 | };\r | |
1575 | \r | |
1576 | #endif\r | |
1577 | \r | |
1578 | #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r | |
1579 | \r | |
1580 | static const PROGMEM IRMP_PARAMETER recs80ext_param =\r | |
1581 | {\r | |
1582 | IRMP_RECS80EXT_PROTOCOL, // protocol: ir protocol\r | |
1583 | RECS80EXT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1584 | RECS80EXT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1585 | RECS80EXT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1586 | RECS80EXT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1587 | RECS80EXT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1588 | RECS80EXT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1589 | RECS80EXT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1590 | RECS80EXT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1591 | RECS80EXT_ADDRESS_OFFSET, // address_offset: address offset\r | |
1592 | RECS80EXT_ADDRESS_OFFSET + RECS80EXT_ADDRESS_LEN, // address_end: end of address\r | |
1593 | RECS80EXT_COMMAND_OFFSET, // command_offset: command offset\r | |
1594 | RECS80EXT_COMMAND_OFFSET + RECS80EXT_COMMAND_LEN, // command_end: end of command\r | |
1595 | RECS80EXT_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1596 | RECS80EXT_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1597 | RECS80EXT_LSB, // lsb_first: flag: LSB first\r | |
1598 | RECS80EXT_FLAGS // flags: some flags\r | |
1599 | };\r | |
1600 | \r | |
1601 | #endif\r | |
1602 | \r | |
1603 | #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r | |
1604 | \r | |
1605 | static const PROGMEM IRMP_PARAMETER nubert_param =\r | |
1606 | {\r | |
1607 | IRMP_NUBERT_PROTOCOL, // protocol: ir protocol\r | |
1608 | NUBERT_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1609 | NUBERT_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1610 | NUBERT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1611 | NUBERT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1612 | NUBERT_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1613 | NUBERT_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1614 | NUBERT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1615 | NUBERT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1616 | NUBERT_ADDRESS_OFFSET, // address_offset: address offset\r | |
1617 | NUBERT_ADDRESS_OFFSET + NUBERT_ADDRESS_LEN, // address_end: end of address\r | |
1618 | NUBERT_COMMAND_OFFSET, // command_offset: command offset\r | |
1619 | NUBERT_COMMAND_OFFSET + NUBERT_COMMAND_LEN, // command_end: end of command\r | |
1620 | NUBERT_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1621 | NUBERT_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1622 | NUBERT_LSB, // lsb_first: flag: LSB first\r | |
1623 | NUBERT_FLAGS // flags: some flags\r | |
1624 | };\r | |
1625 | \r | |
1626 | #endif\r | |
1627 | \r | |
1628 | #if IRMP_SUPPORT_FAN_PROTOCOL == 1\r | |
1629 | \r | |
1630 | static const PROGMEM IRMP_PARAMETER fan_param =\r | |
1631 | {\r | |
1632 | IRMP_FAN_PROTOCOL, // protocol: ir protocol\r | |
1633 | FAN_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1634 | FAN_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1635 | FAN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1636 | FAN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1637 | FAN_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1638 | FAN_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1639 | FAN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1640 | FAN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1641 | FAN_ADDRESS_OFFSET, // address_offset: address offset\r | |
1642 | FAN_ADDRESS_OFFSET + FAN_ADDRESS_LEN, // address_end: end of address\r | |
1643 | FAN_COMMAND_OFFSET, // command_offset: command offset\r | |
1644 | FAN_COMMAND_OFFSET + FAN_COMMAND_LEN, // command_end: end of command\r | |
1645 | FAN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1646 | FAN_STOP_BIT, // stop_bit: flag: frame has NO stop bit\r | |
1647 | FAN_LSB, // lsb_first: flag: LSB first\r | |
1648 | FAN_FLAGS // flags: some flags\r | |
1649 | };\r | |
1650 | \r | |
1651 | #endif\r | |
1652 | \r | |
1653 | #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r | |
1654 | \r | |
1655 | static const PROGMEM IRMP_PARAMETER speaker_param =\r | |
1656 | {\r | |
1657 | IRMP_SPEAKER_PROTOCOL, // protocol: ir protocol\r | |
1658 | SPEAKER_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1659 | SPEAKER_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1660 | SPEAKER_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1661 | SPEAKER_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1662 | SPEAKER_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1663 | SPEAKER_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1664 | SPEAKER_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1665 | SPEAKER_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1666 | SPEAKER_ADDRESS_OFFSET, // address_offset: address offset\r | |
1667 | SPEAKER_ADDRESS_OFFSET + SPEAKER_ADDRESS_LEN, // address_end: end of address\r | |
1668 | SPEAKER_COMMAND_OFFSET, // command_offset: command offset\r | |
1669 | SPEAKER_COMMAND_OFFSET + SPEAKER_COMMAND_LEN, // command_end: end of command\r | |
1670 | SPEAKER_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1671 | SPEAKER_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1672 | SPEAKER_LSB, // lsb_first: flag: LSB first\r | |
1673 | SPEAKER_FLAGS // flags: some flags\r | |
1674 | };\r | |
1675 | \r | |
1676 | #endif\r | |
1677 | \r | |
1678 | #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r | |
1679 | \r | |
1680 | static const PROGMEM IRMP_PARAMETER bang_olufsen_param =\r | |
1681 | {\r | |
1682 | IRMP_BANG_OLUFSEN_PROTOCOL, // protocol: ir protocol\r | |
1683 | BANG_OLUFSEN_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1684 | BANG_OLUFSEN_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1685 | BANG_OLUFSEN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1686 | BANG_OLUFSEN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1687 | BANG_OLUFSEN_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1688 | BANG_OLUFSEN_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1689 | BANG_OLUFSEN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1690 | BANG_OLUFSEN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1691 | BANG_OLUFSEN_ADDRESS_OFFSET, // address_offset: address offset\r | |
1692 | BANG_OLUFSEN_ADDRESS_OFFSET + BANG_OLUFSEN_ADDRESS_LEN, // address_end: end of address\r | |
1693 | BANG_OLUFSEN_COMMAND_OFFSET, // command_offset: command offset\r | |
1694 | BANG_OLUFSEN_COMMAND_OFFSET + BANG_OLUFSEN_COMMAND_LEN, // command_end: end of command\r | |
1695 | BANG_OLUFSEN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1696 | BANG_OLUFSEN_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1697 | BANG_OLUFSEN_LSB, // lsb_first: flag: LSB first\r | |
1698 | BANG_OLUFSEN_FLAGS // flags: some flags\r | |
1699 | };\r | |
1700 | \r | |
1701 | #endif\r | |
1702 | \r | |
1703 | #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r | |
1704 | \r | |
1705 | static uint_fast8_t first_bit;\r | |
1706 | \r | |
1707 | static const PROGMEM IRMP_PARAMETER grundig_param =\r | |
1708 | {\r | |
1709 | IRMP_GRUNDIG_PROTOCOL, // protocol: ir protocol\r | |
1710 | \r | |
1711 | GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1712 | GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1713 | GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1714 | GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1715 | 0, // pulse_0_len_min: here: not used\r | |
1716 | 0, // pulse_0_len_max: here: not used\r | |
1717 | 0, // pause_0_len_min: here: not used\r | |
1718 | 0, // pause_0_len_max: here: not used\r | |
1719 | GRUNDIG_ADDRESS_OFFSET, // address_offset: address offset\r | |
1720 | GRUNDIG_ADDRESS_OFFSET + GRUNDIG_ADDRESS_LEN, // address_end: end of address\r | |
1721 | GRUNDIG_COMMAND_OFFSET, // command_offset: command offset\r | |
1722 | GRUNDIG_COMMAND_OFFSET + GRUNDIG_COMMAND_LEN + 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)\r | |
1723 | NOKIA_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!\r | |
1724 | GRUNDIG_NOKIA_IR60_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1725 | GRUNDIG_NOKIA_IR60_LSB, // lsb_first: flag: LSB first\r | |
1726 | GRUNDIG_NOKIA_IR60_FLAGS // flags: some flags\r | |
1727 | };\r | |
1728 | \r | |
1729 | #endif\r | |
1730 | \r | |
1731 | #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r | |
1732 | \r | |
1733 | static const PROGMEM IRMP_PARAMETER ruwido_param =\r | |
1734 | {\r | |
1735 | IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol\r | |
1736 | SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1737 | SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1738 | SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1739 | SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1740 | 0, // pulse_0_len_min: here: not used\r | |
1741 | 0, // pulse_0_len_max: here: not used\r | |
1742 | 0, // pause_0_len_min: here: not used\r | |
1743 | 0, // pause_0_len_max: here: not used\r | |
1744 | RUWIDO_ADDRESS_OFFSET, // address_offset: address offset\r | |
1745 | RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address\r | |
1746 | RUWIDO_COMMAND_OFFSET, // command_offset: command offset\r | |
1747 | RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command\r | |
1748 | SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!\r | |
1749 | SIEMENS_OR_RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1750 | SIEMENS_OR_RUWIDO_LSB, // lsb_first: flag: LSB first\r | |
1751 | SIEMENS_OR_RUWIDO_FLAGS // flags: some flags\r | |
1752 | };\r | |
1753 | \r | |
1754 | #endif\r | |
1755 | \r | |
1756 | #if IRMP_SUPPORT_FDC_PROTOCOL == 1\r | |
1757 | \r | |
1758 | static const PROGMEM IRMP_PARAMETER fdc_param =\r | |
1759 | {\r | |
1760 | IRMP_FDC_PROTOCOL, // protocol: ir protocol\r | |
1761 | FDC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1762 | FDC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1763 | FDC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1764 | FDC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1765 | FDC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1766 | FDC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1767 | FDC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1768 | FDC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1769 | FDC_ADDRESS_OFFSET, // address_offset: address offset\r | |
1770 | FDC_ADDRESS_OFFSET + FDC_ADDRESS_LEN, // address_end: end of address\r | |
1771 | FDC_COMMAND_OFFSET, // command_offset: command offset\r | |
1772 | FDC_COMMAND_OFFSET + FDC_COMMAND_LEN, // command_end: end of command\r | |
1773 | FDC_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1774 | FDC_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1775 | FDC_LSB, // lsb_first: flag: LSB first\r | |
1776 | FDC_FLAGS // flags: some flags\r | |
1777 | };\r | |
1778 | \r | |
1779 | #endif\r | |
1780 | \r | |
1781 | #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
1782 | \r | |
1783 | static const PROGMEM IRMP_PARAMETER rccar_param =\r | |
1784 | {\r | |
1785 | IRMP_RCCAR_PROTOCOL, // protocol: ir protocol\r | |
1786 | RCCAR_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1787 | RCCAR_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1788 | RCCAR_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1789 | RCCAR_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1790 | RCCAR_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1791 | RCCAR_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1792 | RCCAR_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1793 | RCCAR_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1794 | RCCAR_ADDRESS_OFFSET, // address_offset: address offset\r | |
1795 | RCCAR_ADDRESS_OFFSET + RCCAR_ADDRESS_LEN, // address_end: end of address\r | |
1796 | RCCAR_COMMAND_OFFSET, // command_offset: command offset\r | |
1797 | RCCAR_COMMAND_OFFSET + RCCAR_COMMAND_LEN, // command_end: end of command\r | |
1798 | RCCAR_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1799 | RCCAR_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1800 | RCCAR_LSB, // lsb_first: flag: LSB first\r | |
1801 | RCCAR_FLAGS // flags: some flags\r | |
1802 | };\r | |
1803 | \r | |
1804 | #endif\r | |
1805 | \r | |
1806 | #if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r | |
1807 | \r | |
1808 | static const PROGMEM IRMP_PARAMETER nikon_param =\r | |
1809 | {\r | |
1810 | IRMP_NIKON_PROTOCOL, // protocol: ir protocol\r | |
1811 | NIKON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1812 | NIKON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1813 | NIKON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1814 | NIKON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1815 | NIKON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1816 | NIKON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1817 | NIKON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1818 | NIKON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1819 | NIKON_ADDRESS_OFFSET, // address_offset: address offset\r | |
1820 | NIKON_ADDRESS_OFFSET + NIKON_ADDRESS_LEN, // address_end: end of address\r | |
1821 | NIKON_COMMAND_OFFSET, // command_offset: command offset\r | |
1822 | NIKON_COMMAND_OFFSET + NIKON_COMMAND_LEN, // command_end: end of command\r | |
1823 | NIKON_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1824 | NIKON_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1825 | NIKON_LSB, // lsb_first: flag: LSB first\r | |
1826 | NIKON_FLAGS // flags: some flags\r | |
1827 | };\r | |
1828 | \r | |
1829 | #endif\r | |
1830 | \r | |
1831 | #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r | |
1832 | \r | |
1833 | static const PROGMEM IRMP_PARAMETER kathrein_param =\r | |
1834 | {\r | |
1835 | IRMP_KATHREIN_PROTOCOL, // protocol: ir protocol\r | |
1836 | KATHREIN_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1837 | KATHREIN_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1838 | KATHREIN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1839 | KATHREIN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1840 | KATHREIN_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1841 | KATHREIN_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1842 | KATHREIN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1843 | KATHREIN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1844 | KATHREIN_ADDRESS_OFFSET, // address_offset: address offset\r | |
1845 | KATHREIN_ADDRESS_OFFSET + KATHREIN_ADDRESS_LEN, // address_end: end of address\r | |
1846 | KATHREIN_COMMAND_OFFSET, // command_offset: command offset\r | |
1847 | KATHREIN_COMMAND_OFFSET + KATHREIN_COMMAND_LEN, // command_end: end of command\r | |
1848 | KATHREIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1849 | KATHREIN_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1850 | KATHREIN_LSB, // lsb_first: flag: LSB first\r | |
1851 | KATHREIN_FLAGS // flags: some flags\r | |
1852 | };\r | |
1853 | \r | |
1854 | #endif\r | |
1855 | \r | |
1856 | #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
1857 | \r | |
1858 | static const PROGMEM IRMP_PARAMETER netbox_param =\r | |
1859 | {\r | |
1860 | IRMP_NETBOX_PROTOCOL, // protocol: ir protocol\r | |
1861 | NETBOX_PULSE_LEN, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value\r | |
1862 | NETBOX_PULSE_REST_LEN, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value\r | |
1863 | NETBOX_PAUSE_LEN, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value\r | |
1864 | NETBOX_PAUSE_REST_LEN, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value\r | |
1865 | NETBOX_PULSE_LEN, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value\r | |
1866 | NETBOX_PULSE_REST_LEN, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value\r | |
1867 | NETBOX_PAUSE_LEN, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value\r | |
1868 | NETBOX_PAUSE_REST_LEN, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value\r | |
1869 | NETBOX_ADDRESS_OFFSET, // address_offset: address offset\r | |
1870 | NETBOX_ADDRESS_OFFSET + NETBOX_ADDRESS_LEN, // address_end: end of address\r | |
1871 | NETBOX_COMMAND_OFFSET, // command_offset: command offset\r | |
1872 | NETBOX_COMMAND_OFFSET + NETBOX_COMMAND_LEN, // command_end: end of command\r | |
1873 | NETBOX_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1874 | NETBOX_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1875 | NETBOX_LSB, // lsb_first: flag: LSB first\r | |
1876 | NETBOX_FLAGS // flags: some flags\r | |
1877 | };\r | |
1878 | \r | |
1879 | #endif\r | |
1880 | \r | |
1881 | #if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r | |
1882 | \r | |
1883 | static const PROGMEM IRMP_PARAMETER lego_param =\r | |
1884 | {\r | |
1885 | IRMP_LEGO_PROTOCOL, // protocol: ir protocol\r | |
1886 | LEGO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1887 | LEGO_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1888 | LEGO_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1889 | LEGO_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1890 | LEGO_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1891 | LEGO_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1892 | LEGO_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1893 | LEGO_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1894 | LEGO_ADDRESS_OFFSET, // address_offset: address offset\r | |
1895 | LEGO_ADDRESS_OFFSET + LEGO_ADDRESS_LEN, // address_end: end of address\r | |
1896 | LEGO_COMMAND_OFFSET, // command_offset: command offset\r | |
1897 | LEGO_COMMAND_OFFSET + LEGO_COMMAND_LEN, // command_end: end of command\r | |
1898 | LEGO_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1899 | LEGO_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1900 | LEGO_LSB, // lsb_first: flag: LSB first\r | |
1901 | LEGO_FLAGS // flags: some flags\r | |
1902 | };\r | |
1903 | \r | |
1904 | #endif\r | |
1905 | \r | |
1906 | #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r | |
1907 | \r | |
1908 | static const PROGMEM IRMP_PARAMETER thomson_param =\r | |
1909 | {\r | |
1910 | IRMP_THOMSON_PROTOCOL, // protocol: ir protocol\r | |
1911 | THOMSON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1912 | THOMSON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1913 | THOMSON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1914 | THOMSON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1915 | THOMSON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1916 | THOMSON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1917 | THOMSON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1918 | THOMSON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1919 | THOMSON_ADDRESS_OFFSET, // address_offset: address offset\r | |
1920 | THOMSON_ADDRESS_OFFSET + THOMSON_ADDRESS_LEN, // address_end: end of address\r | |
1921 | THOMSON_COMMAND_OFFSET, // command_offset: command offset\r | |
1922 | THOMSON_COMMAND_OFFSET + THOMSON_COMMAND_LEN, // command_end: end of command\r | |
1923 | THOMSON_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1924 | THOMSON_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1925 | THOMSON_LSB, // lsb_first: flag: LSB first\r | |
1926 | THOMSON_FLAGS // flags: some flags\r | |
1927 | };\r | |
1928 | \r | |
1929 | #endif\r | |
1930 | \r | |
1931 | #if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r | |
1932 | \r | |
1933 | static const PROGMEM IRMP_PARAMETER bose_param =\r | |
1934 | {\r | |
1935 | IRMP_BOSE_PROTOCOL, // protocol: ir protocol\r | |
1936 | BOSE_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
1937 | BOSE_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
1938 | BOSE_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
1939 | BOSE_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
1940 | BOSE_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
1941 | BOSE_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
1942 | BOSE_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
1943 | BOSE_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
1944 | BOSE_ADDRESS_OFFSET, // address_offset: address offset\r | |
1945 | BOSE_ADDRESS_OFFSET + BOSE_ADDRESS_LEN, // address_end: end of address\r | |
1946 | BOSE_COMMAND_OFFSET, // command_offset: command offset\r | |
1947 | BOSE_COMMAND_OFFSET + BOSE_COMMAND_LEN, // command_end: end of command\r | |
1948 | BOSE_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1949 | BOSE_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1950 | BOSE_LSB, // lsb_first: flag: LSB first\r | |
1951 | BOSE_FLAGS // flags: some flags\r | |
1952 | };\r | |
1953 | \r | |
1954 | #endif\r | |
1955 | \r | |
1956 | #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r | |
1957 | \r | |
1958 | static const PROGMEM IRMP_PARAMETER a1tvbox_param =\r | |
1959 | {\r | |
1960 | IRMP_A1TVBOX_PROTOCOL, // protocol: ir protocol\r | |
1961 | \r | |
1962 | A1TVBOX_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1963 | A1TVBOX_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1964 | A1TVBOX_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1965 | A1TVBOX_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1966 | 0, // pulse_0_len_min: here: not used\r | |
1967 | 0, // pulse_0_len_max: here: not used\r | |
1968 | 0, // pause_0_len_min: here: not used\r | |
1969 | 0, // pause_0_len_max: here: not used\r | |
1970 | A1TVBOX_ADDRESS_OFFSET, // address_offset: address offset\r | |
1971 | A1TVBOX_ADDRESS_OFFSET + A1TVBOX_ADDRESS_LEN, // address_end: end of address\r | |
1972 | A1TVBOX_COMMAND_OFFSET, // command_offset: command offset\r | |
1973 | A1TVBOX_COMMAND_OFFSET + A1TVBOX_COMMAND_LEN, // command_end: end of command\r | |
1974 | A1TVBOX_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
1975 | A1TVBOX_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
1976 | A1TVBOX_LSB, // lsb_first: flag: LSB first\r | |
1977 | A1TVBOX_FLAGS // flags: some flags\r | |
1978 | };\r | |
1979 | \r | |
1980 | #endif\r | |
1981 | \r | |
1982 | #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1\r | |
1983 | \r | |
1984 | static const PROGMEM IRMP_PARAMETER merlin_param =\r | |
1985 | {\r | |
1986 | IRMP_MERLIN_PROTOCOL, // protocol: ir protocol\r | |
1987 | \r | |
1988 | MERLIN_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
1989 | MERLIN_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
1990 | MERLIN_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
1991 | MERLIN_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
1992 | 0, // pulse_0_len_min: here: not used\r | |
1993 | 0, // pulse_0_len_max: here: not used\r | |
1994 | 0, // pause_0_len_min: here: not used\r | |
1995 | 0, // pause_0_len_max: here: not used\r | |
1996 | MERLIN_ADDRESS_OFFSET, // address_offset: address offset\r | |
1997 | MERLIN_ADDRESS_OFFSET + MERLIN_ADDRESS_LEN, // address_end: end of address\r | |
1998 | MERLIN_COMMAND_OFFSET, // command_offset: command offset\r | |
1999 | MERLIN_COMMAND_OFFSET + MERLIN_COMMAND_LEN, // command_end: end of command\r | |
2000 | MERLIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2001 | MERLIN_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2002 | MERLIN_LSB, // lsb_first: flag: LSB first\r | |
2003 | MERLIN_FLAGS // flags: some flags\r | |
2004 | };\r | |
2005 | \r | |
2006 | #endif\r | |
2007 | \r | |
2008 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
2009 | \r | |
2010 | static const PROGMEM IRMP_PARAMETER ortek_param =\r | |
2011 | {\r | |
2012 | IRMP_ORTEK_PROTOCOL, // protocol: ir protocol\r | |
2013 | \r | |
2014 | ORTEK_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
2015 | ORTEK_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
2016 | ORTEK_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause\r | |
2017 | ORTEK_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause\r | |
2018 | 0, // pulse_0_len_min: here: not used\r | |
2019 | 0, // pulse_0_len_max: here: not used\r | |
2020 | 0, // pause_0_len_min: here: not used\r | |
2021 | 0, // pause_0_len_max: here: not used\r | |
2022 | ORTEK_ADDRESS_OFFSET, // address_offset: address offset\r | |
2023 | ORTEK_ADDRESS_OFFSET + ORTEK_ADDRESS_LEN, // address_end: end of address\r | |
2024 | ORTEK_COMMAND_OFFSET, // command_offset: command offset\r | |
2025 | ORTEK_COMMAND_OFFSET + ORTEK_COMMAND_LEN, // command_end: end of command\r | |
2026 | ORTEK_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2027 | ORTEK_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2028 | ORTEK_LSB, // lsb_first: flag: LSB first\r | |
2029 | ORTEK_FLAGS // flags: some flags\r | |
2030 | };\r | |
2031 | \r | |
2032 | #endif\r | |
2033 | \r | |
2034 | #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r | |
2035 | \r | |
2036 | static const PROGMEM IRMP_PARAMETER roomba_param =\r | |
2037 | {\r | |
2038 | IRMP_ROOMBA_PROTOCOL, // protocol: ir protocol\r | |
2039 | ROOMBA_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
2040 | ROOMBA_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
2041 | ROOMBA_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
2042 | ROOMBA_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
2043 | ROOMBA_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
2044 | ROOMBA_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
2045 | ROOMBA_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
2046 | ROOMBA_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
2047 | ROOMBA_ADDRESS_OFFSET, // address_offset: address offset\r | |
2048 | ROOMBA_ADDRESS_OFFSET + ROOMBA_ADDRESS_LEN, // address_end: end of address\r | |
2049 | ROOMBA_COMMAND_OFFSET, // command_offset: command offset\r | |
2050 | ROOMBA_COMMAND_OFFSET + ROOMBA_COMMAND_LEN, // command_end: end of command\r | |
2051 | ROOMBA_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2052 | ROOMBA_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2053 | ROOMBA_LSB, // lsb_first: flag: LSB first\r | |
2054 | ROOMBA_FLAGS // flags: some flags\r | |
2055 | };\r | |
2056 | \r | |
2057 | #endif\r | |
2058 | \r | |
2059 | #if IRMP_SUPPORT_RCMM_PROTOCOL == 1\r | |
2060 | \r | |
2061 | static const PROGMEM IRMP_PARAMETER rcmm_param =\r | |
2062 | {\r | |
2063 | IRMP_RCMM32_PROTOCOL, // protocol: ir protocol\r | |
2064 | \r | |
2065 | RCMM32_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse\r | |
2066 | RCMM32_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse\r | |
2067 | 0, // pause_1_len_min: here: minimum length of short pause\r | |
2068 | 0, // pause_1_len_max: here: maximum length of short pause\r | |
2069 | RCMM32_BIT_PULSE_LEN_MIN, // pulse_0_len_min: here: not used\r | |
2070 | RCMM32_BIT_PULSE_LEN_MAX, // pulse_0_len_max: here: not used\r | |
2071 | 0, // pause_0_len_min: here: not used\r | |
2072 | 0, // pause_0_len_max: here: not used\r | |
2073 | RCMM32_ADDRESS_OFFSET, // address_offset: address offset\r | |
2074 | RCMM32_ADDRESS_OFFSET + RCMM32_ADDRESS_LEN, // address_end: end of address\r | |
2075 | RCMM32_COMMAND_OFFSET, // command_offset: command offset\r | |
2076 | RCMM32_COMMAND_OFFSET + RCMM32_COMMAND_LEN, // command_end: end of command\r | |
2077 | RCMM32_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2078 | RCMM32_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2079 | RCMM32_LSB, // lsb_first: flag: LSB first\r | |
2080 | RCMM32_FLAGS // flags: some flags\r | |
2081 | };\r | |
2082 | \r | |
2083 | #endif\r | |
2084 | \r | |
2085 | #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r | |
2086 | \r | |
2087 | static const PROGMEM IRMP_PARAMETER pentax_param =\r | |
2088 | {\r | |
2089 | IRMP_PENTAX_PROTOCOL, // protocol: ir protocol\r | |
2090 | PENTAX_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
2091 | PENTAX_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
2092 | PENTAX_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
2093 | PENTAX_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
2094 | PENTAX_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
2095 | PENTAX_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
2096 | PENTAX_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
2097 | PENTAX_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
2098 | PENTAX_ADDRESS_OFFSET, // address_offset: address offset\r | |
2099 | PENTAX_ADDRESS_OFFSET + PENTAX_ADDRESS_LEN, // address_end: end of address\r | |
2100 | PENTAX_COMMAND_OFFSET, // command_offset: command offset\r | |
2101 | PENTAX_COMMAND_OFFSET + PENTAX_COMMAND_LEN, // command_end: end of command\r | |
2102 | PENTAX_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2103 | PENTAX_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2104 | PENTAX_LSB, // lsb_first: flag: LSB first\r | |
2105 | PENTAX_FLAGS // flags: some flags\r | |
2106 | };\r | |
2107 | \r | |
2108 | #endif\r | |
2109 | \r | |
2110 | #if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r | |
2111 | \r | |
2112 | static const PROGMEM IRMP_PARAMETER acp24_param =\r | |
2113 | {\r | |
2114 | IRMP_ACP24_PROTOCOL, // protocol: ir protocol\r | |
2115 | ACP24_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
2116 | ACP24_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
2117 | ACP24_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
2118 | ACP24_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
2119 | ACP24_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
2120 | ACP24_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
2121 | ACP24_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
2122 | ACP24_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
2123 | ACP24_ADDRESS_OFFSET, // address_offset: address offset\r | |
2124 | ACP24_ADDRESS_OFFSET + ACP24_ADDRESS_LEN, // address_end: end of address\r | |
2125 | ACP24_COMMAND_OFFSET, // command_offset: command offset\r | |
2126 | ACP24_COMMAND_OFFSET + ACP24_COMMAND_LEN, // command_end: end of command\r | |
2127 | ACP24_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2128 | ACP24_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2129 | ACP24_LSB, // lsb_first: flag: LSB first\r | |
2130 | ACP24_FLAGS // flags: some flags\r | |
2131 | };\r | |
2132 | \r | |
2133 | #endif\r | |
2134 | \r | |
2135 | #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1\r | |
2136 | \r | |
2137 | static const PROGMEM IRMP_PARAMETER radio1_param =\r | |
2138 | {\r | |
2139 | IRMP_RADIO1_PROTOCOL, // protocol: ir protocol\r | |
2140 | \r | |
2141 | RADIO1_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1\r | |
2142 | RADIO1_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1\r | |
2143 | RADIO1_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1\r | |
2144 | RADIO1_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1\r | |
2145 | RADIO1_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0\r | |
2146 | RADIO1_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0\r | |
2147 | RADIO1_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0\r | |
2148 | RADIO1_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0\r | |
2149 | RADIO1_ADDRESS_OFFSET, // address_offset: address offset\r | |
2150 | RADIO1_ADDRESS_OFFSET + RADIO1_ADDRESS_LEN, // address_end: end of address\r | |
2151 | RADIO1_COMMAND_OFFSET, // command_offset: command offset\r | |
2152 | RADIO1_COMMAND_OFFSET + RADIO1_COMMAND_LEN, // command_end: end of command\r | |
2153 | RADIO1_COMPLETE_DATA_LEN, // complete_len: complete length of frame\r | |
2154 | RADIO1_STOP_BIT, // stop_bit: flag: frame has stop bit\r | |
2155 | RADIO1_LSB, // lsb_first: flag: LSB first\r | |
2156 | RADIO1_FLAGS // flags: some flags\r | |
2157 | };\r | |
2158 | \r | |
2159 | #endif\r | |
2160 | \r | |
2161 | static uint_fast8_t irmp_bit; // current bit position\r | |
2162 | static IRMP_PARAMETER irmp_param;\r | |
2163 | \r | |
2164 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r | |
2165 | static IRMP_PARAMETER irmp_param2;\r | |
2166 | #endif\r | |
2167 | \r | |
2168 | static volatile uint_fast8_t irmp_ir_detected = FALSE;\r | |
2169 | static volatile uint_fast8_t irmp_protocol;\r | |
2170 | static volatile uint_fast16_t irmp_address;\r | |
2171 | static volatile uint_fast16_t irmp_command;\r | |
2172 | static volatile uint_fast16_t irmp_id; // only used for SAMSUNG protocol\r | |
2173 | static volatile uint_fast8_t irmp_flags;\r | |
2174 | // static volatile uint_fast8_t irmp_busy_flag;\r | |
2175 | \r | |
2176 | #if defined(__MBED__)\r | |
2177 | // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp\r | |
2178 | gpio_t gpioIRin; // use low level c function instead\r | |
2179 | #endif\r | |
2180 | \r | |
2181 | \r | |
2182 | #ifdef ANALYZE\r | |
2183 | #define input(x) (x)\r | |
2184 | static uint_fast8_t IRMP_PIN;\r | |
2185 | static uint_fast8_t radio;\r | |
2186 | #endif\r | |
2187 | \r | |
2188 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2189 | * Initialize IRMP decoder\r | |
2190 | * @details Configures IRMP input pin\r | |
2191 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2192 | */\r | |
2193 | #ifndef ANALYZE\r | |
2194 | void\r | |
2195 | irmp_init (void)\r | |
2196 | {\r | |
2197 | #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing\r | |
2198 | #elif defined (ARM_STM32) // STM32\r | |
2199 | GPIO_InitTypeDef GPIO_InitStructure;\r | |
2200 | \r | |
2201 | /* GPIOx clock enable */\r | |
2202 | # if defined (ARM_STM32L1XX)\r | |
2203 | RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r | |
2204 | # elif defined (ARM_STM32F10X)\r | |
2205 | RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r | |
2206 | # elif defined (ARM_STM32F4XX)\r | |
2207 | RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE);\r | |
2208 | # endif\r | |
2209 | \r | |
2210 | /* GPIO Configuration */\r | |
2211 | GPIO_InitStructure.GPIO_Pin = IRMP_BIT;\r | |
2212 | # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)\r | |
2213 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;\r | |
2214 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r | |
2215 | GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;\r | |
2216 | GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;\r | |
2217 | # elif defined (ARM_STM32F10X)\r | |
2218 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;\r | |
2219 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;\r | |
2220 | # endif\r | |
2221 | GPIO_Init(IRMP_PORT, &GPIO_InitStructure);\r | |
2222 | \r | |
2223 | #elif defined (LIBOPENCM3) // STM32 with libopencm3\r | |
2224 | \r | |
2225 | /* GPIOx clock enable */\r | |
2226 | rcc_periph_clock_enable(IRMP_PORT_RCC);\r | |
2227 | /* GPIO Configuration */\r | |
2228 | gpio_set_mode(IRMP_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, IRMP_BIT);\r | |
2229 | \r | |
2230 | #elif defined(STELLARIS_ARM_CORTEX_M4)\r | |
2231 | // Enable the GPIO port\r | |
2232 | ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH);\r | |
2233 | \r | |
2234 | // Set as an input\r | |
2235 | ROM_GPIODirModeSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_DIR_MODE_IN);\r | |
2236 | ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);\r | |
2237 | \r | |
2238 | #elif defined(__SDCC_stm8) // STM8\r | |
2239 | IRMP_GPIO_STRUCT->DDR &= ~(1<<IRMP_BIT); // pin is input\r | |
2240 | IRMP_GPIO_STRUCT->CR1 |= (1<<IRMP_BIT); // activate pullup\r | |
2241 | \r | |
2242 | #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY\r | |
2243 | pinMode(IRMP_PIN, INPUT);\r | |
2244 | \r | |
2245 | #elif defined(__xtensa__) // ESP8266\r | |
2246 | pinMode(IRMP_BIT_NUMBER, INPUT);\r | |
2247 | // select pin function\r | |
2248 | # if (IRMP_BIT_NUMBER == 12)\r | |
2249 | PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);\r | |
2250 | // doesn't work for me:\r | |
2251 | // # elif (IRMP_BIT_NUMBER == 13)\r | |
2252 | // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);\r | |
2253 | # else\r | |
2254 | # warning Please add PIN_FUNC_SELECT when necessary.\r | |
2255 | # endif\r | |
2256 | GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER);\r | |
2257 | \r | |
2258 | #elif defined(__MBED__)\r | |
2259 | gpio_init_in_ex(&gpioIRin, IRMP_PIN, IRMP_PINMODE); // initialize input for IR diode\r | |
2260 | \r | |
2261 | #else // AVR\r | |
2262 | IRMP_PORT &= ~(1<<IRMP_BIT); // deactivate pullup\r | |
2263 | IRMP_DDR &= ~(1<<IRMP_BIT); // set pin to input\r | |
2264 | #endif\r | |
2265 | \r | |
2266 | #if IRMP_LOGGING == 1\r | |
2267 | irmp_uart_init ();\r | |
2268 | #endif\r | |
2269 | }\r | |
2270 | #endif\r | |
2271 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2272 | * Get IRMP data\r | |
2273 | * @details gets decoded IRMP data\r | |
2274 | * @param pointer in order to store IRMP data\r | |
2275 | * @return TRUE: successful, FALSE: failed\r | |
2276 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2277 | */\r | |
2278 | uint_fast8_t\r | |
2279 | irmp_get_data (IRMP_DATA * irmp_data_p)\r | |
2280 | {\r | |
2281 | uint_fast8_t rtc = FALSE;\r | |
2282 | \r | |
2283 | if (irmp_ir_detected)\r | |
2284 | {\r | |
2285 | switch (irmp_protocol)\r | |
2286 | {\r | |
2287 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
2288 | case IRMP_SAMSUNG_PROTOCOL:\r | |
2289 | if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r | |
2290 | {\r | |
2291 | irmp_command &= 0xff;\r | |
2292 | irmp_command |= irmp_id << 8;\r | |
2293 | rtc = TRUE;\r | |
2294 | }\r | |
2295 | break;\r | |
2296 | \r | |
2297 | #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r | |
2298 | case IRMP_SAMSUNG48_PROTOCOL:\r | |
2299 | irmp_command = (irmp_command & 0x00FF) | ((irmp_id & 0x00FF) << 8);\r | |
2300 | rtc = TRUE;\r | |
2301 | break;\r | |
2302 | #endif\r | |
2303 | #endif\r | |
2304 | \r | |
2305 | #if IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
2306 | case IRMP_NEC_PROTOCOL:\r | |
2307 | if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r | |
2308 | {\r | |
2309 | irmp_command &= 0xff;\r | |
2310 | rtc = TRUE;\r | |
2311 | }\r | |
2312 | else if (irmp_address == 0x87EE)\r | |
2313 | {\r | |
2314 | #ifdef ANALYZE\r | |
2315 | ANALYZE_PRINTF ("Switching to APPLE protocol\n");\r | |
2316 | #endif // ANALYZE\r | |
2317 | irmp_protocol = IRMP_APPLE_PROTOCOL;\r | |
2318 | irmp_address = (irmp_command & 0xFF00) >> 8;\r | |
2319 | irmp_command &= 0x00FF;\r | |
2320 | rtc = TRUE;\r | |
2321 | }\r | |
2322 | break;\r | |
2323 | #endif\r | |
2324 | \r | |
2325 | \r | |
2326 | #if IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
2327 | case IRMP_VINCENT_PROTOCOL:\r | |
2328 | if ((irmp_command >> 8) == (irmp_command & 0x00FF))\r | |
2329 | {\r | |
2330 | irmp_command &= 0xff;\r | |
2331 | rtc = TRUE;\r | |
2332 | }\r | |
2333 | break;\r | |
2334 | #endif\r | |
2335 | \r | |
2336 | #if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r | |
2337 | case IRMP_BOSE_PROTOCOL:\r | |
2338 | if ((irmp_command >> 8) == (~irmp_command & 0x00FF))\r | |
2339 | {\r | |
2340 | irmp_command &= 0xff;\r | |
2341 | rtc = TRUE;\r | |
2342 | }\r | |
2343 | break;\r | |
2344 | #endif\r | |
2345 | #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r | |
2346 | case IRMP_SIEMENS_PROTOCOL:\r | |
2347 | case IRMP_RUWIDO_PROTOCOL:\r | |
2348 | if (((irmp_command >> 1) & 0x0001) == (~irmp_command & 0x0001))\r | |
2349 | {\r | |
2350 | irmp_command >>= 1;\r | |
2351 | rtc = TRUE;\r | |
2352 | }\r | |
2353 | break;\r | |
2354 | #endif\r | |
2355 | #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r | |
2356 | case IRMP_KATHREIN_PROTOCOL:\r | |
2357 | if (irmp_command != 0x0000)\r | |
2358 | {\r | |
2359 | rtc = TRUE;\r | |
2360 | }\r | |
2361 | break;\r | |
2362 | #endif\r | |
2363 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1\r | |
2364 | case IRMP_RC5_PROTOCOL:\r | |
2365 | irmp_address &= ~0x20; // clear toggle bit\r | |
2366 | rtc = TRUE;\r | |
2367 | break;\r | |
2368 | #endif\r | |
2369 | #if IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
2370 | case IRMP_S100_PROTOCOL:\r | |
2371 | irmp_address &= ~0x20; // clear toggle bit\r | |
2372 | rtc = TRUE;\r | |
2373 | break;\r | |
2374 | #endif\r | |
2375 | #if IRMP_SUPPORT_IR60_PROTOCOL == 1\r | |
2376 | case IRMP_IR60_PROTOCOL:\r | |
2377 | if (irmp_command != 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame\r | |
2378 | {\r | |
2379 | rtc = TRUE;\r | |
2380 | }\r | |
2381 | else\r | |
2382 | {\r | |
2383 | #ifdef ANALYZE\r | |
2384 | ANALYZE_PRINTF("Info IR60: got start instruction frame\n");\r | |
2385 | #endif // ANALYZE\r | |
2386 | }\r | |
2387 | break;\r | |
2388 | #endif\r | |
2389 | #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
2390 | case IRMP_RCCAR_PROTOCOL:\r | |
2391 | // frame in irmp_data:\r | |
2392 | // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0\r | |
2393 | // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0\r | |
2394 | irmp_address = (irmp_command & 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0\r | |
2395 | irmp_command = ((irmp_command & 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0\r | |
2396 | ((irmp_command & 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0\r | |
2397 | ((irmp_command & 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0\r | |
2398 | rtc = TRUE; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0\r | |
2399 | break;\r | |
2400 | #endif\r | |
2401 | \r | |
2402 | #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key\r | |
2403 | case IRMP_NETBOX_PROTOCOL:\r | |
2404 | if (irmp_command & 0x1000) // last bit set?\r | |
2405 | {\r | |
2406 | if ((irmp_command & 0x1f) == 0x15) // key pressed: 101 01 (LSB)\r | |
2407 | {\r | |
2408 | irmp_command >>= 5;\r | |
2409 | irmp_command &= 0x7F;\r | |
2410 | rtc = TRUE;\r | |
2411 | }\r | |
2412 | else if ((irmp_command & 0x1f) == 0x10) // key released: 000 01 (LSB)\r | |
2413 | {\r | |
2414 | irmp_command >>= 5;\r | |
2415 | irmp_command |= 0x80;\r | |
2416 | rtc = TRUE;\r | |
2417 | }\r | |
2418 | else\r | |
2419 | {\r | |
2420 | #ifdef ANALYZE\r | |
2421 | ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");\r | |
2422 | #endif // ANALYZE\r | |
2423 | }\r | |
2424 | }\r | |
2425 | else\r | |
2426 | {\r | |
2427 | #ifdef ANALYZE\r | |
2428 | ANALYZE_PRINTF("error NETBOX: last bit not set\n");\r | |
2429 | #endif // ANALYZE\r | |
2430 | }\r | |
2431 | break;\r | |
2432 | #endif\r | |
2433 | #if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r | |
2434 | case IRMP_LEGO_PROTOCOL:\r | |
2435 | {\r | |
2436 | uint_fast8_t crc = 0x0F ^ ((irmp_command & 0xF000) >> 12) ^ ((irmp_command & 0x0F00) >> 8) ^ ((irmp_command & 0x00F0) >> 4);\r | |
2437 | \r | |
2438 | if ((irmp_command & 0x000F) == crc)\r | |
2439 | {\r | |
2440 | irmp_command >>= 4;\r | |
2441 | rtc = TRUE;\r | |
2442 | }\r | |
2443 | else\r | |
2444 | {\r | |
2445 | #ifdef ANALYZE\r | |
2446 | ANALYZE_PRINTF ("CRC error in LEGO protocol\n");\r | |
2447 | #endif // ANALYZE\r | |
2448 | // rtc = TRUE; // don't accept codes with CRC errors\r | |
2449 | }\r | |
2450 | break;\r | |
2451 | }\r | |
2452 | #endif\r | |
2453 | \r | |
2454 | default:\r | |
2455 | {\r | |
2456 | rtc = TRUE;\r | |
2457 | break;\r | |
2458 | }\r | |
2459 | }\r | |
2460 | \r | |
2461 | if (rtc)\r | |
2462 | {\r | |
2463 | irmp_data_p->protocol = irmp_protocol;\r | |
2464 | irmp_data_p->address = irmp_address;\r | |
2465 | irmp_data_p->command = irmp_command;\r | |
2466 | irmp_data_p->flags = irmp_flags;\r | |
2467 | irmp_command = 0;\r | |
2468 | irmp_address = 0;\r | |
2469 | irmp_flags = 0;\r | |
2470 | }\r | |
2471 | \r | |
2472 | irmp_ir_detected = FALSE;\r | |
2473 | }\r | |
2474 | \r | |
2475 | return rtc;\r | |
2476 | }\r | |
2477 | \r | |
2478 | #if IRMP_USE_CALLBACK == 1\r | |
2479 | void\r | |
2480 | irmp_set_callback_ptr (void (*cb)(uint_fast8_t))\r | |
2481 | {\r | |
2482 | irmp_callback_ptr = cb;\r | |
2483 | }\r | |
2484 | #endif // IRMP_USE_CALLBACK == 1\r | |
2485 | \r | |
2486 | // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()\r | |
2487 | static uint_fast16_t irmp_tmp_address; // ir address\r | |
2488 | static uint_fast16_t irmp_tmp_command; // ir command\r | |
2489 | \r | |
2490 | #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r | |
2491 | static uint_fast16_t irmp_tmp_address2; // ir address\r | |
2492 | static uint_fast16_t irmp_tmp_command2; // ir command\r | |
2493 | #endif\r | |
2494 | \r | |
2495 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r | |
2496 | static uint_fast16_t irmp_lgair_address; // ir address\r | |
2497 | static uint_fast16_t irmp_lgair_command; // ir command\r | |
2498 | #endif\r | |
2499 | \r | |
2500 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
2501 | static uint_fast16_t irmp_tmp_id; // ir id (only SAMSUNG)\r | |
2502 | #endif\r | |
2503 | #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
2504 | static uint8_t xor_check[6]; // check kaseikyo "parity" bits\r | |
2505 | static uint_fast8_t genre2; // save genre2 bits here, later copied to MSB in flags\r | |
2506 | #endif\r | |
2507 | \r | |
2508 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
2509 | static uint_fast8_t parity; // number of '1' of the first 14 bits, check if even.\r | |
2510 | #endif\r | |
2511 | \r | |
2512 | #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r | |
2513 | static uint_fast8_t check; // number of '1' of the first 14 bits, check if even.\r | |
2514 | static uint_fast8_t mitsu_parity; // number of '1' of the first 14 bits, check if even.\r | |
2515 | #endif\r | |
2516 | \r | |
2517 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2518 | * store bit\r | |
2519 | * @details store bit in temp address or temp command\r | |
2520 | * @param value to store: 0 or 1\r | |
2521 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2522 | */\r | |
2523 | // verhindert, dass irmp_store_bit() inline compiliert wird:\r | |
2524 | // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));\r | |
2525 | \r | |
2526 | static void\r | |
2527 | irmp_store_bit (uint_fast8_t value)\r | |
2528 | {\r | |
2529 | #if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r | |
2530 | if (irmp_param.protocol == IRMP_ACP24_PROTOCOL) // squeeze 64 bits into 16 bits:\r | |
2531 | {\r | |
2532 | if (value)\r | |
2533 | {\r | |
2534 | // ACP24-Frame:\r | |
2535 | // 1 2 3 4 5 6\r | |
2536 | // 0123456789012345678901234567890123456789012345678901234567890123456789\r | |
2537 | // N VVMMM ? ??? t vmA x y TTTT\r | |
2538 | //\r | |
2539 | // irmp_data_p->command:\r | |
2540 | //\r | |
2541 | // 5432109876543210\r | |
2542 | // NAVVvMMMmtxyTTTT\r | |
2543 | \r | |
2544 | switch (irmp_bit)\r | |
2545 | {\r | |
2546 | case 0: irmp_tmp_command |= (1<<15); break; // N\r | |
2547 | case 2: irmp_tmp_command |= (1<<13); break; // V\r | |
2548 | case 3: irmp_tmp_command |= (1<<12); break; // V\r | |
2549 | case 4: irmp_tmp_command |= (1<<10); break; // M\r | |
2550 | case 5: irmp_tmp_command |= (1<< 9); break; // M\r | |
2551 | case 6: irmp_tmp_command |= (1<< 8); break; // M\r | |
2552 | case 20: irmp_tmp_command |= (1<< 6); break; // t\r | |
2553 | case 22: irmp_tmp_command |= (1<<11); break; // v\r | |
2554 | case 23: irmp_tmp_command |= (1<< 7); break; // m\r | |
2555 | case 24: irmp_tmp_command |= (1<<14); break; // A\r | |
2556 | case 26: irmp_tmp_command |= (1<< 5); break; // x\r | |
2557 | case 44: irmp_tmp_command |= (1<< 4); break; // y\r | |
2558 | case 66: irmp_tmp_command |= (1<< 3); break; // T\r | |
2559 | case 67: irmp_tmp_command |= (1<< 2); break; // T\r | |
2560 | case 68: irmp_tmp_command |= (1<< 1); break; // T\r | |
2561 | case 69: irmp_tmp_command |= (1<< 0); break; // T\r | |
2562 | }\r | |
2563 | }\r | |
2564 | }\r | |
2565 | else\r | |
2566 | #endif // IRMP_SUPPORT_ACP24_PROTOCOL\r | |
2567 | \r | |
2568 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
2569 | if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)\r | |
2570 | {\r | |
2571 | if (irmp_bit < 14)\r | |
2572 | {\r | |
2573 | if (value)\r | |
2574 | {\r | |
2575 | parity++;\r | |
2576 | }\r | |
2577 | }\r | |
2578 | else if (irmp_bit == 14)\r | |
2579 | {\r | |
2580 | if (value) // value == 1: even parity\r | |
2581 | {\r | |
2582 | if (parity & 0x01)\r | |
2583 | {\r | |
2584 | parity = PARITY_CHECK_FAILED;\r | |
2585 | }\r | |
2586 | else\r | |
2587 | {\r | |
2588 | parity = PARITY_CHECK_OK;\r | |
2589 | }\r | |
2590 | }\r | |
2591 | else\r | |
2592 | {\r | |
2593 | if (parity & 0x01) // value == 0: odd parity\r | |
2594 | {\r | |
2595 | parity = PARITY_CHECK_OK;\r | |
2596 | }\r | |
2597 | else\r | |
2598 | {\r | |
2599 | parity = PARITY_CHECK_FAILED;\r | |
2600 | }\r | |
2601 | }\r | |
2602 | }\r | |
2603 | }\r | |
2604 | else\r | |
2605 | #endif\r | |
2606 | {\r | |
2607 | ;\r | |
2608 | }\r | |
2609 | \r | |
2610 | #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r | |
2611 | if (irmp_bit == 0 && irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL)\r | |
2612 | {\r | |
2613 | first_bit = value;\r | |
2614 | }\r | |
2615 | else\r | |
2616 | #endif\r | |
2617 | \r | |
2618 | if (irmp_bit >= irmp_param.address_offset && irmp_bit < irmp_param.address_end)\r | |
2619 | {\r | |
2620 | if (irmp_param.lsb_first)\r | |
2621 | {\r | |
2622 | irmp_tmp_address |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.address_offset)); // CV wants cast\r | |
2623 | }\r | |
2624 | else\r | |
2625 | {\r | |
2626 | irmp_tmp_address <<= 1;\r | |
2627 | irmp_tmp_address |= value;\r | |
2628 | }\r | |
2629 | }\r | |
2630 | else if (irmp_bit >= irmp_param.command_offset && irmp_bit < irmp_param.command_end)\r | |
2631 | {\r | |
2632 | if (irmp_param.lsb_first)\r | |
2633 | {\r | |
2634 | #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1\r | |
2635 | if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit >= 32)\r | |
2636 | {\r | |
2637 | irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - 32)); // CV wants cast\r | |
2638 | }\r | |
2639 | else\r | |
2640 | #endif\r | |
2641 | {\r | |
2642 | irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.command_offset)); // CV wants cast\r | |
2643 | }\r | |
2644 | }\r | |
2645 | else\r | |
2646 | {\r | |
2647 | irmp_tmp_command <<= 1;\r | |
2648 | irmp_tmp_command |= value;\r | |
2649 | }\r | |
2650 | }\r | |
2651 | \r | |
2652 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r | |
2653 | if (irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL)\r | |
2654 | {\r | |
2655 | if (irmp_bit < 8)\r | |
2656 | {\r | |
2657 | irmp_lgair_address <<= 1; // LGAIR uses MSB\r | |
2658 | irmp_lgair_address |= value;\r | |
2659 | }\r | |
2660 | else if (irmp_bit < 24)\r | |
2661 | {\r | |
2662 | irmp_lgair_command <<= 1; // LGAIR uses MSB\r | |
2663 | irmp_lgair_command |= value;\r | |
2664 | }\r | |
2665 | }\r | |
2666 | // NO else!\r | |
2667 | #endif\r | |
2668 | \r | |
2669 | #if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r | |
2670 | if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit >= 13 && irmp_bit < 26)\r | |
2671 | {\r | |
2672 | irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit - 13)); // CV wants cast\r | |
2673 | }\r | |
2674 | else\r | |
2675 | #endif\r | |
2676 | \r | |
2677 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
2678 | if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit >= SAMSUNG_ID_OFFSET && irmp_bit < SAMSUNG_ID_OFFSET + SAMSUNG_ID_LEN)\r | |
2679 | {\r | |
2680 | irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first\r | |
2681 | }\r | |
2682 | else\r | |
2683 | #endif\r | |
2684 | \r | |
2685 | #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
2686 | if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)\r | |
2687 | {\r | |
2688 | if (irmp_bit >= 20 && irmp_bit < 24)\r | |
2689 | {\r | |
2690 | irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first\r | |
2691 | }\r | |
2692 | else if (irmp_bit >= 24 && irmp_bit < 28)\r | |
2693 | {\r | |
2694 | genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first\r | |
2695 | }\r | |
2696 | \r | |
2697 | if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)\r | |
2698 | {\r | |
2699 | if (value)\r | |
2700 | {\r | |
2701 | xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8);\r | |
2702 | }\r | |
2703 | else\r | |
2704 | {\r | |
2705 | xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8));\r | |
2706 | }\r | |
2707 | }\r | |
2708 | }\r | |
2709 | else\r | |
2710 | #endif\r | |
2711 | \r | |
2712 | #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r | |
2713 | if (irmp_param.protocol == IRMP_MITSU_HEAVY_PROTOCOL) // squeeze 64 bits into 16 bits:\r | |
2714 | {\r | |
2715 | if (irmp_bit == 72 )\r | |
2716 | { // irmp_tmp_address, irmp_tmp_command received: check parity & compress\r | |
2717 | mitsu_parity = PARITY_CHECK_OK;\r | |
2718 | \r | |
2719 | check = irmp_tmp_address >> 8; // inverted upper byte == lower byte?\r | |
2720 | check = ~ check;\r | |
2721 | \r | |
2722 | if (check == (irmp_tmp_address & 0xFF))\r | |
2723 | { // ok:\r | |
2724 | irmp_tmp_address <<= 8; // throw away upper byte\r | |
2725 | }\r | |
2726 | else\r | |
2727 | {\r | |
2728 | mitsu_parity = PARITY_CHECK_FAILED;\r | |
2729 | }\r | |
2730 | \r | |
2731 | check = irmp_tmp_command >> 8; // inverted upper byte == lower byte?\r | |
2732 | check = ~ check;\r | |
2733 | if (check == (irmp_tmp_command & 0xFF))\r | |
2734 | { // ok: pack together\r | |
2735 | irmp_tmp_address |= irmp_tmp_command & 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3\r | |
2736 | }\r | |
2737 | else\r | |
2738 | {\r | |
2739 | mitsu_parity = PARITY_CHECK_FAILED;\r | |
2740 | }\r | |
2741 | irmp_tmp_command = 0;\r | |
2742 | }\r | |
2743 | \r | |
2744 | if (irmp_bit >= 72 )\r | |
2745 | { // receive 3. word in irmp_tmp_command\r | |
2746 | irmp_tmp_command <<= 1;\r | |
2747 | irmp_tmp_command |= value;\r | |
2748 | }\r | |
2749 | }\r | |
2750 | else\r | |
2751 | #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL\r | |
2752 | {\r | |
2753 | ;\r | |
2754 | }\r | |
2755 | \r | |
2756 | irmp_bit++;\r | |
2757 | }\r | |
2758 | \r | |
2759 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2760 | * store bit\r | |
2761 | * @details store bit in temp address or temp command\r | |
2762 | * @param value to store: 0 or 1\r | |
2763 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2764 | */\r | |
2765 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r | |
2766 | static void\r | |
2767 | irmp_store_bit2 (uint_fast8_t value)\r | |
2768 | {\r | |
2769 | uint_fast8_t irmp_bit2;\r | |
2770 | \r | |
2771 | if (irmp_param.protocol)\r | |
2772 | {\r | |
2773 | irmp_bit2 = irmp_bit - 2;\r | |
2774 | }\r | |
2775 | else\r | |
2776 | {\r | |
2777 | irmp_bit2 = irmp_bit - 1;\r | |
2778 | }\r | |
2779 | \r | |
2780 | if (irmp_bit2 >= irmp_param2.address_offset && irmp_bit2 < irmp_param2.address_end)\r | |
2781 | {\r | |
2782 | irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.address_offset)); // CV wants cast\r | |
2783 | }\r | |
2784 | else if (irmp_bit2 >= irmp_param2.command_offset && irmp_bit2 < irmp_param2.command_end)\r | |
2785 | {\r | |
2786 | irmp_tmp_command2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.command_offset)); // CV wants cast\r | |
2787 | }\r | |
2788 | }\r | |
2789 | #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r | |
2790 | \r | |
2791 | /*---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2792 | * ISR routine\r | |
2793 | * @details ISR routine, called 10000 times per second\r | |
2794 | *---------------------------------------------------------------------------------------------------------------------------------------------------\r | |
2795 | */\r | |
2796 | uint_fast8_t\r | |
2797 | irmp_ISR (void)\r | |
2798 | {\r | |
2799 | static uint_fast8_t irmp_start_bit_detected; // flag: start bit detected\r | |
2800 | static uint_fast8_t wait_for_space; // flag: wait for data bit space\r | |
2801 | static uint_fast8_t wait_for_start_space; // flag: wait for start bit space\r | |
2802 | static uint_fast8_t irmp_pulse_time; // count bit time for pulse\r | |
2803 | static PAUSE_LEN irmp_pause_time; // count bit time for pause\r | |
2804 | static uint_fast16_t last_irmp_address = 0xFFFF; // save last irmp address to recognize key repetition\r | |
2805 | static uint_fast16_t last_irmp_command = 0xFFFF; // save last irmp command to recognize key repetition\r | |
2806 | static uint_fast16_t key_repetition_len; // SIRCS repeats frame 2-5 times with 45 ms pause\r | |
2807 | static uint_fast8_t repetition_frame_number;\r | |
2808 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
2809 | static uint_fast16_t last_irmp_denon_command; // save last irmp command to recognize DENON frame repetition\r | |
2810 | static uint_fast16_t denon_repetition_len = 0xFFFF; // denon repetition len of 2nd auto generated frame\r | |
2811 | #endif\r | |
2812 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
2813 | static uint_fast8_t rc5_cmd_bit6; // bit 6 of RC5 command is the inverted 2nd start bit\r | |
2814 | #endif\r | |
2815 | #if IRMP_SUPPORT_MANCHESTER == 1\r | |
2816 | static PAUSE_LEN last_pause; // last pause value\r | |
2817 | #endif\r | |
2818 | #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r | |
2819 | static uint_fast8_t last_value; // last bit value\r | |
2820 | #endif\r | |
2821 | uint_fast8_t irmp_input; // input value\r | |
2822 | \r | |
2823 | #ifdef ANALYZE\r | |
2824 | time_counter++;\r | |
2825 | #endif // ANALYZE\r | |
2826 | \r | |
2827 | #if defined(__SDCC_stm8)\r | |
2828 | irmp_input = input(IRMP_GPIO_STRUCT->IDR)\r | |
2829 | #elif defined(__MBED__)\r | |
2830 | //irmp_input = inputPin;\r | |
2831 | irmp_input = gpio_read (&gpioIRin);\r | |
2832 | #else\r | |
2833 | irmp_input = input(IRMP_PIN);\r | |
2834 | #endif\r | |
2835 | \r | |
2836 | #if IRMP_USE_CALLBACK == 1\r | |
2837 | if (irmp_callback_ptr)\r | |
2838 | {\r | |
2839 | static uint_fast8_t last_inverted_input;\r | |
2840 | \r | |
2841 | if (last_inverted_input != !irmp_input)\r | |
2842 | {\r | |
2843 | (*irmp_callback_ptr) (! irmp_input);\r | |
2844 | last_inverted_input = !irmp_input;\r | |
2845 | }\r | |
2846 | }\r | |
2847 | #endif // IRMP_USE_CALLBACK == 1\r | |
2848 | \r | |
2849 | irmp_log(irmp_input); // log ir signal, if IRMP_LOGGING defined\r | |
2850 | \r | |
2851 | if (! irmp_ir_detected) // ir code already detected?\r | |
2852 | { // no...\r | |
2853 | if (! irmp_start_bit_detected) // start bit detected?\r | |
2854 | { // no...\r | |
2855 | if (! irmp_input) // receiving burst?\r | |
2856 | { // yes...\r | |
2857 | // irmp_busy_flag = TRUE;\r | |
2858 | #ifdef ANALYZE\r | |
2859 | if (! irmp_pulse_time)\r | |
2860 | {\r | |
2861 | ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);\r | |
2862 | }\r | |
2863 | #endif // ANALYZE\r | |
2864 | irmp_pulse_time++; // increment counter\r | |
2865 | }\r | |
2866 | else\r | |
2867 | { // no...\r | |
2868 | if (irmp_pulse_time) // it's dark....\r | |
2869 | { // set flags for counting the time of darkness...\r | |
2870 | irmp_start_bit_detected = 1;\r | |
2871 | wait_for_start_space = 1;\r | |
2872 | wait_for_space = 0;\r | |
2873 | irmp_tmp_command = 0;\r | |
2874 | irmp_tmp_address = 0;\r | |
2875 | #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
2876 | genre2 = 0;\r | |
2877 | #endif\r | |
2878 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
2879 | irmp_tmp_id = 0;\r | |
2880 | #endif\r | |
2881 | \r | |
2882 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1\r | |
2883 | irmp_tmp_command2 = 0;\r | |
2884 | irmp_tmp_address2 = 0;\r | |
2885 | #endif\r | |
2886 | #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1\r | |
2887 | irmp_lgair_command = 0;\r | |
2888 | irmp_lgair_address = 0;\r | |
2889 | #endif\r | |
2890 | irmp_bit = 0xff;\r | |
2891 | irmp_pause_time = 1; // 1st pause: set to 1, not to 0!\r | |
2892 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
2893 | rc5_cmd_bit6 = 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!\r | |
2894 | #endif\r | |
2895 | }\r | |
2896 | else\r | |
2897 | {\r | |
2898 | if (key_repetition_len < 0xFFFF) // avoid overflow of counter\r | |
2899 | {\r | |
2900 | key_repetition_len++;\r | |
2901 | \r | |
2902 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
2903 | if (denon_repetition_len < 0xFFFF) // avoid overflow of counter\r | |
2904 | {\r | |
2905 | denon_repetition_len++;\r | |
2906 | \r | |
2907 | if (denon_repetition_len >= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0)\r | |
2908 | {\r | |
2909 | #ifdef ANALYZE\r | |
2910 | ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",\r | |
2911 | (double) (time_counter * 1000) / F_INTERRUPTS);\r | |
2912 | #endif // ANALYZE\r | |
2913 | last_irmp_denon_command = 0;\r | |
2914 | denon_repetition_len = 0xFFFF;\r | |
2915 | }\r | |
2916 | }\r | |
2917 | #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
2918 | }\r | |
2919 | }\r | |
2920 | }\r | |
2921 | }\r | |
2922 | else\r | |
2923 | {\r | |
2924 | if (wait_for_start_space) // we have received start bit...\r | |
2925 | { // ...and are counting the time of darkness\r | |
2926 | if (irmp_input) // still dark?\r | |
2927 | { // yes\r | |
2928 | irmp_pause_time++; // increment counter\r | |
2929 | \r | |
2930 | #if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r | |
2931 | if (((irmp_pulse_time < NIKON_START_BIT_PULSE_LEN_MIN || irmp_pulse_time > NIKON_START_BIT_PULSE_LEN_MAX) && irmp_pause_time > IRMP_TIMEOUT_LEN) ||\r | |
2932 | irmp_pause_time > IRMP_TIMEOUT_NIKON_LEN)\r | |
2933 | #else\r | |
2934 | if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r | |
2935 | #endif\r | |
2936 | { // yes...\r | |
2937 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
2938 | if (irmp_protocol == IRMP_JVC_PROTOCOL) // don't show eror if JVC protocol, irmp_pulse_time has been set below!\r | |
2939 | {\r | |
2940 | ;\r | |
2941 | }\r | |
2942 | else\r | |
2943 | #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
2944 | {\r | |
2945 | #ifdef ANALYZE\r | |
2946 | ANALYZE_PRINTF ("%8.3fms error 1: pause after start bit pulse %d too long: %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);\r | |
2947 | ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');\r | |
2948 | #endif // ANALYZE\r | |
2949 | }\r | |
2950 | \r | |
2951 | irmp_start_bit_detected = 0; // reset flags, let's wait for another start bit\r | |
2952 | irmp_pulse_time = 0;\r | |
2953 | irmp_pause_time = 0;\r | |
2954 | }\r | |
2955 | }\r | |
2956 | else\r | |
2957 | { // receiving first data pulse!\r | |
2958 | IRMP_PARAMETER * irmp_param_p;\r | |
2959 | irmp_param_p = (IRMP_PARAMETER *) 0;\r | |
2960 | \r | |
2961 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r | |
2962 | irmp_param2.protocol = 0;\r | |
2963 | #endif\r | |
2964 | \r | |
2965 | #ifdef ANALYZE\r | |
2966 | ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);\r | |
2967 | #endif // ANALYZE\r | |
2968 | \r | |
2969 | #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r | |
2970 | if (irmp_pulse_time >= SIRCS_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIRCS_START_BIT_PULSE_LEN_MAX &&\r | |
2971 | irmp_pause_time >= SIRCS_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIRCS_START_BIT_PAUSE_LEN_MAX)\r | |
2972 | { // it's SIRCS\r | |
2973 | #ifdef ANALYZE\r | |
2974 | ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
2975 | SIRCS_START_BIT_PULSE_LEN_MIN, SIRCS_START_BIT_PULSE_LEN_MAX,\r | |
2976 | SIRCS_START_BIT_PAUSE_LEN_MIN, SIRCS_START_BIT_PAUSE_LEN_MAX);\r | |
2977 | #endif // ANALYZE\r | |
2978 | irmp_param_p = (IRMP_PARAMETER *) &sircs_param;\r | |
2979 | }\r | |
2980 | else\r | |
2981 | #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r | |
2982 | \r | |
2983 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
2984 | if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame\r | |
2985 | irmp_pulse_time >= JVC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= JVC_START_BIT_PULSE_LEN_MAX &&\r | |
2986 | irmp_pause_time >= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX)\r | |
2987 | {\r | |
2988 | #ifdef ANALYZE\r | |
2989 | ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
2990 | JVC_START_BIT_PULSE_LEN_MIN, JVC_START_BIT_PULSE_LEN_MAX,\r | |
2991 | JVC_REPEAT_START_BIT_PAUSE_LEN_MIN, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r | |
2992 | #endif // ANALYZE\r | |
2993 | irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r | |
2994 | }\r | |
2995 | else\r | |
2996 | #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
2997 | \r | |
2998 | #if IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
2999 | if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r | |
3000 | irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)\r | |
3001 | {\r | |
3002 | #if IRMP_SUPPORT_NEC42_PROTOCOL == 1\r | |
3003 | #ifdef ANALYZE\r | |
3004 | ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3005 | NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r | |
3006 | NEC_START_BIT_PAUSE_LEN_MIN, NEC_START_BIT_PAUSE_LEN_MAX);\r | |
3007 | #endif // ANALYZE\r | |
3008 | irmp_param_p = (IRMP_PARAMETER *) &nec42_param;\r | |
3009 | #else\r | |
3010 | #ifdef ANALYZE\r | |
3011 | ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3012 | NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r | |
3013 | NEC_START_BIT_PAUSE_LEN_MIN, NEC_START_BIT_PAUSE_LEN_MAX);\r | |
3014 | #endif // ANALYZE\r | |
3015 | irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r | |
3016 | #endif\r | |
3017 | }\r | |
3018 | else if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r | |
3019 | irmp_pause_time >= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX)\r | |
3020 | { // it's NEC\r | |
3021 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
3022 | if (irmp_protocol == IRMP_JVC_PROTOCOL) // last protocol was JVC, awaiting repeat frame\r | |
3023 | { // some jvc remote controls use nec repetition frame for jvc repetition frame\r | |
3024 | #ifdef ANALYZE\r | |
3025 | ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3026 | NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r | |
3027 | NEC_REPEAT_START_BIT_PAUSE_LEN_MIN, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r | |
3028 | #endif // ANALYZE\r | |
3029 | irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r | |
3030 | }\r | |
3031 | else\r | |
3032 | #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
3033 | {\r | |
3034 | #ifdef ANALYZE\r | |
3035 | ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3036 | NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r | |
3037 | NEC_REPEAT_START_BIT_PAUSE_LEN_MIN, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX);\r | |
3038 | #endif // ANALYZE\r | |
3039 | \r | |
3040 | irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;\r | |
3041 | }\r | |
3042 | }\r | |
3043 | else\r | |
3044 | \r | |
3045 | #if IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
3046 | if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame\r | |
3047 | irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&\r | |
3048 | irmp_pause_time >= NEC_0_PAUSE_LEN_MIN && irmp_pause_time <= NEC_0_PAUSE_LEN_MAX)\r | |
3049 | { // it's JVC repetition type 3\r | |
3050 | #ifdef ANALYZE\r | |
3051 | ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3052 | NEC_START_BIT_PULSE_LEN_MIN, NEC_START_BIT_PULSE_LEN_MAX,\r | |
3053 | NEC_0_PAUSE_LEN_MIN, NEC_0_PAUSE_LEN_MAX);\r | |
3054 | #endif // ANALYZE\r | |
3055 | irmp_param_p = (IRMP_PARAMETER *) &nec_param;\r | |
3056 | }\r | |
3057 | else\r | |
3058 | #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1\r | |
3059 | \r | |
3060 | #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
3061 | \r | |
3062 | #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r | |
3063 | if (irmp_pulse_time >= TELEFUNKEN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= TELEFUNKEN_START_BIT_PULSE_LEN_MAX &&\r | |
3064 | irmp_pause_time >= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX)\r | |
3065 | {\r | |
3066 | #ifdef ANALYZE\r | |
3067 | ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3068 | TELEFUNKEN_START_BIT_PULSE_LEN_MIN, TELEFUNKEN_START_BIT_PULSE_LEN_MAX,\r | |
3069 | TELEFUNKEN_START_BIT_PAUSE_LEN_MIN, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX);\r | |
3070 | #endif // ANALYZE\r | |
3071 | irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;\r | |
3072 | }\r | |
3073 | else\r | |
3074 | #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1\r | |
3075 | \r | |
3076 | #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r | |
3077 | if (irmp_pulse_time >= ROOMBA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_START_BIT_PULSE_LEN_MAX &&\r | |
3078 | irmp_pause_time >= ROOMBA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ROOMBA_START_BIT_PAUSE_LEN_MAX)\r | |
3079 | {\r | |
3080 | #ifdef ANALYZE\r | |
3081 | ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3082 | ROOMBA_START_BIT_PULSE_LEN_MIN, ROOMBA_START_BIT_PULSE_LEN_MAX,\r | |
3083 | ROOMBA_START_BIT_PAUSE_LEN_MIN, ROOMBA_START_BIT_PAUSE_LEN_MAX);\r | |
3084 | #endif // ANALYZE\r | |
3085 | irmp_param_p = (IRMP_PARAMETER *) &roomba_param;\r | |
3086 | }\r | |
3087 | else\r | |
3088 | #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r | |
3089 | \r | |
3090 | #if IRMP_SUPPORT_ACP24_PROTOCOL == 1\r | |
3091 | if (irmp_pulse_time >= ACP24_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ACP24_START_BIT_PULSE_LEN_MAX &&\r | |
3092 | irmp_pause_time >= ACP24_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ACP24_START_BIT_PAUSE_LEN_MAX)\r | |
3093 | {\r | |
3094 | #ifdef ANALYZE\r | |
3095 | ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3096 | ACP24_START_BIT_PULSE_LEN_MIN, ACP24_START_BIT_PULSE_LEN_MAX,\r | |
3097 | ACP24_START_BIT_PAUSE_LEN_MIN, ACP24_START_BIT_PAUSE_LEN_MAX);\r | |
3098 | #endif // ANALYZE\r | |
3099 | irmp_param_p = (IRMP_PARAMETER *) &acp24_param;\r | |
3100 | }\r | |
3101 | else\r | |
3102 | #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r | |
3103 | \r | |
3104 | #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r | |
3105 | if (irmp_pulse_time >= PENTAX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PENTAX_START_BIT_PULSE_LEN_MAX &&\r | |
3106 | irmp_pause_time >= PENTAX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PENTAX_START_BIT_PAUSE_LEN_MAX)\r | |
3107 | {\r | |
3108 | #ifdef ANALYZE\r | |
3109 | ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3110 | PENTAX_START_BIT_PULSE_LEN_MIN, PENTAX_START_BIT_PULSE_LEN_MAX,\r | |
3111 | PENTAX_START_BIT_PAUSE_LEN_MIN, PENTAX_START_BIT_PAUSE_LEN_MAX);\r | |
3112 | #endif // ANALYZE\r | |
3113 | irmp_param_p = (IRMP_PARAMETER *) &pentax_param;\r | |
3114 | }\r | |
3115 | else\r | |
3116 | #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1\r | |
3117 | \r | |
3118 | #if IRMP_SUPPORT_NIKON_PROTOCOL == 1\r | |
3119 | if (irmp_pulse_time >= NIKON_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NIKON_START_BIT_PULSE_LEN_MAX &&\r | |
3120 | irmp_pause_time >= NIKON_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NIKON_START_BIT_PAUSE_LEN_MAX)\r | |
3121 | {\r | |
3122 | #ifdef ANALYZE\r | |
3123 | ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3124 | NIKON_START_BIT_PULSE_LEN_MIN, NIKON_START_BIT_PULSE_LEN_MAX,\r | |
3125 | NIKON_START_BIT_PAUSE_LEN_MIN, NIKON_START_BIT_PAUSE_LEN_MAX);\r | |
3126 | #endif // ANALYZE\r | |
3127 | irmp_param_p = (IRMP_PARAMETER *) &nikon_param;\r | |
3128 | }\r | |
3129 | else\r | |
3130 | #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1\r | |
3131 | \r | |
3132 | #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
3133 | if (irmp_pulse_time >= SAMSUNG_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_START_BIT_PULSE_LEN_MAX &&\r | |
3134 | irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)\r | |
3135 | { // it's SAMSUNG\r | |
3136 | #ifdef ANALYZE\r | |
3137 | ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3138 | SAMSUNG_START_BIT_PULSE_LEN_MIN, SAMSUNG_START_BIT_PULSE_LEN_MAX,\r | |
3139 | SAMSUNG_START_BIT_PAUSE_LEN_MIN, SAMSUNG_START_BIT_PAUSE_LEN_MAX);\r | |
3140 | #endif // ANALYZE\r | |
3141 | irmp_param_p = (IRMP_PARAMETER *) &samsung_param;\r | |
3142 | }\r | |
3143 | else\r | |
3144 | #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1\r | |
3145 | \r | |
3146 | #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1\r | |
3147 | if (irmp_pulse_time >= SAMSUNGAH_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNGAH_START_BIT_PULSE_LEN_MAX &&\r | |
3148 | irmp_pause_time >= SAMSUNGAH_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNGAH_START_BIT_PAUSE_LEN_MAX)\r | |
3149 | { // it's SAMSUNGAH\r | |
3150 | #ifdef ANALYZE\r | |
3151 | ANALYZE_PRINTF ("protocol = SAMSUNGAH, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3152 | SAMSUNGAH_START_BIT_PULSE_LEN_MIN, SAMSUNGAH_START_BIT_PULSE_LEN_MAX,\r | |
3153 | SAMSUNGAH_START_BIT_PAUSE_LEN_MIN, SAMSUNGAH_START_BIT_PAUSE_LEN_MAX);\r | |
3154 | #endif // ANALYZE\r | |
3155 | irmp_param_p = (IRMP_PARAMETER *) &samsungah_param;\r | |
3156 | }\r | |
3157 | else\r | |
3158 | #endif // IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1\r | |
3159 | \r | |
3160 | #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r | |
3161 | if (irmp_pulse_time >= MATSUSHITA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MATSUSHITA_START_BIT_PULSE_LEN_MAX &&\r | |
3162 | irmp_pause_time >= MATSUSHITA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MATSUSHITA_START_BIT_PAUSE_LEN_MAX)\r | |
3163 | { // it's MATSUSHITA\r | |
3164 | #ifdef ANALYZE\r | |
3165 | ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3166 | MATSUSHITA_START_BIT_PULSE_LEN_MIN, MATSUSHITA_START_BIT_PULSE_LEN_MAX,\r | |
3167 | MATSUSHITA_START_BIT_PAUSE_LEN_MIN, MATSUSHITA_START_BIT_PAUSE_LEN_MAX);\r | |
3168 | #endif // ANALYZE\r | |
3169 | irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;\r | |
3170 | }\r | |
3171 | else\r | |
3172 | #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1\r | |
3173 | \r | |
3174 | #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
3175 | if (irmp_pulse_time >= KASEIKYO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KASEIKYO_START_BIT_PULSE_LEN_MAX &&\r | |
3176 | irmp_pause_time >= KASEIKYO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KASEIKYO_START_BIT_PAUSE_LEN_MAX)\r | |
3177 | { // it's KASEIKYO\r | |
3178 | #ifdef ANALYZE\r | |
3179 | ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3180 | KASEIKYO_START_BIT_PULSE_LEN_MIN, KASEIKYO_START_BIT_PULSE_LEN_MAX,\r | |
3181 | KASEIKYO_START_BIT_PAUSE_LEN_MIN, KASEIKYO_START_BIT_PAUSE_LEN_MAX);\r | |
3182 | #endif // ANALYZE\r | |
3183 | irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;\r | |
3184 | }\r | |
3185 | else\r | |
3186 | #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1\r | |
3187 | \r | |
3188 | #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r | |
3189 | if (irmp_pulse_time >= PANASONIC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PANASONIC_START_BIT_PULSE_LEN_MAX &&\r | |
3190 | irmp_pause_time >= PANASONIC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PANASONIC_START_BIT_PAUSE_LEN_MAX)\r | |
3191 | { // it's PANASONIC\r | |
3192 | #ifdef ANALYZE\r | |
3193 | ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3194 | PANASONIC_START_BIT_PULSE_LEN_MIN, PANASONIC_START_BIT_PULSE_LEN_MAX,\r | |
3195 | PANASONIC_START_BIT_PAUSE_LEN_MIN, PANASONIC_START_BIT_PAUSE_LEN_MAX);\r | |
3196 | #endif // ANALYZE\r | |
3197 | irmp_param_p = (IRMP_PARAMETER *) &panasonic_param;\r | |
3198 | }\r | |
3199 | else\r | |
3200 | #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1\r | |
3201 | \r | |
3202 | #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r | |
3203 | if (irmp_pulse_time >= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX &&\r | |
3204 | irmp_pause_time >= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX)\r | |
3205 | { // it's MITSU_HEAVY\r | |
3206 | #ifdef ANALYZE\r | |
3207 | ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3208 | MITSU_HEAVY_START_BIT_PULSE_LEN_MIN, MITSU_HEAVY_START_BIT_PULSE_LEN_MAX,\r | |
3209 | MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN, MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX);\r | |
3210 | #endif // ANALYZE\r | |
3211 | irmp_param_p = (IRMP_PARAMETER *) &mitsu_heavy_param;\r | |
3212 | }\r | |
3213 | else\r | |
3214 | #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1\r | |
3215 | \r | |
3216 | #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r | |
3217 | if (irmp_pulse_time >= VINCENT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= VINCENT_START_BIT_PULSE_LEN_MAX &&\r | |
3218 | irmp_pause_time >= VINCENT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= VINCENT_START_BIT_PAUSE_LEN_MAX)\r | |
3219 | { // it's VINCENT\r | |
3220 | #ifdef ANALYZE\r | |
3221 | ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3222 | VINCENT_START_BIT_PULSE_LEN_MIN, VINCENT_START_BIT_PULSE_LEN_MAX,\r | |
3223 | VINCENT_START_BIT_PAUSE_LEN_MIN, VINCENT_START_BIT_PAUSE_LEN_MAX);\r | |
3224 | #endif // ANALYZE\r | |
3225 | irmp_param_p = (IRMP_PARAMETER *) &vincent_param;\r | |
3226 | }\r | |
3227 | else\r | |
3228 | #endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1\r | |
3229 | \r | |
3230 | #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1\r | |
3231 | if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX &&\r | |
3232 | irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX)\r | |
3233 | {\r | |
3234 | #ifdef ANALYZE\r | |
3235 | ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3236 | RADIO1_START_BIT_PULSE_LEN_MIN, RADIO1_START_BIT_PULSE_LEN_MAX,\r | |
3237 | RADIO1_START_BIT_PAUSE_LEN_MIN, RADIO1_START_BIT_PAUSE_LEN_MAX);\r | |
3238 | #endif // ANALYZE\r | |
3239 | irmp_param_p = (IRMP_PARAMETER *) &radio1_param;\r | |
3240 | }\r | |
3241 | else\r | |
3242 | #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1\r | |
3243 | \r | |
3244 | #if IRMP_SUPPORT_RECS80_PROTOCOL == 1\r | |
3245 | if (irmp_pulse_time >= RECS80_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80_START_BIT_PULSE_LEN_MAX &&\r | |
3246 | irmp_pause_time >= RECS80_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80_START_BIT_PAUSE_LEN_MAX)\r | |
3247 | { // it's RECS80\r | |
3248 | #ifdef ANALYZE\r | |
3249 | ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3250 | RECS80_START_BIT_PULSE_LEN_MIN, RECS80_START_BIT_PULSE_LEN_MAX,\r | |
3251 | RECS80_START_BIT_PAUSE_LEN_MIN, RECS80_START_BIT_PAUSE_LEN_MAX);\r | |
3252 | #endif // ANALYZE\r | |
3253 | irmp_param_p = (IRMP_PARAMETER *) &recs80_param;\r | |
3254 | }\r | |
3255 | else\r | |
3256 | #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1\r | |
3257 | \r | |
3258 | #if IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
3259 | if (((irmp_pulse_time >= S100_START_BIT_LEN_MIN && irmp_pulse_time <= S100_START_BIT_LEN_MAX) ||\r | |
3260 | (irmp_pulse_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX)) &&\r | |
3261 | ((irmp_pause_time >= S100_START_BIT_LEN_MIN && irmp_pause_time <= S100_START_BIT_LEN_MAX) ||\r | |
3262 | (irmp_pause_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX)))\r | |
3263 | { // it's S100\r | |
3264 | #ifdef ANALYZE\r | |
3265 | ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3266 | S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r | |
3267 | 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX,\r | |
3268 | S100_START_BIT_LEN_MIN, S100_START_BIT_LEN_MAX,\r | |
3269 | 2 * S100_START_BIT_LEN_MIN, 2 * S100_START_BIT_LEN_MAX);\r | |
3270 | #endif // ANALYZE\r | |
3271 | \r | |
3272 | irmp_param_p = (IRMP_PARAMETER *) &s100_param;\r | |
3273 | last_pause = irmp_pause_time;\r | |
3274 | \r | |
3275 | if ((irmp_pulse_time > S100_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX) ||\r | |
3276 | (irmp_pause_time > S100_START_BIT_LEN_MAX && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX))\r | |
3277 | {\r | |
3278 | last_value = 0;\r | |
3279 | rc5_cmd_bit6 = 1<<6;\r | |
3280 | }\r | |
3281 | else\r | |
3282 | {\r | |
3283 | last_value = 1;\r | |
3284 | }\r | |
3285 | }\r | |
3286 | else\r | |
3287 | #endif // IRMP_SUPPORT_S100_PROTOCOL == 1\r | |
3288 | \r | |
3289 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1\r | |
3290 | if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||\r | |
3291 | (irmp_pulse_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX)) &&\r | |
3292 | ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||\r | |
3293 | (irmp_pause_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX)))\r | |
3294 | { // it's RC5\r | |
3295 | #if IRMP_SUPPORT_FDC_PROTOCOL == 1\r | |
3296 | if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&\r | |
3297 | irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)\r | |
3298 | {\r | |
3299 | #ifdef ANALYZE\r | |
3300 | ANALYZE_PRINTF ("protocol = RC5 or FDC\n");\r | |
3301 | ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3302 | FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r | |
3303 | FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r | |
3304 | ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3305 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r | |
3306 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX);\r | |
3307 | #endif // ANALYZE\r | |
3308 | memcpy_P (&irmp_param2, &fdc_param, sizeof (IRMP_PARAMETER));\r | |
3309 | }\r | |
3310 | else\r | |
3311 | #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r | |
3312 | \r | |
3313 | #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
3314 | if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r | |
3315 | irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r | |
3316 | {\r | |
3317 | #ifdef ANALYZE\r | |
3318 | ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");\r | |
3319 | ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3320 | RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r | |
3321 | RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r | |
3322 | ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3323 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r | |
3324 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX);\r | |
3325 | #endif // ANALYZE\r | |
3326 | memcpy_P (&irmp_param2, &rccar_param, sizeof (IRMP_PARAMETER));\r | |
3327 | }\r | |
3328 | else\r | |
3329 | #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
3330 | {\r | |
3331 | #ifdef ANALYZE\r | |
3332 | ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3333 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r | |
3334 | 2 * RC5_START_BIT_LEN_MIN, 2 * RC5_START_BIT_LEN_MAX,\r | |
3335 | RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,\r | |
3336 | 2 * RC5_START_BIT_LEN_MIN, 2 * RC5_START_BIT_LEN_MAX);\r | |
3337 | #endif // ANALYZE\r | |
3338 | }\r | |
3339 | \r | |
3340 | irmp_param_p = (IRMP_PARAMETER *) &rc5_param;\r | |
3341 | last_pause = irmp_pause_time;\r | |
3342 | \r | |
3343 | if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX) ||\r | |
3344 | (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX))\r | |
3345 | {\r | |
3346 | last_value = 0;\r | |
3347 | rc5_cmd_bit6 = 1<<6;\r | |
3348 | }\r | |
3349 | else\r | |
3350 | {\r | |
3351 | last_value = 1;\r | |
3352 | }\r | |
3353 | }\r | |
3354 | else\r | |
3355 | #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1\r | |
3356 | \r | |
3357 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
3358 | if ( (irmp_pulse_time >= DENON_PULSE_LEN_MIN && irmp_pulse_time <= DENON_PULSE_LEN_MAX) &&\r | |
3359 | ((irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX) ||\r | |
3360 | (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)))\r | |
3361 | { // it's DENON\r | |
3362 | #ifdef ANALYZE\r | |
3363 | ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r | |
3364 | DENON_PULSE_LEN_MIN, DENON_PULSE_LEN_MAX,\r | |
3365 | DENON_1_PAUSE_LEN_MIN, DENON_1_PAUSE_LEN_MAX,\r | |
3366 | DENON_0_PAUSE_LEN_MIN, DENON_0_PAUSE_LEN_MAX);\r | |
3367 | #endif // ANALYZE\r | |
3368 | irmp_param_p = (IRMP_PARAMETER *) &denon_param;\r | |
3369 | }\r | |
3370 | else\r | |
3371 | #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
3372 | \r | |
3373 | #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r | |
3374 | if ( (irmp_pulse_time >= THOMSON_PULSE_LEN_MIN && irmp_pulse_time <= THOMSON_PULSE_LEN_MAX) &&\r | |
3375 | ((irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX) ||\r | |
3376 | (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)))\r | |
3377 | { // it's THOMSON\r | |
3378 | #ifdef ANALYZE\r | |
3379 | ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r | |
3380 | THOMSON_PULSE_LEN_MIN, THOMSON_PULSE_LEN_MAX,\r | |
3381 | THOMSON_1_PAUSE_LEN_MIN, THOMSON_1_PAUSE_LEN_MAX,\r | |
3382 | THOMSON_0_PAUSE_LEN_MIN, THOMSON_0_PAUSE_LEN_MAX);\r | |
3383 | #endif // ANALYZE\r | |
3384 | irmp_param_p = (IRMP_PARAMETER *) &thomson_param;\r | |
3385 | }\r | |
3386 | else\r | |
3387 | #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r | |
3388 | \r | |
3389 | #if IRMP_SUPPORT_BOSE_PROTOCOL == 1\r | |
3390 | if (irmp_pulse_time >= BOSE_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= BOSE_START_BIT_PULSE_LEN_MAX &&\r | |
3391 | irmp_pause_time >= BOSE_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BOSE_START_BIT_PAUSE_LEN_MAX)\r | |
3392 | {\r | |
3393 | #ifdef ANALYZE\r | |
3394 | ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3395 | BOSE_START_BIT_PULSE_LEN_MIN, BOSE_START_BIT_PULSE_LEN_MAX,\r | |
3396 | BOSE_START_BIT_PAUSE_LEN_MIN, BOSE_START_BIT_PAUSE_LEN_MAX);\r | |
3397 | #endif // ANALYZE\r | |
3398 | irmp_param_p = (IRMP_PARAMETER *) &bose_param;\r | |
3399 | }\r | |
3400 | else\r | |
3401 | #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1\r | |
3402 | \r | |
3403 | #if IRMP_SUPPORT_RC6_PROTOCOL == 1\r | |
3404 | if (irmp_pulse_time >= RC6_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RC6_START_BIT_PULSE_LEN_MAX &&\r | |
3405 | irmp_pause_time >= RC6_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RC6_START_BIT_PAUSE_LEN_MAX)\r | |
3406 | { // it's RC6\r | |
3407 | #ifdef ANALYZE\r | |
3408 | ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3409 | RC6_START_BIT_PULSE_LEN_MIN, RC6_START_BIT_PULSE_LEN_MAX,\r | |
3410 | RC6_START_BIT_PAUSE_LEN_MIN, RC6_START_BIT_PAUSE_LEN_MAX);\r | |
3411 | #endif // ANALYZE\r | |
3412 | irmp_param_p = (IRMP_PARAMETER *) &rc6_param;\r | |
3413 | last_pause = 0;\r | |
3414 | last_value = 1;\r | |
3415 | }\r | |
3416 | else\r | |
3417 | #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1\r | |
3418 | \r | |
3419 | #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r | |
3420 | if (irmp_pulse_time >= RECS80EXT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80EXT_START_BIT_PULSE_LEN_MAX &&\r | |
3421 | irmp_pause_time >= RECS80EXT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80EXT_START_BIT_PAUSE_LEN_MAX)\r | |
3422 | { // it's RECS80EXT\r | |
3423 | #ifdef ANALYZE\r | |
3424 | ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3425 | RECS80EXT_START_BIT_PULSE_LEN_MIN, RECS80EXT_START_BIT_PULSE_LEN_MAX,\r | |
3426 | RECS80EXT_START_BIT_PAUSE_LEN_MIN, RECS80EXT_START_BIT_PAUSE_LEN_MAX);\r | |
3427 | #endif // ANALYZE\r | |
3428 | irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;\r | |
3429 | }\r | |
3430 | else\r | |
3431 | #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1\r | |
3432 | \r | |
3433 | #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r | |
3434 | if (irmp_pulse_time >= NUBERT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NUBERT_START_BIT_PULSE_LEN_MAX &&\r | |
3435 | irmp_pause_time >= NUBERT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NUBERT_START_BIT_PAUSE_LEN_MAX)\r | |
3436 | { // it's NUBERT\r | |
3437 | #ifdef ANALYZE\r | |
3438 | ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3439 | NUBERT_START_BIT_PULSE_LEN_MIN, NUBERT_START_BIT_PULSE_LEN_MAX,\r | |
3440 | NUBERT_START_BIT_PAUSE_LEN_MIN, NUBERT_START_BIT_PAUSE_LEN_MAX);\r | |
3441 | #endif // ANALYZE\r | |
3442 | irmp_param_p = (IRMP_PARAMETER *) &nubert_param;\r | |
3443 | }\r | |
3444 | else\r | |
3445 | #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1\r | |
3446 | \r | |
3447 | #if IRMP_SUPPORT_FAN_PROTOCOL == 1\r | |
3448 | if (irmp_pulse_time >= FAN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FAN_START_BIT_PULSE_LEN_MAX &&\r | |
3449 | irmp_pause_time >= FAN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FAN_START_BIT_PAUSE_LEN_MAX)\r | |
3450 | { // it's FAN\r | |
3451 | #ifdef ANALYZE\r | |
3452 | ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3453 | FAN_START_BIT_PULSE_LEN_MIN, FAN_START_BIT_PULSE_LEN_MAX,\r | |
3454 | FAN_START_BIT_PAUSE_LEN_MIN, FAN_START_BIT_PAUSE_LEN_MAX);\r | |
3455 | #endif // ANALYZE\r | |
3456 | irmp_param_p = (IRMP_PARAMETER *) &fan_param;\r | |
3457 | }\r | |
3458 | else\r | |
3459 | #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1\r | |
3460 | \r | |
3461 | #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r | |
3462 | if (irmp_pulse_time >= SPEAKER_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SPEAKER_START_BIT_PULSE_LEN_MAX &&\r | |
3463 | irmp_pause_time >= SPEAKER_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SPEAKER_START_BIT_PAUSE_LEN_MAX)\r | |
3464 | { // it's SPEAKER\r | |
3465 | #ifdef ANALYZE\r | |
3466 | ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3467 | SPEAKER_START_BIT_PULSE_LEN_MIN, SPEAKER_START_BIT_PULSE_LEN_MAX,\r | |
3468 | SPEAKER_START_BIT_PAUSE_LEN_MIN, SPEAKER_START_BIT_PAUSE_LEN_MAX);\r | |
3469 | #endif // ANALYZE\r | |
3470 | irmp_param_p = (IRMP_PARAMETER *) &speaker_param;\r | |
3471 | }\r | |
3472 | else\r | |
3473 | #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1\r | |
3474 | \r | |
3475 | #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r | |
3476 | if (irmp_pulse_time >= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX &&\r | |
3477 | irmp_pause_time >= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX)\r | |
3478 | { // it's BANG_OLUFSEN\r | |
3479 | #ifdef ANALYZE\r | |
3480 | ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");\r | |
3481 | ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3482 | BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX,\r | |
3483 | BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX);\r | |
3484 | ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3485 | BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX,\r | |
3486 | BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX);\r | |
3487 | ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3488 | BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX,\r | |
3489 | BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX);\r | |
3490 | ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3491 | BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX,\r | |
3492 | BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX);\r | |
3493 | #endif // ANALYZE\r | |
3494 | irmp_param_p = (IRMP_PARAMETER *) &bang_olufsen_param;\r | |
3495 | last_value = 0;\r | |
3496 | }\r | |
3497 | else\r | |
3498 | #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r | |
3499 | \r | |
3500 | #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r | |
3501 | if (irmp_pulse_time >= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN && irmp_pulse_time <= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX &&\r | |
3502 | irmp_pause_time >= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN && irmp_pause_time <= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX)\r | |
3503 | { // it's GRUNDIG\r | |
3504 | #ifdef ANALYZE\r | |
3505 | ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3506 | GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX,\r | |
3507 | GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX);\r | |
3508 | #endif // ANALYZE\r | |
3509 | irmp_param_p = (IRMP_PARAMETER *) &grundig_param;\r | |
3510 | last_pause = irmp_pause_time;\r | |
3511 | last_value = 1;\r | |
3512 | }\r | |
3513 | else\r | |
3514 | #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r | |
3515 | \r | |
3516 | #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!\r | |
3517 | if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&\r | |
3518 | irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)\r | |
3519 | { // it's MERLIN\r | |
3520 | #ifdef ANALYZE\r | |
3521 | ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3522 | MERLIN_START_BIT_PULSE_LEN_MIN, MERLIN_START_BIT_PULSE_LEN_MAX,\r | |
3523 | MERLIN_START_BIT_PAUSE_LEN_MIN, MERLIN_START_BIT_PAUSE_LEN_MAX);\r | |
3524 | #endif // ANALYZE\r | |
3525 | irmp_param_p = (IRMP_PARAMETER *) &merlin_param;\r | |
3526 | last_pause = 0;\r | |
3527 | last_value = 1;\r | |
3528 | }\r | |
3529 | else\r | |
3530 | #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1\r | |
3531 | \r | |
3532 | #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r | |
3533 | if (((irmp_pulse_time >= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX) ||\r | |
3534 | (irmp_pulse_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX)) &&\r | |
3535 | ((irmp_pause_time >= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX) ||\r | |
3536 | (irmp_pause_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX)))\r | |
3537 | { // it's RUWIDO or SIEMENS\r | |
3538 | #ifdef ANALYZE\r | |
3539 | ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",\r | |
3540 | SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r | |
3541 | 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX,\r | |
3542 | SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX,\r | |
3543 | 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX);\r | |
3544 | #endif // ANALYZE\r | |
3545 | irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;\r | |
3546 | last_pause = irmp_pause_time;\r | |
3547 | last_value = 1;\r | |
3548 | }\r | |
3549 | else\r | |
3550 | #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r | |
3551 | \r | |
3552 | #if IRMP_SUPPORT_FDC_PROTOCOL == 1\r | |
3553 | if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&\r | |
3554 | irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)\r | |
3555 | {\r | |
3556 | #ifdef ANALYZE\r | |
3557 | ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3558 | FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX,\r | |
3559 | FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX);\r | |
3560 | #endif // ANALYZE\r | |
3561 | irmp_param_p = (IRMP_PARAMETER *) &fdc_param;\r | |
3562 | }\r | |
3563 | else\r | |
3564 | #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1\r | |
3565 | \r | |
3566 | #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
3567 | if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&\r | |
3568 | irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)\r | |
3569 | {\r | |
3570 | #ifdef ANALYZE\r | |
3571 | ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3572 | RCCAR_START_BIT_PULSE_LEN_MIN, RCCAR_START_BIT_PULSE_LEN_MAX,\r | |
3573 | RCCAR_START_BIT_PAUSE_LEN_MIN, RCCAR_START_BIT_PAUSE_LEN_MAX);\r | |
3574 | #endif // ANALYZE\r | |
3575 | irmp_param_p = (IRMP_PARAMETER *) &rccar_param;\r | |
3576 | }\r | |
3577 | else\r | |
3578 | #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1\r | |
3579 | \r | |
3580 | #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r | |
3581 | if (irmp_pulse_time >= KATHREIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KATHREIN_START_BIT_PULSE_LEN_MAX &&\r | |
3582 | irmp_pause_time >= KATHREIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_START_BIT_PAUSE_LEN_MAX)\r | |
3583 | { // it's KATHREIN\r | |
3584 | #ifdef ANALYZE\r | |
3585 | ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3586 | KATHREIN_START_BIT_PULSE_LEN_MIN, KATHREIN_START_BIT_PULSE_LEN_MAX,\r | |
3587 | KATHREIN_START_BIT_PAUSE_LEN_MIN, KATHREIN_START_BIT_PAUSE_LEN_MAX);\r | |
3588 | #endif // ANALYZE\r | |
3589 | irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;\r | |
3590 | }\r | |
3591 | else\r | |
3592 | #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1\r | |
3593 | \r | |
3594 | #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
3595 | if (irmp_pulse_time >= NETBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NETBOX_START_BIT_PULSE_LEN_MAX &&\r | |
3596 | irmp_pause_time >= NETBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NETBOX_START_BIT_PAUSE_LEN_MAX)\r | |
3597 | { // it's NETBOX\r | |
3598 | #ifdef ANALYZE\r | |
3599 | ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3600 | NETBOX_START_BIT_PULSE_LEN_MIN, NETBOX_START_BIT_PULSE_LEN_MAX,\r | |
3601 | NETBOX_START_BIT_PAUSE_LEN_MIN, NETBOX_START_BIT_PAUSE_LEN_MAX);\r | |
3602 | #endif // ANALYZE\r | |
3603 | irmp_param_p = (IRMP_PARAMETER *) &netbox_param;\r | |
3604 | }\r | |
3605 | else\r | |
3606 | #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1\r | |
3607 | \r | |
3608 | #if IRMP_SUPPORT_LEGO_PROTOCOL == 1\r | |
3609 | if (irmp_pulse_time >= LEGO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= LEGO_START_BIT_PULSE_LEN_MAX &&\r | |
3610 | irmp_pause_time >= LEGO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= LEGO_START_BIT_PAUSE_LEN_MAX)\r | |
3611 | {\r | |
3612 | #ifdef ANALYZE\r | |
3613 | ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3614 | LEGO_START_BIT_PULSE_LEN_MIN, LEGO_START_BIT_PULSE_LEN_MAX,\r | |
3615 | LEGO_START_BIT_PAUSE_LEN_MIN, LEGO_START_BIT_PAUSE_LEN_MAX);\r | |
3616 | #endif // ANALYZE\r | |
3617 | irmp_param_p = (IRMP_PARAMETER *) &lego_param;\r | |
3618 | }\r | |
3619 | else\r | |
3620 | #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1\r | |
3621 | \r | |
3622 | #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r | |
3623 | if (irmp_pulse_time >= A1TVBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= A1TVBOX_START_BIT_PULSE_LEN_MAX &&\r | |
3624 | irmp_pause_time >= A1TVBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= A1TVBOX_START_BIT_PAUSE_LEN_MAX)\r | |
3625 | { // it's A1TVBOX\r | |
3626 | #ifdef ANALYZE\r | |
3627 | ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3628 | A1TVBOX_START_BIT_PULSE_LEN_MIN, A1TVBOX_START_BIT_PULSE_LEN_MAX,\r | |
3629 | A1TVBOX_START_BIT_PAUSE_LEN_MIN, A1TVBOX_START_BIT_PAUSE_LEN_MAX);\r | |
3630 | #endif // ANALYZE\r | |
3631 | irmp_param_p = (IRMP_PARAMETER *) &a1tvbox_param;\r | |
3632 | last_pause = 0;\r | |
3633 | last_value = 1;\r | |
3634 | }\r | |
3635 | else\r | |
3636 | #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1\r | |
3637 | \r | |
3638 | #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
3639 | if (irmp_pulse_time >= ORTEK_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ORTEK_START_BIT_PULSE_LEN_MAX &&\r | |
3640 | irmp_pause_time >= ORTEK_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ORTEK_START_BIT_PAUSE_LEN_MAX)\r | |
3641 | { // it's ORTEK (Hama)\r | |
3642 | #ifdef ANALYZE\r | |
3643 | ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3644 | ORTEK_START_BIT_PULSE_LEN_MIN, ORTEK_START_BIT_PULSE_LEN_MAX,\r | |
3645 | ORTEK_START_BIT_PAUSE_LEN_MIN, ORTEK_START_BIT_PAUSE_LEN_MAX);\r | |
3646 | #endif // ANALYZE\r | |
3647 | irmp_param_p = (IRMP_PARAMETER *) &ortek_param;\r | |
3648 | last_pause = 0;\r | |
3649 | last_value = 1;\r | |
3650 | parity = 0;\r | |
3651 | }\r | |
3652 | else\r | |
3653 | #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1\r | |
3654 | \r | |
3655 | #if IRMP_SUPPORT_RCMM_PROTOCOL == 1\r | |
3656 | if (irmp_pulse_time >= RCMM32_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCMM32_START_BIT_PULSE_LEN_MAX &&\r | |
3657 | irmp_pause_time >= RCMM32_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_START_BIT_PAUSE_LEN_MAX)\r | |
3658 | { // it's RCMM\r | |
3659 | #ifdef ANALYZE\r | |
3660 | ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",\r | |
3661 | RCMM32_START_BIT_PULSE_LEN_MIN, RCMM32_START_BIT_PULSE_LEN_MAX,\r | |
3662 | RCMM32_START_BIT_PAUSE_LEN_MIN, RCMM32_START_BIT_PAUSE_LEN_MAX);\r | |
3663 | #endif // ANALYZE\r | |
3664 | irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;\r | |
3665 | }\r | |
3666 | else\r | |
3667 | #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1\r | |
3668 | {\r | |
3669 | #ifdef ANALYZE\r | |
3670 | ANALYZE_PRINTF ("protocol = UNKNOWN\n");\r | |
3671 | #endif // ANALYZE\r | |
3672 | irmp_start_bit_detected = 0; // wait for another start bit...\r | |
3673 | }\r | |
3674 | \r | |
3675 | if (irmp_start_bit_detected)\r | |
3676 | {\r | |
3677 | memcpy_P (&irmp_param, irmp_param_p, sizeof (IRMP_PARAMETER));\r | |
3678 | \r | |
3679 | if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r | |
3680 | {\r | |
3681 | #ifdef ANALYZE\r | |
3682 | ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max);\r | |
3683 | ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max);\r | |
3684 | #endif // ANALYZE\r | |
3685 | }\r | |
3686 | else\r | |
3687 | {\r | |
3688 | #ifdef ANALYZE\r | |
3689 | ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max,\r | |
3690 | 2 * irmp_param.pulse_1_len_min, 2 * irmp_param.pulse_1_len_max);\r | |
3691 | ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max,\r | |
3692 | 2 * irmp_param.pause_1_len_min, 2 * irmp_param.pause_1_len_max);\r | |
3693 | #endif // ANALYZE\r | |
3694 | }\r | |
3695 | \r | |
3696 | #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)\r | |
3697 | if (irmp_param2.protocol)\r | |
3698 | {\r | |
3699 | #ifdef ANALYZE\r | |
3700 | ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2.pulse_0_len_min, irmp_param2.pulse_0_len_max);\r | |
3701 | ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2.pause_0_len_min, irmp_param2.pause_0_len_max);\r | |
3702 | ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2.pulse_1_len_min, irmp_param2.pulse_1_len_max);\r | |
3703 | ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2.pause_1_len_min, irmp_param2.pause_1_len_max);\r | |
3704 | #endif // ANALYZE\r | |
3705 | }\r | |
3706 | #endif\r | |
3707 | \r | |
3708 | \r | |
3709 | #if IRMP_SUPPORT_RC6_PROTOCOL == 1\r | |
3710 | if (irmp_param.protocol == IRMP_RC6_PROTOCOL)\r | |
3711 | {\r | |
3712 | #ifdef ANALYZE\r | |
3713 | ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN, RC6_TOGGLE_BIT_LEN_MAX);\r | |
3714 | #endif // ANALYZE\r | |
3715 | }\r | |
3716 | #endif\r | |
3717 | \r | |
3718 | if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r | |
3719 | {\r | |
3720 | #ifdef ANALYZE\r | |
3721 | ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r | |
3722 | ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max);\r | |
3723 | #endif // ANALYZE\r | |
3724 | }\r | |
3725 | else\r | |
3726 | {\r | |
3727 | #ifdef ANALYZE\r | |
3728 | ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max,\r | |
3729 | 2 * irmp_param.pulse_0_len_min, 2 * irmp_param.pulse_0_len_max);\r | |
3730 | ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max,\r | |
3731 | 2 * irmp_param.pause_0_len_min, 2 * irmp_param.pause_0_len_max);\r | |
3732 | #endif // ANALYZE\r | |
3733 | }\r | |
3734 | \r | |
3735 | #ifdef ANALYZE\r | |
3736 | #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1\r | |
3737 | if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)\r | |
3738 | {\r | |
3739 | ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r | |
3740 | ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN, BANG_OLUFSEN_R_PAUSE_LEN_MAX);\r | |
3741 | }\r | |
3742 | #endif\r | |
3743 | \r | |
3744 | ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param.command_offset);\r | |
3745 | ANALYZE_PRINTF ("command_len: %3d\n", irmp_param.command_end - irmp_param.command_offset);\r | |
3746 | ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param.complete_len);\r | |
3747 | ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param.stop_bit);\r | |
3748 | #endif // ANALYZE\r | |
3749 | }\r | |
3750 | \r | |
3751 | irmp_bit = 0;\r | |
3752 | \r | |
3753 | #if IRMP_SUPPORT_MANCHESTER == 1\r | |
3754 | if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r | |
3755 | irmp_param.protocol != IRMP_RUWIDO_PROTOCOL && // Manchester, but not RUWIDO\r | |
3756 | irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6\r | |
3757 | {\r | |
3758 | if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= 2 * irmp_param.pulse_1_len_max)\r | |
3759 | {\r | |
3760 | #ifdef ANALYZE\r | |
3761 | ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r | |
3762 | ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');\r | |
3763 | ANALYZE_NEWLINE ();\r | |
3764 | #endif // ANALYZE\r | |
3765 | irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1);\r | |
3766 | }\r | |
3767 | else if (! last_value) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)\r | |
3768 | {\r | |
3769 | #ifdef ANALYZE\r | |
3770 | ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r | |
3771 | ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');\r | |
3772 | ANALYZE_NEWLINE ();\r | |
3773 | #endif // ANALYZE\r | |
3774 | irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0);\r | |
3775 | }\r | |
3776 | }\r | |
3777 | else\r | |
3778 | #endif // IRMP_SUPPORT_MANCHESTER == 1\r | |
3779 | \r | |
3780 | #if IRMP_SUPPORT_SERIAL == 1\r | |
3781 | if (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL)\r | |
3782 | {\r | |
3783 | ; // do nothing\r | |
3784 | }\r | |
3785 | else\r | |
3786 | #endif // IRMP_SUPPORT_SERIAL == 1\r | |
3787 | \r | |
3788 | \r | |
3789 | #if IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
3790 | if (irmp_param.protocol == IRMP_DENON_PROTOCOL)\r | |
3791 | {\r | |
3792 | #ifdef ANALYZE\r | |
3793 | ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r | |
3794 | #endif // ANALYZE\r | |
3795 | \r | |
3796 | if (irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX)\r | |
3797 | { // pause timings correct for "1"?\r | |
3798 | #ifdef ANALYZE\r | |
3799 | ANALYZE_PUTCHAR ('1'); // yes, store 1\r | |
3800 | ANALYZE_NEWLINE ();\r | |
3801 | #endif // ANALYZE\r | |
3802 | irmp_store_bit (1);\r | |
3803 | }\r | |
3804 | else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)\r | |
3805 | { // pause timings correct for "0"?\r | |
3806 | #ifdef ANALYZE\r | |
3807 | ANALYZE_PUTCHAR ('0'); // yes, store 0\r | |
3808 | ANALYZE_NEWLINE ();\r | |
3809 | #endif // ANALYZE\r | |
3810 | irmp_store_bit (0);\r | |
3811 | }\r | |
3812 | }\r | |
3813 | else\r | |
3814 | #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1\r | |
3815 | #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r | |
3816 | if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)\r | |
3817 | {\r | |
3818 | #ifdef ANALYZE\r | |
3819 | ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);\r | |
3820 | #endif // ANALYZE\r | |
3821 | \r | |
3822 | if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)\r | |
3823 | { // pause timings correct for "1"?\r | |
3824 | #ifdef ANALYZE\r | |
3825 | ANALYZE_PUTCHAR ('1'); // yes, store 1\r | |
3826 | ANALYZE_NEWLINE ();\r | |
3827 | #endif // ANALYZE\r | |
3828 | irmp_store_bit (1);\r | |
3829 | }\r | |
3830 | else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)\r | |
3831 | { // pause timings correct for "0"?\r | |
3832 | #ifdef ANALYZE\r | |
3833 | ANALYZE_PUTCHAR ('0'); // yes, store 0\r | |
3834 | ANALYZE_NEWLINE ();\r | |
3835 | #endif // ANALYZE\r | |
3836 | irmp_store_bit (0);\r | |
3837 | }\r | |
3838 | }\r | |
3839 | else\r | |
3840 | #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1\r | |
3841 | {\r | |
3842 | ; // else do nothing\r | |
3843 | }\r | |
3844 | \r | |
3845 | irmp_pulse_time = 1; // set counter to 1, not 0\r | |
3846 | irmp_pause_time = 0;\r | |
3847 | wait_for_start_space = 0;\r | |
3848 | }\r | |
3849 | }\r | |
3850 | else if (wait_for_space) // the data section....\r | |
3851 | { // counting the time of darkness....\r | |
3852 | uint_fast8_t got_light = FALSE;\r | |
3853 | \r | |
3854 | if (irmp_input) // still dark?\r | |
3855 | { // yes...\r | |
3856 | if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)\r | |
3857 | {\r | |
3858 | if (\r | |
3859 | #if IRMP_SUPPORT_MANCHESTER == 1\r | |
3860 | (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) ||\r | |
3861 | #endif\r | |
3862 | #if IRMP_SUPPORT_SERIAL == 1\r | |
3863 | (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) ||\r | |
3864 | #endif\r | |
3865 | (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max))\r | |
3866 | {\r | |
3867 | #ifdef ANALYZE\r | |
3868 | if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))\r | |
3869 | {\r | |
3870 | ANALYZE_PRINTF ("stop bit detected\n");\r | |
3871 | }\r | |
3872 | #endif // ANALYZE\r | |
3873 | irmp_param.stop_bit = 0;\r | |
3874 | }\r | |
3875 | else\r | |
3876 | {\r | |
3877 | #ifdef ANALYZE\r | |
3878 | ANALYZE_PRINTF ("error: stop bit timing wrong, irmp_bit = %d, irmp_pulse_time = %d, pulse_0_len_min = %d, pulse_0_len_max = %d\n",\r | |
3879 | irmp_bit, irmp_pulse_time, irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);\r | |
3880 | #endif // ANALYZE\r | |
3881 | irmp_start_bit_detected = 0; // wait for another start bit...\r | |
3882 | irmp_pulse_time = 0;\r | |
3883 | irmp_pause_time = 0;\r | |
3884 | }\r | |
3885 | }\r | |
3886 | else\r | |
3887 | {\r | |
3888 | irmp_pause_time++; // increment counter\r | |
3889 | \r | |
3890 | #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1\r | |
3891 | if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && // Sony has a variable number of bits:\r | |
3892 | irmp_pause_time > SIRCS_PAUSE_LEN_MAX && // minimum is 12\r | |
3893 | irmp_bit >= 12 - 1) // pause too long?\r | |
3894 | { // yes, break and close this frame\r | |
3895 | irmp_param.complete_len = irmp_bit + 1; // set new complete length\r | |
3896 | got_light = TRUE; // this is a lie, but helps (generates stop bit)\r | |
3897 | irmp_tmp_address |= (irmp_bit - SIRCS_MINIMUM_DATA_LEN + 1) << 8; // new: store number of additional bits in upper byte of address!\r | |
3898 | irmp_param.command_end = irmp_param.command_offset + irmp_bit + 1; // correct command length\r | |
3899 | irmp_pause_time = SIRCS_PAUSE_LEN_MAX - 1; // correct pause length\r | |
3900 | }\r | |
3901 | else\r | |
3902 | #endif\r | |
3903 | #if IRMP_SUPPORT_FAN_PROTOCOL == 1\r | |
3904 | if (irmp_param.protocol == IRMP_FAN_PROTOCOL && // FAN has no stop bit.\r | |
3905 | irmp_bit >= FAN_COMPLETE_DATA_LEN - 1) // last bit in frame\r | |
3906 | { // yes, break and close this frame\r | |
3907 | if (irmp_pulse_time <= FAN_0_PULSE_LEN_MAX && irmp_pause_time >= FAN_0_PAUSE_LEN_MIN)\r | |
3908 | {\r | |
3909 | #ifdef ANALYZE\r | |
3910 | ANALYZE_PRINTF ("Generating virtual stop bit\n");\r | |
3911 | #endif // ANALYZE\r | |
3912 | got_light = TRUE; // this is a lie, but helps (generates stop bit)\r | |
3913 | }\r | |
3914 | else if (irmp_pulse_time >= FAN_1_PULSE_LEN_MIN && irmp_pause_time >= FAN_1_PAUSE_LEN_MIN)\r | |
3915 | {\r | |
3916 | #ifdef ANALYZE\r | |
3917 | ANALYZE_PRINTF ("Generating virtual stop bit\n");\r | |
3918 | #endif // ANALYZE\r | |
3919 | got_light = TRUE; // this is a lie, but helps (generates stop bit)\r | |
3920 | }\r | |
3921 | }\r | |
3922 | else\r | |
3923 | #endif\r | |
3924 | #if IRMP_SUPPORT_SERIAL == 1\r | |
3925 | // NETBOX generates no stop bit, here is the timeout condition:\r | |
3926 | if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) && irmp_param.protocol == IRMP_NETBOX_PROTOCOL &&\r | |
3927 | irmp_pause_time >= NETBOX_PULSE_LEN * (NETBOX_COMPLETE_DATA_LEN - irmp_bit))\r | |
3928 | {\r | |
3929 | got_light = TRUE; // this is a lie, but helps (generates stop bit)\r | |
3930 | }\r | |
3931 | else\r | |
3932 | #endif\r | |
3933 | #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1\r | |
3934 | if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)\r | |
3935 | {\r | |
3936 | if (irmp_pause_time > IR60_TIMEOUT_LEN && (irmp_bit == 5 || irmp_bit == 6))\r | |
3937 | {\r | |
3938 | #ifdef ANALYZE\r | |
3939 | ANALYZE_PRINTF ("Switching to IR60 protocol\n");\r | |
3940 | #endif // ANALYZE\r | |
3941 | got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r | |
3942 | irmp_param.stop_bit = TRUE; // set flag\r | |
3943 | \r | |
3944 | irmp_param.protocol = IRMP_IR60_PROTOCOL; // change protocol\r | |
3945 | irmp_param.complete_len = IR60_COMPLETE_DATA_LEN; // correct complete len\r | |
3946 | irmp_param.address_offset = IR60_ADDRESS_OFFSET;\r | |
3947 | irmp_param.address_end = IR60_ADDRESS_OFFSET + IR60_ADDRESS_LEN;\r | |
3948 | irmp_param.command_offset = IR60_COMMAND_OFFSET;\r | |
3949 | irmp_param.command_end = IR60_COMMAND_OFFSET + IR60_COMMAND_LEN;\r | |
3950 | \r | |
3951 | irmp_tmp_command <<= 1;\r | |
3952 | irmp_tmp_command |= first_bit;\r | |
3953 | }\r | |
3954 | else if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)\r | |
3955 | { // special manchester decoder\r | |
3956 | irmp_param.complete_len = GRUNDIG_COMPLETE_DATA_LEN; // correct complete len\r | |
3957 | got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r | |
3958 | irmp_param.stop_bit = TRUE; // set flag\r | |
3959 | }\r | |
3960 | else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)\r | |
3961 | {\r | |
3962 | #ifdef ANALYZE\r | |
3963 | ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit);\r | |
3964 | #endif // ANALYZE\r | |
3965 | irmp_param.protocol = IRMP_NOKIA_PROTOCOL; // change protocol\r | |
3966 | irmp_param.address_offset = NOKIA_ADDRESS_OFFSET;\r | |
3967 | irmp_param.address_end = NOKIA_ADDRESS_OFFSET + NOKIA_ADDRESS_LEN;\r | |
3968 | irmp_param.command_offset = NOKIA_COMMAND_OFFSET;\r | |
3969 | irmp_param.command_end = NOKIA_COMMAND_OFFSET + NOKIA_COMMAND_LEN;\r | |
3970 | \r | |
3971 | if (irmp_tmp_command & 0x300)\r | |
3972 | {\r | |
3973 | irmp_tmp_address = (irmp_tmp_command >> 8);\r | |
3974 | irmp_tmp_command &= 0xFF;\r | |
3975 | }\r | |
3976 | }\r | |
3977 | }\r | |
3978 | else\r | |
3979 | #endif\r | |
3980 | #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1\r | |
3981 | if (irmp_param.protocol == IRMP_RUWIDO_PROTOCOL && !irmp_param.stop_bit)\r | |
3982 | {\r | |
3983 | if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= RUWIDO_COMPLETE_DATA_LEN - 2)\r | |
3984 | { // special manchester decoder\r | |
3985 | irmp_param.complete_len = RUWIDO_COMPLETE_DATA_LEN; // correct complete len\r | |
3986 | got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r | |
3987 | irmp_param.stop_bit = TRUE; // set flag\r | |
3988 | }\r | |
3989 | else if (irmp_bit >= RUWIDO_COMPLETE_DATA_LEN)\r | |
3990 | {\r | |
3991 | #ifdef ANALYZE\r | |
3992 | ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");\r | |
3993 | #endif // ANALYZE\r | |
3994 | irmp_param.protocol = IRMP_SIEMENS_PROTOCOL; // change protocol\r | |
3995 | irmp_param.address_offset = SIEMENS_ADDRESS_OFFSET;\r | |
3996 | irmp_param.address_end = SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN;\r | |
3997 | irmp_param.command_offset = SIEMENS_COMMAND_OFFSET;\r | |
3998 | irmp_param.command_end = SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN;\r | |
3999 | \r | |
4000 | // 76543210\r | |
4001 | // RUWIDO: AAAAAAAAACCCCCCCp\r | |
4002 | // SIEMENS: AAAAAAAAAAACCCCCCCCCCp\r | |
4003 | irmp_tmp_address <<= 2;\r | |
4004 | irmp_tmp_address |= (irmp_tmp_command >> 6);\r | |
4005 | irmp_tmp_command &= 0x003F;\r | |
4006 | // irmp_tmp_command <<= 4;\r | |
4007 | irmp_tmp_command |= last_value;\r | |
4008 | }\r | |
4009 | }\r | |
4010 | else\r | |
4011 | #endif\r | |
4012 | #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1\r | |
4013 | if (irmp_param.protocol == IRMP_ROOMBA_PROTOCOL && // Roomba has no stop bit\r | |
4014 | irmp_bit >= ROOMBA_COMPLETE_DATA_LEN - 1) // it's the last data bit...\r | |
4015 | { // break and close this frame\r | |
4016 | if (irmp_pulse_time >= ROOMBA_1_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_1_PULSE_LEN_MAX)\r | |
4017 | {\r | |
4018 | irmp_pause_time = ROOMBA_1_PAUSE_LEN_EXACT;\r | |
4019 | }\r | |
4020 | else if (irmp_pulse_time >= ROOMBA_0_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_0_PULSE_LEN_MAX)\r | |
4021 | {\r | |
4022 | irmp_pause_time = ROOMBA_0_PAUSE_LEN;\r | |
4023 | }\r | |
4024 | \r | |
4025 | got_light = TRUE; // this is a lie, but helps (generates stop bit)\r | |
4026 | }\r | |
4027 | else\r | |
4028 | #endif\r | |
4029 | #if IRMP_SUPPORT_MANCHESTER == 1\r | |
4030 | if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&\r | |
4031 | irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)\r | |
4032 | { // special manchester decoder\r | |
4033 | got_light = TRUE; // this is a lie, but generates a stop bit ;-)\r | |
4034 | irmp_param.stop_bit = TRUE; // set flag\r | |
4035 | }\r | |
4036 | else\r | |
4037 | #endif // IRMP_SUPPORT_MANCHESTER == 1\r | |
4038 | if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?\r | |
4039 | { // yes...\r | |
4040 | if (irmp_bit == irmp_param.complete_len - 1 && irmp_param.stop_bit == 0)\r | |
4041 | {\r | |
4042 | irmp_bit++;\r | |
4043 | }\r | |
4044 | #if IRMP_SUPPORT_NEC_PROTOCOL == 1\r | |
4045 | else if ((irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL) && irmp_bit == 0)\r | |
4046 | { // it was a non-standard repetition frame\r | |
4047 | Content-type: text/html ]>