libsigrokdecode  unreleased development snapshot
sigrok protocol decoding library
irmp.c
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2  * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
3  *
4  * Copyright (c) 2009-2019 Frank Meyer - frank(at)fli4l.de
5  *
6  * Supported AVR mikrocontrollers:
7  *
8  * ATtiny87, ATtiny167
9  * ATtiny45, ATtiny85
10  * ATtiny44, ATtiny84
11  * ATmega8, ATmega16, ATmega32
12  * ATmega162
13  * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
14  * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *---------------------------------------------------------------------------------------------------------------------------------------------------
21  */
22 
23 #include "irmp.h"
24 
25 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
26 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
27 #else
28 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
29 #endif
30 
31 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
32 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
33 #else
34 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
35 #endif
36 
37 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
38  IRMP_SUPPORT_RCII_PROTOCOL == 1 || \
39  IRMP_SUPPORT_S100_PROTOCOL == 1 || \
40  IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
41  IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
42  IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
43  IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
44  IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
45  IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
46  IRMP_SUPPORT_ORTEK_PROTOCOL == 1
47 # define IRMP_SUPPORT_MANCHESTER 1
48 #else
49 # define IRMP_SUPPORT_MANCHESTER 0
50 #endif
51 
52 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
53 # define IRMP_SUPPORT_SERIAL 1
54 #else
55 # define IRMP_SUPPORT_SERIAL 0
56 #endif
57 
58 #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
59 
60 #define MIN_TOLERANCE_00 1.0 // -0%
61 #define MAX_TOLERANCE_00 1.0 // +0%
62 
63 #define MIN_TOLERANCE_02 0.98 // -2%
64 #define MAX_TOLERANCE_02 1.02 // +2%
65 
66 #define MIN_TOLERANCE_03 0.97 // -3%
67 #define MAX_TOLERANCE_03 1.03 // +3%
68 
69 #define MIN_TOLERANCE_05 0.95 // -5%
70 #define MAX_TOLERANCE_05 1.05 // +5%
71 
72 #define MIN_TOLERANCE_10 0.9 // -10%
73 #define MAX_TOLERANCE_10 1.1 // +10%
74 
75 #define MIN_TOLERANCE_15 0.85 // -15%
76 #define MAX_TOLERANCE_15 1.15 // +15%
77 
78 #define MIN_TOLERANCE_20 0.8 // -20%
79 #define MAX_TOLERANCE_20 1.2 // +20%
80 
81 #define MIN_TOLERANCE_30 0.7 // -30%
82 #define MAX_TOLERANCE_30 1.3 // +30%
83 
84 #define MIN_TOLERANCE_40 0.6 // -40%
85 #define MAX_TOLERANCE_40 1.4 // +40%
86 
87 #define MIN_TOLERANCE_50 0.5 // -50%
88 #define MAX_TOLERANCE_50 1.5 // +50%
89 
90 #define MIN_TOLERANCE_60 0.4 // -60%
91 #define MAX_TOLERANCE_60 1.6 // +60%
92 
93 #define MIN_TOLERANCE_70 0.3 // -70%
94 #define MAX_TOLERANCE_70 1.7 // +70%
95 
96 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
97 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
98 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
99 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
100 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
101 #else // only 5% + 1 to avoid conflict with RC6:
102 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
103 #endif
104 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
105 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
106 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
107 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
108 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
109 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
110 
111 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
112 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
113 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
114 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
115 #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)
116 #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)
117 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
118 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
119 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
120 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
121 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
122 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
123 // autodetect nec repetition frame within 50 msec:
124 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
125 #if 0
126 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
127 #else
128 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
129 #endif
130 
131 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
132 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
133 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
134 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
135 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
136 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
137 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
138 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
139 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
140 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
141 
142 #define SAMSUNGAH_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
143 #define SAMSUNGAH_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
144 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
145 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
146 #define SAMSUNGAH_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
147 #define SAMSUNGAH_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
148 #define SAMSUNGAH_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
149 #define SAMSUNGAH_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
150 #define SAMSUNGAH_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
151 #define SAMSUNGAH_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
152 
153 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
154 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
155 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
156 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
157 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
158 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
159 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
160 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
161 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
162 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
163 
164 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
165 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
166 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
167 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
168 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
169 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
170 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
171 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
172 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
173 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
174 
175 #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)
176 #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)
177 #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)
178 #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)
179 #define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
180 #define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
181 #define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
182 #define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
183 #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
184 #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
185 
186 #define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
187 #define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
188 #define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
189 #define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
190 #define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
191 #define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
192 #define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
193 #define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
194 #define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
195 #define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
196 
197 #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
198 #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
199 #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
200 #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
201 #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
202 #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
203 #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
204 #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
205 #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
206 #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
207 
208 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
209 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
210 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
211 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
212 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
213 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
214 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
215 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
216 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
217 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
218 
219 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
220 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
221 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
222 #else
223 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
224 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
225 #endif
226 
227 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
228 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
229 
230 #define RCII_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
231 #define RCII_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
232 #define RCII_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
233 #define RCII_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
234 #define RCII_START_BIT2_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT2_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
235 #define RCII_START_BIT2_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCII_START_BIT2_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
236 
237 #define RCII_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCII_BIT_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
238 #define RCII_BIT_LEN ((uint_fast8_t)(F_INTERRUPTS * RCII_BIT_TIME))
239 #define RCII_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCII_BIT_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
240 
241 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
242 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
243 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
244 #else
245 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
247 #endif
248 
249 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
250 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
251 
252 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
253 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
254 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
256 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
257 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
258 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
259 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
260 
261 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
262 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
263 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
264 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
265 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
266 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
267 
268 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
269 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
270 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
271 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
272 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
275 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
276 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
277 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
278 
279 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
280 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
281 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
282 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
283 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
284 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
285 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
286 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
287 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
288 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
289 
290 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
291 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
292 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
293 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
294 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
295 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
296 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
297 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
298 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
299 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
300 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
301 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
302 
303 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
304 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
305 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
306 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
307 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
308 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
309 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
310 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
311 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
312 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
313 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
314 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
315 
316 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
317 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
318 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
319 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
320 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
321 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
322 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
323 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
324 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
325 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
326 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
327 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
328 
329 #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)
330 #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)
331 #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)
332 #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)
333 #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)
334 #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)
335 #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)
336 #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)
337 #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)
338 #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)
339 #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)
340 #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
341 #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)
342 #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)
343 #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)
344 #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)
345 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
346 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
348 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
349 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
350 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
351 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
352 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
353 #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)
354 #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)
355 
356 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
357 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
358 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
359 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
360 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
361 #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)
362 #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)
363 
364 #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)
365 #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)
366 #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)
367 #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)
368 #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)
369 #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)
370 #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)
371 #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)
372 
373 #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
374 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
375 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
376 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
377 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
378 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
379 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
380 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
381 #if 0
382 #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
383 #else
384 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
385 #endif
386 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
387 
388 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
389 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
390 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
391 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
392 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
393 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
394 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
395 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
396 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
397 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
398 
399 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
400 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
401 #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!
402 #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!
403 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
404 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
405 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
406 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
407 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
408 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
409 // autodetect JVC repetition frame within 50 msec:
410 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
411 
412 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
413 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
414 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
415 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
416 #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)
417 #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)
418 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
419 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
420 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
421 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
422 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
423 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
424 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
425 
426 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
427 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
428 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
429 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
430 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
431 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
432 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
433 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
434 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
435 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
436 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
437 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
438 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
439 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
440 
441 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
442 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
443 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
444 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
445 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
446 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
447 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
448 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
449 
450 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
451 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
452 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
453 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
454 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
455 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
456 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
457 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
458 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
459 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
460 
461 #define IRMP16_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * IRMP16_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define IRMP16_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * IRMP16_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
463 #define IRMP16_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * IRMP16_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
464 #define IRMP16_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * IRMP16_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
465 #define IRMP16_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * IRMP16_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
466 #define IRMP16_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * IRMP16_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
467 #define IRMP16_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * IRMP16_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
468 #define IRMP16_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * IRMP16_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
469 #define IRMP16_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * IRMP16_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
470 #define IRMP16_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * IRMP16_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
471 
472 #define GREE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GREE_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
473 #define GREE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GREE_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
474 #define GREE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GREE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
475 #define GREE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GREE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
476 #define GREE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GREE_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
477 #define GREE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GREE_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
478 #define GREE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GREE_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
479 #define GREE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GREE_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
480 #define GREE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GREE_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
481 #define GREE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GREE_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
482 
483 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
484 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
485 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
486 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
487 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
488 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
489 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
490 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
491 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
492 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
493 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
494 
495 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
496 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
497 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
498 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
499 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
500 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
501 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
502 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
503 
504 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
505 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
506 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
507 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
508 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
509 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
510 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
511 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
512 
513 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
514 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
515 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
516 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
517 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
518 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
519 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
520 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
521 
522 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
523 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
524 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
525 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
526 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
527 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
528 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
529 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
530 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
531 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
532 // autodetect TELEFUNKEN repetition frame within 50 msec:
533 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
534 
535 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
536 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
537 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
538 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
539 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
540 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
541 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
542 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
543 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
544 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
545 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
546 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
547 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
548 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
549 
550 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
551 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
552 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
553 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
554 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
555 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
556 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
557 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
558 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
559 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
560 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
561 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
562 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
563 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
564 
565 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
566 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
567 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
568 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
569 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
570 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
571 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
572 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
573 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
574 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
575 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
576 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
577 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
578 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
579 
580 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
581 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
582 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
583 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
584 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
585 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
586 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
587 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
588 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
589 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
590 
591 #define METZ_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * METZ_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
592 #define METZ_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * METZ_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
593 #define METZ_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * METZ_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
594 #define METZ_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * METZ_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
595 #define METZ_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * METZ_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
596 #define METZ_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * METZ_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
597 #define METZ_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * METZ_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
598 #define METZ_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * METZ_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
599 #define METZ_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * METZ_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
600 #define METZ_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * METZ_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
601 #define METZ_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * METZ_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
602 
603 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
604 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
605 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
606 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
607 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
608 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
609 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
610 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
611 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
612 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
613 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
614 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
615 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
616 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
617 
618 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
619 
620 #ifdef ANALYZE
621 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
622 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
623 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
624 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
625 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
626 static int silent;
627 static int time_counter;
628 static int verbose;
629 
630 #elif 0 /* not every PIC compiler knows variadic macros :-( */
631 # define ANALYZE_PUTCHAR(a)
632 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
633 # define ANALYZE_PRINTF(...)
634 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
635 # define ANALYZE_NEWLINE()
636 
637 #endif
638 
639 #if IRMP_USE_CALLBACK == 1
640 static void (*irmp_callback_ptr) (uint_fast8_t);
641 #endif // IRMP_USE_CALLBACK == 1
642 
643 #define PARITY_CHECK_OK 1
644 #define PARITY_CHECK_FAILED 0
645 
646 /*---------------------------------------------------------------------------------------------------------------------------------------------------
647  * Protocol names
648  *---------------------------------------------------------------------------------------------------------------------------------------------------
649  */
650 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
651 static const char proto_unknown[] PROGMEM = "UNKNOWN";
652 static const char proto_sircs[] PROGMEM = "SIRCS";
653 static const char proto_nec[] PROGMEM = "NEC";
654 static const char proto_samsung[] PROGMEM = "SAMSUNG";
655 static const char proto_matsushita[] PROGMEM = "MATSUSH";
656 static const char proto_kaseikyo[] PROGMEM = "KASEIKYO";
657 static const char proto_recs80[] PROGMEM = "RECS80";
658 static const char proto_rc5[] PROGMEM = "RC5";
659 static const char proto_denon[] PROGMEM = "DENON";
660 static const char proto_rc6[] PROGMEM = "RC6";
661 static const char proto_samsung32[] PROGMEM = "SAMSG32";
662 static const char proto_apple[] PROGMEM = "APPLE";
663 static const char proto_recs80ext[] PROGMEM = "RECS80EX";
664 static const char proto_nubert[] PROGMEM = "NUBERT";
665 static const char proto_bang_olufsen[] PROGMEM = "BANG OLU";
666 static const char proto_grundig[] PROGMEM = "GRUNDIG";
667 static const char proto_nokia[] PROGMEM = "NOKIA";
668 static const char proto_siemens[] PROGMEM = "SIEMENS";
669 static const char proto_fdc[] PROGMEM = "FDC";
670 static const char proto_rccar[] PROGMEM = "RCCAR";
671 static const char proto_jvc[] PROGMEM = "JVC";
672 static const char proto_rc6a[] PROGMEM = "RC6A";
673 static const char proto_nikon[] PROGMEM = "NIKON";
674 static const char proto_ruwido[] PROGMEM = "RUWIDO";
675 static const char proto_ir60[] PROGMEM = "IR60";
676 static const char proto_kathrein[] PROGMEM = "KATHREIN";
677 static const char proto_netbox[] PROGMEM = "NETBOX";
678 static const char proto_nec16[] PROGMEM = "NEC16";
679 static const char proto_nec42[] PROGMEM = "NEC42";
680 static const char proto_lego[] PROGMEM = "LEGO";
681 static const char proto_thomson[] PROGMEM = "THOMSON";
682 static const char proto_bose[] PROGMEM = "BOSE";
683 static const char proto_a1tvbox[] PROGMEM = "A1TVBOX";
684 static const char proto_ortek[] PROGMEM = "ORTEK";
685 static const char proto_telefunken[] PROGMEM = "TELEFUNKEN";
686 static const char proto_roomba[] PROGMEM = "ROOMBA";
687 static const char proto_rcmm32[] PROGMEM = "RCMM32";
688 static const char proto_rcmm24[] PROGMEM = "RCMM24";
689 static const char proto_rcmm12[] PROGMEM = "RCMM12";
690 static const char proto_speaker[] PROGMEM = "SPEAKER";
691 static const char proto_lgair[] PROGMEM = "LGAIR";
692 static const char proto_samsung48[] PROGMEM = "SAMSG48";
693 static const char proto_merlin[] PROGMEM = "MERLIN";
694 static const char proto_pentax[] PROGMEM = "PENTAX";
695 static const char proto_fan[] PROGMEM = "FAN";
696 static const char proto_s100[] PROGMEM = "S100";
697 static const char proto_acp24[] PROGMEM = "ACP24";
698 static const char proto_technics[] PROGMEM = "TECHNICS";
699 static const char proto_panasonic[] PROGMEM = "PANASONIC";
700 static const char proto_mitsu_heavy[] PROGMEM = "MITSU_HEAVY";
701 static const char proto_vincent[] PROGMEM = "VINCENT";
702 static const char proto_samsungah[] PROGMEM = "SAMSUNGAH";
703 static const char proto_irmp16[] PROGMEM = "IRMP16";
704 static const char proto_gree[] PROGMEM = "GREE";
705 static const char proto_rcii[] PROGMEM = "RCII";
706 static const char proto_metz[] PROGMEM = "METZ";
707 static const char proto_onkyo[] PROGMEM = "ONKYO";
708 
709 static const char proto_radio1[] PROGMEM = "RADIO1";
710 
711 const char * const
712 irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
713 {
714  proto_unknown,
715  proto_sircs,
716  proto_nec,
717  proto_samsung,
718  proto_matsushita,
719  proto_kaseikyo,
720  proto_recs80,
721  proto_rc5,
722  proto_denon,
723  proto_rc6,
724  proto_samsung32,
725  proto_apple,
726  proto_recs80ext,
727  proto_nubert,
728  proto_bang_olufsen,
729  proto_grundig,
730  proto_nokia,
731  proto_siemens,
732  proto_fdc,
733  proto_rccar,
734  proto_jvc,
735  proto_rc6a,
736  proto_nikon,
737  proto_ruwido,
738  proto_ir60,
739  proto_kathrein,
740  proto_netbox,
741  proto_nec16,
742  proto_nec42,
743  proto_lego,
744  proto_thomson,
745  proto_bose,
746  proto_a1tvbox,
747  proto_ortek,
748  proto_telefunken,
749  proto_roomba,
750  proto_rcmm32,
751  proto_rcmm24,
752  proto_rcmm12,
753  proto_speaker,
754  proto_lgair,
755  proto_samsung48,
756  proto_merlin,
757  proto_pentax,
758  proto_fan,
759  proto_s100,
760  proto_acp24,
761  proto_technics,
762  proto_panasonic,
763  proto_mitsu_heavy,
764  proto_vincent,
765  proto_samsungah,
766  proto_irmp16,
767  proto_gree,
768  proto_rcii,
769  proto_metz,
770  proto_onkyo,
771 
772  proto_radio1
773 };
774 
775 #endif
776 
777 /*---------------------------------------------------------------------------------------------------------------------------------------------------
778  * Logging
779  *---------------------------------------------------------------------------------------------------------------------------------------------------
780  */
781 #if IRMP_LOGGING == 1 // logging via UART
782 
783 #if defined(ARM_STM32F4XX)
784 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
785 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
786 # define STM32_GPIO_PORT GPIOA
787 # define STM32_GPIO_PIN GPIO_Pin_2
788 # define STM32_GPIO_SOURCE GPIO_PinSource2
789 # define STM32_UART_AF GPIO_AF_USART2
790 # define STM32_UART_COM USART2
791 # define STM32_UART_BAUD 115200 // 115200 Baud
792 # include "stm32f4xx_usart.h"
793 #elif defined(ARM_STM32F10X)
794 # define STM32_UART_COM USART3 // UART3 on PB10
795 #elif defined(ARDUINO) // Arduino Serial implementation
796 # if defined(USB_SERIAL)
797 # include "usb_serial.h"
798 # else
799 # error USB_SERIAL not defined in ARDUINO Environment
800 # endif
801 #elif defined(_CHIBIOS_HAL_) // ChibiOS HAL
802 # if IRMP_EXT_LOGGING == 1
803 # error IRMP_EXT_LOGGING not implemented for ChibiOS HAL, use regular logging instead
804 # endif
805 #else
806 # if IRMP_EXT_LOGGING == 1 // use external logging
807 # include "irmpextlog.h"
808 # else // normal UART log (IRMP_EXT_LOGGING == 0)
809 # define BAUD 9600L
810 # ifndef UNIX_OR_WINDOWS
811 # include <util/setbaud.h>
812 # endif
813 
814 #ifdef UBRR0H
815 
816 #define UART0_UBRRH UBRR0H
817 #define UART0_UBRRL UBRR0L
818 #define UART0_UCSRA UCSR0A
819 #define UART0_UCSRB UCSR0B
820 #define UART0_UCSRC UCSR0C
821 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
822 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
823 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
824 #ifdef URSEL0
825 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
826 #else
827 #define UART0_URSEL_BIT_VALUE (0)
828 #endif
829 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
830 #define UART0_UDR UDR0
831 #define UART0_U2X U2X0
832 
833 #else
834 
835 #define UART0_UBRRH UBRRH
836 #define UART0_UBRRL UBRRL
837 #define UART0_UCSRA UCSRA
838 #define UART0_UCSRB UCSRB
839 #define UART0_UCSRC UCSRC
840 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
841 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
842 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
843 #ifdef URSEL
844 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
845 #else
846 #define UART0_URSEL_BIT_VALUE (0)
847 #endif
848 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
849 #define UART0_UDR UDR
850 #define UART0_U2X U2X
851 
852 #endif //UBRR0H
853 #endif //IRMP_EXT_LOGGING
854 #endif //ARM_STM32F4XX
855 
856 /*---------------------------------------------------------------------------------------------------------------------------------------------------
857  * Initialize UART
858  * @details Initializes UART
859  *---------------------------------------------------------------------------------------------------------------------------------------------------
860  */
861 void
862 irmp_uart_init (void)
863 {
864 #ifndef UNIX_OR_WINDOWS
865 #if defined(ARM_STM32F4XX)
866  GPIO_InitTypeDef GPIO_InitStructure;
867  USART_InitTypeDef USART_InitStructure;
868 
869  // Clock enable vom TX Pin
870  RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK, ENABLE);
871 
872  // Clock enable der UART
873  RCC_APB1PeriphClockCmd(STM32_UART_CLOCK, ENABLE);
874 
875  // UART Alternative-Funktion mit dem IO-Pin verbinden
876  GPIO_PinAFConfig(STM32_GPIO_PORT,STM32_GPIO_SOURCE,STM32_UART_AF);
877 
878  // UART als Alternative-Funktion mit PushPull
879  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
880  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
881  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
882  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
883 
884  // TX-Pin
885  GPIO_InitStructure.GPIO_Pin = STM32_GPIO_PIN;
886  GPIO_Init(STM32_GPIO_PORT, &GPIO_InitStructure);
887 
888  // Oversampling
889  USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);
890 
891  // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
892  USART_InitStructure.USART_BaudRate = STM32_UART_BAUD;
893  USART_InitStructure.USART_WordLength = USART_WordLength_8b;
894  USART_InitStructure.USART_StopBits = USART_StopBits_1;
895  USART_InitStructure.USART_Parity = USART_Parity_No;
896  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
897  USART_InitStructure.USART_Mode = USART_Mode_Tx;
898  USART_Init(STM32_UART_COM, &USART_InitStructure);
899 
900  // UART enable
901  USART_Cmd(STM32_UART_COM, ENABLE);
902 
903 #elif defined(ARM_STM32F10X)
904  GPIO_InitTypeDef GPIO_InitStructure;
905  USART_InitTypeDef USART_InitStructure;
906 
907  // Clock enable vom TX Pin
908  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); // UART3 an PB10
909 
910  // Clock enable der UART
911  RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE);
912 
913  // UART als Alternative-Funktion mit PushPull
914  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
915  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
916 
917  // TX-Pin
918  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
919  GPIO_Init(GPIOB, &GPIO_InitStructure);
920 
921  // Oversampling
922  USART_OverSampling8Cmd(STM32_UART_COM, ENABLE);
923 
924  // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
925  USART_InitStructure.USART_BaudRate = 115200;
926  USART_InitStructure.USART_WordLength = USART_WordLength_8b;
927  USART_InitStructure.USART_StopBits = USART_StopBits_1;
928  USART_InitStructure.USART_Parity = USART_Parity_No;
929  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
930  USART_InitStructure.USART_Mode = USART_Mode_Tx;
931  USART_Init(STM32_UART_COM, &USART_InitStructure);
932 
933  // UART enable
934  USART_Cmd(STM32_UART_COM, ENABLE);
935 
936 #elif defined(ARDUINO)
937  // we use the Arduino Serial Imlementation
938  // you have to call Serial.begin(SER_BAUD); in Arduino setup() function
939 
940 #elif defined (__AVR_XMEGA__)
941 
942  PMIC.CTRL |= PMIC_HILVLEN_bm;
943 
944  USARTC1.BAUDCTRLB = 0;
945  USARTC1.BAUDCTRLA = F_CPU / 153600 - 1;
946  USARTC1.CTRLA = USART_RXCINTLVL_HI_gc; // high INT level (receive)
947  USARTC1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; // activated RX and TX
948  USARTC1.CTRLC = USART_CHSIZE_8BIT_gc; // 8 Bit
949  PORTC.DIR |= (1<<7); // TXD is output
950  PORTC.DIR &= ~(1<<6);
951 
952 #elif defined (_CHIBIOS_HAL_)
953  // we use the SD interface for logging, no need to init that here
954 
955 #else
956 
957 #if (IRMP_EXT_LOGGING == 0) // use UART
958  UART0_UBRRH = UBRRH_VALUE; // set baud rate
959  UART0_UBRRL = UBRRL_VALUE;
960 
961 #if USE_2X
962  UART0_UCSRA |= (1<<UART0_U2X);
963 #else
964  UART0_UCSRA &= ~(1<<UART0_U2X);
965 #endif
966 
967  UART0_UCSRC = UART0_UCSZ1_BIT_VALUE | UART0_UCSZ0_BIT_VALUE | UART0_URSEL_BIT_VALUE;
968  UART0_UCSRB |= UART0_TXEN_BIT_VALUE; // enable UART TX
969 #else // other log method
970  initextlog();
971 #endif //IRMP_EXT_LOGGING
972 #endif //ARM_STM32F4XX
973 #endif // UNIX_OR_WINDOWS
974 }
975 
976 /*---------------------------------------------------------------------------------------------------------------------------------------------------
977  * Send character
978  * @details Sends character
979  * @param ch character to be transmitted
980  *---------------------------------------------------------------------------------------------------------------------------------------------------
981  */
982 void
983 irmp_uart_putc (unsigned char ch)
984 {
985 #ifndef UNIX_OR_WINDOWS
986 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
987  // warten bis altes Byte gesendet wurde
988  while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET)
989  {
990  ;
991  }
992 
993  USART_SendData(STM32_UART_COM, ch);
994 
995  if (ch == '\n')
996  {
997  while (USART_GetFlagStatus(STM32_UART_COM, USART_FLAG_TXE) == RESET);
998  USART_SendData(STM32_UART_COM, '\r');
999  }
1000 
1001 #elif defined(ARDUINO)
1002  // we use the Arduino Serial Imlementation
1003  usb_serial_putchar(ch);
1004 
1005 #elif defined(_CHIBIOS_HAL_)
1006  // use the SD interface from HAL, log to IRMP_LOGGING_SD which is defined in irmpconfig.h
1007  sdWriteI(&IRMP_LOGGING_SD,&ch,1); // we are called from interrupt context, so use the ...I version of the function
1008 
1009 #else
1010 #if (IRMP_EXT_LOGGING == 0)
1011 
1012 # if defined (__AVR_XMEGA__)
1013  while (!(USARTC1.STATUS & USART_DREIF_bm))
1014  {
1015  ;
1016  }
1017 
1018  USARTC1.DATA = ch;
1019 
1020 # else // AVR_MEGA
1021  while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))
1022  {
1023  ;
1024  }
1025 
1026  UART0_UDR = ch;
1027 
1028 # endif // __AVR_XMEGA__
1029 
1030 #else
1031 
1032  sendextlog(ch); // use external log
1033 
1034 #endif // IRMP_EXT_LOGGING
1035 #endif // ARM_STM32F4XX
1036 #else
1037  fputc (ch, stderr);
1038 #endif // UNIX_OR_WINDOWS
1039 }
1040 
1041 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1042  * Log IR signal
1043  *---------------------------------------------------------------------------------------------------------------------------------------------------
1044  */
1045 
1046 #define STARTCYCLES 2 // min count of zeros before start of logging
1047 #define ENDBITS 1000 // number of sequenced highbits to detect end
1048 #define DATALEN 700 // log buffer size
1049 
1050 static void
1051 irmp_log (uint_fast8_t val)
1052 {
1053  static uint8_t buf[DATALEN]; // logging buffer
1054  static uint_fast16_t buf_idx; // index
1055  static uint_fast8_t startcycles; // current number of start-zeros
1056  static uint_fast16_t cnt; // counts sequenced highbits - to detect end
1057  static uint_fast8_t last_val = 1;
1058 
1059  if (! val && (startcycles < STARTCYCLES) && !buf_idx) // prevent that single random zeros init logging
1060  {
1061  startcycles++;
1062  }
1063  else
1064  {
1065  startcycles = 0;
1066 
1067  if (! val || buf_idx != 0) // start or continue logging on "0", "1" cannot init logging
1068  {
1069  if (last_val == val)
1070  {
1071  cnt++;
1072 
1073  if (val && cnt > ENDBITS) // if high received then look at log-stop condition
1074  { // if stop condition is true, output on uart
1075  uint_fast8_t i8;
1076  uint_fast16_t i;
1077  uint_fast16_t j;
1078  uint_fast8_t v = '1';
1079  uint_fast16_t d;
1080 
1081  for (i8 = 0; i8 < STARTCYCLES; i8++)
1082  {
1083  irmp_uart_putc ('0'); // the ignored starting zeros
1084  }
1085 
1086  for (i = 0; i < buf_idx; i++)
1087  {
1088  d = buf[i];
1089 
1090  if (d == 0xff)
1091  {
1092  i++;
1093  d = buf[i];
1094  i++;
1095  d |= ((uint_fast16_t) buf[i] << 8);
1096  }
1097 
1098  for (j = 0; j < d; j++)
1099  {
1100  irmp_uart_putc (v);
1101  }
1102 
1103  v = (v == '1') ? '0' : '1';
1104  }
1105 
1106  for (i8 = 0; i8 < 20; i8++)
1107  {
1108  irmp_uart_putc ('1');
1109  }
1110 
1111  irmp_uart_putc ('\n');
1112  buf_idx = 0;
1113  last_val = 1;
1114  cnt = 0;
1115  }
1116  }
1117  else if (buf_idx < DATALEN - 3)
1118  {
1119  if (cnt >= 0xff)
1120  {
1121  buf[buf_idx++] = 0xff;
1122  buf[buf_idx++] = (cnt & 0xff);
1123  buf[buf_idx] = (cnt >> 8);
1124  }
1125  else
1126  {
1127  buf[buf_idx] = cnt;
1128  }
1129 
1130  buf_idx++;
1131  cnt = 1;
1132  last_val = val;
1133  }
1134  }
1135  }
1136 }
1137 
1138 #else
1139 #define irmp_log(val)
1140 #endif //IRMP_LOGGING
1141 
1142 typedef struct
1143 {
1144  uint_fast8_t protocol; // ir protocol
1145  uint_fast8_t pulse_1_len_min; // minimum length of pulse with bit value 1
1146  uint_fast8_t pulse_1_len_max; // maximum length of pulse with bit value 1
1147  uint_fast8_t pause_1_len_min; // minimum length of pause with bit value 1
1148  uint_fast8_t pause_1_len_max; // maximum length of pause with bit value 1
1149  uint_fast8_t pulse_0_len_min; // minimum length of pulse with bit value 0
1150  uint_fast8_t pulse_0_len_max; // maximum length of pulse with bit value 0
1151  uint_fast8_t pause_0_len_min; // minimum length of pause with bit value 0
1152  uint_fast8_t pause_0_len_max; // maximum length of pause with bit value 0
1153  uint_fast8_t address_offset; // address offset
1154  uint_fast8_t address_end; // end of address
1155  uint_fast8_t command_offset; // command offset
1156  uint_fast8_t command_end; // end of command
1157  uint_fast8_t complete_len; // complete length of frame
1158  uint_fast8_t stop_bit; // flag: frame has stop bit
1159  uint_fast8_t lsb_first; // flag: LSB first
1160  uint_fast8_t flags; // some flags
1161 } IRMP_PARAMETER;
1162 
1163 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1164 
1165 static const PROGMEM IRMP_PARAMETER sircs_param =
1166 {
1167  IRMP_SIRCS_PROTOCOL, // protocol: ir protocol
1168  SIRCS_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1169  SIRCS_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1170  SIRCS_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1171  SIRCS_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1172  SIRCS_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1173  SIRCS_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1174  SIRCS_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1175  SIRCS_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1176  SIRCS_ADDRESS_OFFSET, // address_offset: address offset
1177  SIRCS_ADDRESS_OFFSET + SIRCS_ADDRESS_LEN, // address_end: end of address
1178  SIRCS_COMMAND_OFFSET, // command_offset: command offset
1179  SIRCS_COMMAND_OFFSET + SIRCS_COMMAND_LEN, // command_end: end of command
1180  SIRCS_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1181  SIRCS_STOP_BIT, // stop_bit: flag: frame has stop bit
1182  SIRCS_LSB, // lsb_first: flag: LSB first
1183  SIRCS_FLAGS // flags: some flags
1184 };
1185 
1186 #endif
1187 
1188 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1189 
1190 static const PROGMEM IRMP_PARAMETER nec_param =
1191 {
1192  IRMP_NEC_PROTOCOL, // protocol: ir protocol
1193  NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1194  NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1195  NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1196  NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1197  NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1198  NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1199  NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1200  NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1201  NEC_ADDRESS_OFFSET, // address_offset: address offset
1202  NEC_ADDRESS_OFFSET + NEC_ADDRESS_LEN, // address_end: end of address
1203  NEC_COMMAND_OFFSET, // command_offset: command offset
1204  NEC_COMMAND_OFFSET + NEC_COMMAND_LEN, // command_end: end of command
1205  NEC_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1206  NEC_STOP_BIT, // stop_bit: flag: frame has stop bit
1207  NEC_LSB, // lsb_first: flag: LSB first
1208  NEC_FLAGS // flags: some flags
1209 };
1210 
1211 static const PROGMEM IRMP_PARAMETER nec_rep_param =
1212 {
1213  IRMP_NEC_PROTOCOL, // protocol: ir protocol
1214  NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1215  NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1216  NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1217  NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1218  NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1219  NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1220  NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1221  NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1222  0, // address_offset: address offset
1223  0, // address_end: end of address
1224  0, // command_offset: command offset
1225  0, // command_end: end of command
1226  0, // complete_len: complete length of frame
1227  NEC_STOP_BIT, // stop_bit: flag: frame has stop bit
1228  NEC_LSB, // lsb_first: flag: LSB first
1229  NEC_FLAGS // flags: some flags
1230 };
1231 
1232 #endif
1233 
1234 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1235 
1236 static const PROGMEM IRMP_PARAMETER nec42_param =
1237 {
1238  IRMP_NEC42_PROTOCOL, // protocol: ir protocol
1239  NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1240  NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1241  NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1242  NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1243  NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1244  NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1245  NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1246  NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1247  NEC42_ADDRESS_OFFSET, // address_offset: address offset
1248  NEC42_ADDRESS_OFFSET + NEC42_ADDRESS_LEN, // address_end: end of address
1249  NEC42_COMMAND_OFFSET, // command_offset: command offset
1250  NEC42_COMMAND_OFFSET + NEC42_COMMAND_LEN, // command_end: end of command
1251  NEC42_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1252  NEC_STOP_BIT, // stop_bit: flag: frame has stop bit
1253  NEC_LSB, // lsb_first: flag: LSB first
1254  NEC_FLAGS // flags: some flags
1255 };
1256 
1257 #endif
1258 
1259 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1260 
1261 static const PROGMEM IRMP_PARAMETER lgair_param =
1262 {
1263  IRMP_LGAIR_PROTOCOL, // protocol: ir protocol
1264  NEC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1265  NEC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1266  NEC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1267  NEC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1268  NEC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1269  NEC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1270  NEC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1271  NEC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1272  LGAIR_ADDRESS_OFFSET, // address_offset: address offset
1273  LGAIR_ADDRESS_OFFSET + LGAIR_ADDRESS_LEN, // address_end: end of address
1274  LGAIR_COMMAND_OFFSET, // command_offset: command offset
1275  LGAIR_COMMAND_OFFSET + LGAIR_COMMAND_LEN, // command_end: end of command
1276  LGAIR_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1277  NEC_STOP_BIT, // stop_bit: flag: frame has stop bit
1278  NEC_LSB, // lsb_first: flag: LSB first
1279  NEC_FLAGS // flags: some flags
1280 };
1281 
1282 #endif
1283 
1284 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1285 
1286 static const PROGMEM IRMP_PARAMETER samsung_param =
1287 {
1288  IRMP_SAMSUNG_PROTOCOL, // protocol: ir protocol
1289  SAMSUNG_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1290  SAMSUNG_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1291  SAMSUNG_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1292  SAMSUNG_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1293  SAMSUNG_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1294  SAMSUNG_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1295  SAMSUNG_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1296  SAMSUNG_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1297  SAMSUNG_ADDRESS_OFFSET, // address_offset: address offset
1298  SAMSUNG_ADDRESS_OFFSET + SAMSUNG_ADDRESS_LEN, // address_end: end of address
1299  SAMSUNG_COMMAND_OFFSET, // command_offset: command offset
1300  SAMSUNG_COMMAND_OFFSET + SAMSUNG_COMMAND_LEN, // command_end: end of command
1301  SAMSUNG_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1302  SAMSUNG_STOP_BIT, // stop_bit: flag: frame has stop bit
1303  SAMSUNG_LSB, // lsb_first: flag: LSB first
1304  SAMSUNG_FLAGS // flags: some flags
1305 };
1306 
1307 #endif
1308 
1309 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
1310 
1311 static const PROGMEM IRMP_PARAMETER samsungah_param =
1312 {
1313  IRMP_SAMSUNGAH_PROTOCOL, // protocol: ir protocol
1314  SAMSUNGAH_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1315  SAMSUNGAH_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1316  SAMSUNGAH_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1317  SAMSUNGAH_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1318  SAMSUNGAH_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1319  SAMSUNGAH_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1320  SAMSUNGAH_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1321  SAMSUNGAH_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1322  SAMSUNGAH_ADDRESS_OFFSET, // address_offset: address offset
1323  SAMSUNGAH_ADDRESS_OFFSET + SAMSUNGAH_ADDRESS_LEN, // address_end: end of address
1324  SAMSUNGAH_COMMAND_OFFSET, // command_offset: command offset
1325  SAMSUNGAH_COMMAND_OFFSET + SAMSUNGAH_COMMAND_LEN, // command_end: end of command
1326  SAMSUNGAH_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1327  SAMSUNGAH_STOP_BIT, // stop_bit: flag: frame has stop bit
1328  SAMSUNGAH_LSB, // lsb_first: flag: LSB first
1329  SAMSUNGAH_FLAGS // flags: some flags
1330 };
1331 
1332 #endif
1333 
1334 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1335 
1336 static const PROGMEM IRMP_PARAMETER telefunken_param =
1337 {
1338  IRMP_TELEFUNKEN_PROTOCOL, // protocol: ir protocol
1339  TELEFUNKEN_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1340  TELEFUNKEN_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1341  TELEFUNKEN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1342  TELEFUNKEN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1343  TELEFUNKEN_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1344  TELEFUNKEN_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1345  TELEFUNKEN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1346  TELEFUNKEN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1347  TELEFUNKEN_ADDRESS_OFFSET, // address_offset: address offset
1348  TELEFUNKEN_ADDRESS_OFFSET + TELEFUNKEN_ADDRESS_LEN, // address_end: end of address
1349  TELEFUNKEN_COMMAND_OFFSET, // command_offset: command offset
1350  TELEFUNKEN_COMMAND_OFFSET + TELEFUNKEN_COMMAND_LEN, // command_end: end of command
1351  TELEFUNKEN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1352  TELEFUNKEN_STOP_BIT, // stop_bit: flag: frame has stop bit
1353  TELEFUNKEN_LSB, // lsb_first: flag: LSB first
1354  TELEFUNKEN_FLAGS // flags: some flags
1355 };
1356 
1357 #endif
1358 
1359 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1360 
1361 static const PROGMEM IRMP_PARAMETER matsushita_param =
1362 {
1363  IRMP_MATSUSHITA_PROTOCOL, // protocol: ir protocol
1364  MATSUSHITA_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1365  MATSUSHITA_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1366  MATSUSHITA_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1367  MATSUSHITA_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1368  MATSUSHITA_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1369  MATSUSHITA_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1370  MATSUSHITA_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1371  MATSUSHITA_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1372  MATSUSHITA_ADDRESS_OFFSET, // address_offset: address offset
1373  MATSUSHITA_ADDRESS_OFFSET + MATSUSHITA_ADDRESS_LEN, // address_end: end of address
1374  MATSUSHITA_COMMAND_OFFSET, // command_offset: command offset
1375  MATSUSHITA_COMMAND_OFFSET + MATSUSHITA_COMMAND_LEN, // command_end: end of command
1376  MATSUSHITA_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1377  MATSUSHITA_STOP_BIT, // stop_bit: flag: frame has stop bit
1378  MATSUSHITA_LSB, // lsb_first: flag: LSB first
1379  MATSUSHITA_FLAGS // flags: some flags
1380 };
1381 
1382 #endif
1383 
1384 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1385 
1386 static const PROGMEM IRMP_PARAMETER kaseikyo_param =
1387 {
1388  IRMP_KASEIKYO_PROTOCOL, // protocol: ir protocol
1389  KASEIKYO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1390  KASEIKYO_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1391  KASEIKYO_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1392  KASEIKYO_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1393  KASEIKYO_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1394  KASEIKYO_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1395  KASEIKYO_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1396  KASEIKYO_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1397  KASEIKYO_ADDRESS_OFFSET, // address_offset: address offset
1398  KASEIKYO_ADDRESS_OFFSET + KASEIKYO_ADDRESS_LEN, // address_end: end of address
1399  KASEIKYO_COMMAND_OFFSET, // command_offset: command offset
1400  KASEIKYO_COMMAND_OFFSET + KASEIKYO_COMMAND_LEN, // command_end: end of command
1401  KASEIKYO_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1402  KASEIKYO_STOP_BIT, // stop_bit: flag: frame has stop bit
1403  KASEIKYO_LSB, // lsb_first: flag: LSB first
1404  KASEIKYO_FLAGS // flags: some flags
1405 };
1406 
1407 #endif
1408 
1409 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
1410 
1411 static const PROGMEM IRMP_PARAMETER panasonic_param =
1412 {
1413  IRMP_PANASONIC_PROTOCOL, // protocol: ir protocol
1414  PANASONIC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1415  PANASONIC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1416  PANASONIC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1417  PANASONIC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1418  PANASONIC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1419  PANASONIC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1420  PANASONIC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1421  PANASONIC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1422  PANASONIC_ADDRESS_OFFSET, // address_offset: address offset
1423  PANASONIC_ADDRESS_OFFSET + PANASONIC_ADDRESS_LEN, // address_end: end of address
1424  PANASONIC_COMMAND_OFFSET, // command_offset: command offset
1425  PANASONIC_COMMAND_OFFSET + PANASONIC_COMMAND_LEN, // command_end: end of command
1426  PANASONIC_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1427  PANASONIC_STOP_BIT, // stop_bit: flag: frame has stop bit
1428  PANASONIC_LSB, // lsb_first: flag: LSB first
1429  PANASONIC_FLAGS // flags: some flags
1430 };
1431 
1432 #endif
1433 
1434 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
1435 
1436 static const PROGMEM IRMP_PARAMETER mitsu_heavy_param =
1437 {
1438  IRMP_MITSU_HEAVY_PROTOCOL, // protocol: ir protocol
1439  MITSU_HEAVY_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1440  MITSU_HEAVY_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1441  MITSU_HEAVY_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1442  MITSU_HEAVY_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1443  MITSU_HEAVY_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1444  MITSU_HEAVY_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1445  MITSU_HEAVY_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1446  MITSU_HEAVY_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1447  MITSU_HEAVY_ADDRESS_OFFSET, // address_offset: address offset
1448  MITSU_HEAVY_ADDRESS_OFFSET + MITSU_HEAVY_ADDRESS_LEN, // address_end: end of address
1449  MITSU_HEAVY_COMMAND_OFFSET, // command_offset: command offset
1450  MITSU_HEAVY_COMMAND_OFFSET + MITSU_HEAVY_COMMAND_LEN, // command_end: end of command
1451  MITSU_HEAVY_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1452  MITSU_HEAVY_STOP_BIT, // stop_bit: flag: frame has stop bit
1453  MITSU_HEAVY_LSB, // lsb_first: flag: LSB first
1454  MITSU_HEAVY_FLAGS // flags: some flags
1455 };
1456 
1457 #endif
1458 
1459 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
1460 
1461 static const PROGMEM IRMP_PARAMETER vincent_param =
1462 {
1463  IRMP_VINCENT_PROTOCOL, // protocol: ir protocol
1464  VINCENT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1465  VINCENT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1466  VINCENT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1467  VINCENT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1468  VINCENT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1469  VINCENT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1470  VINCENT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1471  VINCENT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1472  VINCENT_ADDRESS_OFFSET, // address_offset: address offset
1473  VINCENT_ADDRESS_OFFSET + VINCENT_ADDRESS_LEN, // address_end: end of address
1474  VINCENT_COMMAND_OFFSET, // command_offset: command offset
1475  VINCENT_COMMAND_OFFSET + VINCENT_COMMAND_LEN, // command_end: end of command
1476  VINCENT_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1477  VINCENT_STOP_BIT, // stop_bit: flag: frame has stop bit
1478  VINCENT_LSB, // lsb_first: flag: LSB first
1479  VINCENT_FLAGS // flags: some flags
1480 };
1481 
1482 #endif
1483 
1484 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1485 
1486 static const PROGMEM IRMP_PARAMETER recs80_param =
1487 {
1488  IRMP_RECS80_PROTOCOL, // protocol: ir protocol
1489  RECS80_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1490  RECS80_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1491  RECS80_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1492  RECS80_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1493  RECS80_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1494  RECS80_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1495  RECS80_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1496  RECS80_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1497  RECS80_ADDRESS_OFFSET, // address_offset: address offset
1498  RECS80_ADDRESS_OFFSET + RECS80_ADDRESS_LEN, // address_end: end of address
1499  RECS80_COMMAND_OFFSET, // command_offset: command offset
1500  RECS80_COMMAND_OFFSET + RECS80_COMMAND_LEN, // command_end: end of command
1501  RECS80_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1502  RECS80_STOP_BIT, // stop_bit: flag: frame has stop bit
1503  RECS80_LSB, // lsb_first: flag: LSB first
1504  RECS80_FLAGS // flags: some flags
1505 };
1506 
1507 #endif
1508 
1509 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1510 
1511 static const PROGMEM IRMP_PARAMETER rc5_param =
1512 {
1513  IRMP_RC5_PROTOCOL, // protocol: ir protocol
1514  RC5_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1515  RC5_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1516  RC5_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1517  RC5_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1518  0, // pulse_0_len_min: here: not used
1519  0, // pulse_0_len_max: here: not used
1520  0, // pause_0_len_min: here: not used
1521  0, // pause_0_len_max: here: not used
1522  RC5_ADDRESS_OFFSET, // address_offset: address offset
1523  RC5_ADDRESS_OFFSET + RC5_ADDRESS_LEN, // address_end: end of address
1524  RC5_COMMAND_OFFSET, // command_offset: command offset
1525  RC5_COMMAND_OFFSET + RC5_COMMAND_LEN, // command_end: end of command
1526  RC5_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1527  RC5_STOP_BIT, // stop_bit: flag: frame has stop bit
1528  RC5_LSB, // lsb_first: flag: LSB first
1529  RC5_FLAGS // flags: some flags
1530 };
1531 
1532 #endif
1533 
1534 #if IRMP_SUPPORT_RCII_PROTOCOL == 1
1535 
1536 static const PROGMEM IRMP_PARAMETER rcii_param =
1537 {
1538  IRMP_RCII_PROTOCOL, // protocol: ir protocol
1539  RCII_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1540  RCII_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1541  RCII_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1542  RCII_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1543  RCII_BIT_LEN_MIN, // pulse_0_len_min: here: not used
1544  RCII_BIT_LEN_MAX, // pulse_0_len_max: here: not used
1545  RCII_BIT_LEN_MIN, // pause_0_len_min: here: not used
1546  RCII_BIT_LEN_MAX, // pause_0_len_max: here: not used
1547  RCII_ADDRESS_OFFSET, // address_offset: address offset
1548  RCII_ADDRESS_OFFSET + RCII_ADDRESS_LEN, // address_end: end of address
1549  RCII_COMMAND_OFFSET, // command_offset: command offset
1550  RCII_COMMAND_OFFSET + RCII_COMMAND_LEN, // command_end: end of command
1551  RCII_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1552  RCII_STOP_BIT, // stop_bit: flag: frame has stop bit
1553  RCII_LSB, // lsb_first: flag: LSB first
1554  RCII_FLAGS // flags: some flags
1555 };
1556 
1557 #endif
1558 
1559 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1560 
1561 static const PROGMEM IRMP_PARAMETER s100_param =
1562 {
1563  IRMP_S100_PROTOCOL, // protocol: ir protocol
1564  S100_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1565  S100_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1566  S100_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1567  S100_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1568  0, // pulse_0_len_min: here: not used
1569  0, // pulse_0_len_max: here: not used
1570  0, // pause_0_len_min: here: not used
1571  0, // pause_0_len_max: here: not used
1572  S100_ADDRESS_OFFSET, // address_offset: address offset
1573  S100_ADDRESS_OFFSET + S100_ADDRESS_LEN, // address_end: end of address
1574  S100_COMMAND_OFFSET, // command_offset: command offset
1575  S100_COMMAND_OFFSET + S100_COMMAND_LEN, // command_end: end of command
1576  S100_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1577  S100_STOP_BIT, // stop_bit: flag: frame has stop bit
1578  S100_LSB, // lsb_first: flag: LSB first
1579  S100_FLAGS // flags: some flags
1580 };
1581 
1582 #endif
1583 
1584 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1585 
1586 static const PROGMEM IRMP_PARAMETER denon_param =
1587 {
1588  IRMP_DENON_PROTOCOL, // protocol: ir protocol
1589  DENON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1590  DENON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1591  DENON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1592  DENON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1593  DENON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1594  DENON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1595  DENON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1596  DENON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1597  DENON_ADDRESS_OFFSET, // address_offset: address offset
1598  DENON_ADDRESS_OFFSET + DENON_ADDRESS_LEN, // address_end: end of address
1599  DENON_COMMAND_OFFSET, // command_offset: command offset
1600  DENON_COMMAND_OFFSET + DENON_COMMAND_LEN, // command_end: end of command
1601  DENON_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1602  DENON_STOP_BIT, // stop_bit: flag: frame has stop bit
1603  DENON_LSB, // lsb_first: flag: LSB first
1604  DENON_FLAGS // flags: some flags
1605 };
1606 
1607 #endif
1608 
1609 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1610 
1611 static const PROGMEM IRMP_PARAMETER rc6_param =
1612 {
1613  IRMP_RC6_PROTOCOL, // protocol: ir protocol
1614 
1615  RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1616  RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1617  RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1618  RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1619  0, // pulse_0_len_min: here: not used
1620  0, // pulse_0_len_max: here: not used
1621  0, // pause_0_len_min: here: not used
1622  0, // pause_0_len_max: here: not used
1623  RC6_ADDRESS_OFFSET, // address_offset: address offset
1624  RC6_ADDRESS_OFFSET + RC6_ADDRESS_LEN, // address_end: end of address
1625  RC6_COMMAND_OFFSET, // command_offset: command offset
1626  RC6_COMMAND_OFFSET + RC6_COMMAND_LEN, // command_end: end of command
1627  RC6_COMPLETE_DATA_LEN_SHORT, // complete_len: complete length of frame
1628  RC6_STOP_BIT, // stop_bit: flag: frame has stop bit
1629  RC6_LSB, // lsb_first: flag: LSB first
1630  RC6_FLAGS // flags: some flags
1631 };
1632 
1633 #endif
1634 
1635 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1636 
1637 static const PROGMEM IRMP_PARAMETER recs80ext_param =
1638 {
1639  IRMP_RECS80EXT_PROTOCOL, // protocol: ir protocol
1640  RECS80EXT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1641  RECS80EXT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1642  RECS80EXT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1643  RECS80EXT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1644  RECS80EXT_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1645  RECS80EXT_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1646  RECS80EXT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1647  RECS80EXT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1648  RECS80EXT_ADDRESS_OFFSET, // address_offset: address offset
1649  RECS80EXT_ADDRESS_OFFSET + RECS80EXT_ADDRESS_LEN, // address_end: end of address
1650  RECS80EXT_COMMAND_OFFSET, // command_offset: command offset
1651  RECS80EXT_COMMAND_OFFSET + RECS80EXT_COMMAND_LEN, // command_end: end of command
1652  RECS80EXT_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1653  RECS80EXT_STOP_BIT, // stop_bit: flag: frame has stop bit
1654  RECS80EXT_LSB, // lsb_first: flag: LSB first
1655  RECS80EXT_FLAGS // flags: some flags
1656 };
1657 
1658 #endif
1659 
1660 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1661 
1662 static const PROGMEM IRMP_PARAMETER nubert_param =
1663 {
1664  IRMP_NUBERT_PROTOCOL, // protocol: ir protocol
1665  NUBERT_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1666  NUBERT_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1667  NUBERT_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1668  NUBERT_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1669  NUBERT_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1670  NUBERT_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1671  NUBERT_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1672  NUBERT_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1673  NUBERT_ADDRESS_OFFSET, // address_offset: address offset
1674  NUBERT_ADDRESS_OFFSET + NUBERT_ADDRESS_LEN, // address_end: end of address
1675  NUBERT_COMMAND_OFFSET, // command_offset: command offset
1676  NUBERT_COMMAND_OFFSET + NUBERT_COMMAND_LEN, // command_end: end of command
1677  NUBERT_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1678  NUBERT_STOP_BIT, // stop_bit: flag: frame has stop bit
1679  NUBERT_LSB, // lsb_first: flag: LSB first
1680  NUBERT_FLAGS // flags: some flags
1681 };
1682 
1683 #endif
1684 
1685 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1686 
1687 static const PROGMEM IRMP_PARAMETER fan_param =
1688 {
1689  IRMP_FAN_PROTOCOL, // protocol: ir protocol
1690  FAN_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1691  FAN_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1692  FAN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1693  FAN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1694  FAN_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1695  FAN_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1696  FAN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1697  FAN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1698  FAN_ADDRESS_OFFSET, // address_offset: address offset
1699  FAN_ADDRESS_OFFSET + FAN_ADDRESS_LEN, // address_end: end of address
1700  FAN_COMMAND_OFFSET, // command_offset: command offset
1701  FAN_COMMAND_OFFSET + FAN_COMMAND_LEN, // command_end: end of command
1702  FAN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1703  FAN_STOP_BIT, // stop_bit: flag: frame has NO stop bit
1704  FAN_LSB, // lsb_first: flag: LSB first
1705  FAN_FLAGS // flags: some flags
1706 };
1707 
1708 #endif
1709 
1710 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1711 
1712 static const PROGMEM IRMP_PARAMETER speaker_param =
1713 {
1714  IRMP_SPEAKER_PROTOCOL, // protocol: ir protocol
1715  SPEAKER_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1716  SPEAKER_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1717  SPEAKER_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1718  SPEAKER_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1719  SPEAKER_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1720  SPEAKER_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1721  SPEAKER_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1722  SPEAKER_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1723  SPEAKER_ADDRESS_OFFSET, // address_offset: address offset
1724  SPEAKER_ADDRESS_OFFSET + SPEAKER_ADDRESS_LEN, // address_end: end of address
1725  SPEAKER_COMMAND_OFFSET, // command_offset: command offset
1726  SPEAKER_COMMAND_OFFSET + SPEAKER_COMMAND_LEN, // command_end: end of command
1727  SPEAKER_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1728  SPEAKER_STOP_BIT, // stop_bit: flag: frame has stop bit
1729  SPEAKER_LSB, // lsb_first: flag: LSB first
1730  SPEAKER_FLAGS // flags: some flags
1731 };
1732 
1733 #endif
1734 
1735 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1736 
1737 static const PROGMEM IRMP_PARAMETER bang_olufsen_param =
1738 {
1739  IRMP_BANG_OLUFSEN_PROTOCOL, // protocol: ir protocol
1740  BANG_OLUFSEN_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1741  BANG_OLUFSEN_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1742  BANG_OLUFSEN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1743  BANG_OLUFSEN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1744  BANG_OLUFSEN_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1745  BANG_OLUFSEN_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1746  BANG_OLUFSEN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1747  BANG_OLUFSEN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1748  BANG_OLUFSEN_ADDRESS_OFFSET, // address_offset: address offset
1749  BANG_OLUFSEN_ADDRESS_OFFSET + BANG_OLUFSEN_ADDRESS_LEN, // address_end: end of address
1750  BANG_OLUFSEN_COMMAND_OFFSET, // command_offset: command offset
1751  BANG_OLUFSEN_COMMAND_OFFSET + BANG_OLUFSEN_COMMAND_LEN, // command_end: end of command
1752  BANG_OLUFSEN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1753  BANG_OLUFSEN_STOP_BIT, // stop_bit: flag: frame has stop bit
1754  BANG_OLUFSEN_LSB, // lsb_first: flag: LSB first
1755  BANG_OLUFSEN_FLAGS // flags: some flags
1756 };
1757 
1758 #endif
1759 
1760 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1761 
1762 static uint_fast8_t first_bit;
1763 
1764 static const PROGMEM IRMP_PARAMETER grundig_param =
1765 {
1766  IRMP_GRUNDIG_PROTOCOL, // protocol: ir protocol
1767 
1768  GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1769  GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1770  GRUNDIG_NOKIA_IR60_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1771  GRUNDIG_NOKIA_IR60_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1772  0, // pulse_0_len_min: here: not used
1773  0, // pulse_0_len_max: here: not used
1774  0, // pause_0_len_min: here: not used
1775  0, // pause_0_len_max: here: not used
1776  GRUNDIG_ADDRESS_OFFSET, // address_offset: address offset
1777  GRUNDIG_ADDRESS_OFFSET + GRUNDIG_ADDRESS_LEN, // address_end: end of address
1778  GRUNDIG_COMMAND_OFFSET, // command_offset: command offset
1779  GRUNDIG_COMMAND_OFFSET + GRUNDIG_COMMAND_LEN + 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1780  NOKIA_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1781  GRUNDIG_NOKIA_IR60_STOP_BIT, // stop_bit: flag: frame has stop bit
1782  GRUNDIG_NOKIA_IR60_LSB, // lsb_first: flag: LSB first
1783  GRUNDIG_NOKIA_IR60_FLAGS // flags: some flags
1784 };
1785 
1786 #endif
1787 
1788 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1789 
1790 static const PROGMEM IRMP_PARAMETER ruwido_param =
1791 {
1792  IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol
1793  SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
1794  SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
1795  SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
1796  SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
1797  0, // pulse_0_len_min: here: not used
1798  0, // pulse_0_len_max: here: not used
1799  0, // pause_0_len_min: here: not used
1800  0, // pause_0_len_max: here: not used
1801  RUWIDO_ADDRESS_OFFSET, // address_offset: address offset
1802  RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address
1803  RUWIDO_COMMAND_OFFSET, // command_offset: command offset
1804  RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command
1805  SIEMENS_COMPLETE_DATA_LEN, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1806  SIEMENS_OR_RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit
1807  SIEMENS_OR_RUWIDO_LSB, // lsb_first: flag: LSB first
1808  SIEMENS_OR_RUWIDO_FLAGS // flags: some flags
1809 };
1810 
1811 #endif
1812 
1813 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1814 
1815 static const PROGMEM IRMP_PARAMETER fdc_param =
1816 {
1817  IRMP_FDC_PROTOCOL, // protocol: ir protocol
1818  FDC_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1819  FDC_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1820  FDC_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1821  FDC_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1822  FDC_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1823  FDC_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1824  FDC_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1825  FDC_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1826  FDC_ADDRESS_OFFSET, // address_offset: address offset
1827  FDC_ADDRESS_OFFSET + FDC_ADDRESS_LEN, // address_end: end of address
1828  FDC_COMMAND_OFFSET, // command_offset: command offset
1829  FDC_COMMAND_OFFSET + FDC_COMMAND_LEN, // command_end: end of command
1830  FDC_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1831  FDC_STOP_BIT, // stop_bit: flag: frame has stop bit
1832  FDC_LSB, // lsb_first: flag: LSB first
1833  FDC_FLAGS // flags: some flags
1834 };
1835 
1836 #endif
1837 
1838 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1839 
1840 static const PROGMEM IRMP_PARAMETER rccar_param =
1841 {
1842  IRMP_RCCAR_PROTOCOL, // protocol: ir protocol
1843  RCCAR_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1844  RCCAR_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1845  RCCAR_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1846  RCCAR_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1847  RCCAR_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1848  RCCAR_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1849  RCCAR_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1850  RCCAR_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1851  RCCAR_ADDRESS_OFFSET, // address_offset: address offset
1852  RCCAR_ADDRESS_OFFSET + RCCAR_ADDRESS_LEN, // address_end: end of address
1853  RCCAR_COMMAND_OFFSET, // command_offset: command offset
1854  RCCAR_COMMAND_OFFSET + RCCAR_COMMAND_LEN, // command_end: end of command
1855  RCCAR_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1856  RCCAR_STOP_BIT, // stop_bit: flag: frame has stop bit
1857  RCCAR_LSB, // lsb_first: flag: LSB first
1858  RCCAR_FLAGS // flags: some flags
1859 };
1860 
1861 #endif
1862 
1863 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1864 
1865 static const PROGMEM IRMP_PARAMETER nikon_param =
1866 {
1867  IRMP_NIKON_PROTOCOL, // protocol: ir protocol
1868  NIKON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1869  NIKON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1870  NIKON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1871  NIKON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1872  NIKON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1873  NIKON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1874  NIKON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1875  NIKON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1876  NIKON_ADDRESS_OFFSET, // address_offset: address offset
1877  NIKON_ADDRESS_OFFSET + NIKON_ADDRESS_LEN, // address_end: end of address
1878  NIKON_COMMAND_OFFSET, // command_offset: command offset
1879  NIKON_COMMAND_OFFSET + NIKON_COMMAND_LEN, // command_end: end of command
1880  NIKON_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1881  NIKON_STOP_BIT, // stop_bit: flag: frame has stop bit
1882  NIKON_LSB, // lsb_first: flag: LSB first
1883  NIKON_FLAGS // flags: some flags
1884 };
1885 
1886 #endif
1887 
1888 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1889 
1890 static const PROGMEM IRMP_PARAMETER kathrein_param =
1891 {
1892  IRMP_KATHREIN_PROTOCOL, // protocol: ir protocol
1893  KATHREIN_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1894  KATHREIN_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1895  KATHREIN_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1896  KATHREIN_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1897  KATHREIN_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1898  KATHREIN_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1899  KATHREIN_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1900  KATHREIN_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1901  KATHREIN_ADDRESS_OFFSET, // address_offset: address offset
1902  KATHREIN_ADDRESS_OFFSET + KATHREIN_ADDRESS_LEN, // address_end: end of address
1903  KATHREIN_COMMAND_OFFSET, // command_offset: command offset
1904  KATHREIN_COMMAND_OFFSET + KATHREIN_COMMAND_LEN, // command_end: end of command
1905  KATHREIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1906  KATHREIN_STOP_BIT, // stop_bit: flag: frame has stop bit
1907  KATHREIN_LSB, // lsb_first: flag: LSB first
1908  KATHREIN_FLAGS // flags: some flags
1909 };
1910 
1911 #endif
1912 
1913 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1914 
1915 static const PROGMEM IRMP_PARAMETER netbox_param =
1916 {
1917  IRMP_NETBOX_PROTOCOL, // protocol: ir protocol
1918  NETBOX_PULSE_LEN, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1919  NETBOX_PULSE_REST_LEN, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1920  NETBOX_PAUSE_LEN, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1921  NETBOX_PAUSE_REST_LEN, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1922  NETBOX_PULSE_LEN, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1923  NETBOX_PULSE_REST_LEN, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1924  NETBOX_PAUSE_LEN, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1925  NETBOX_PAUSE_REST_LEN, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1926  NETBOX_ADDRESS_OFFSET, // address_offset: address offset
1927  NETBOX_ADDRESS_OFFSET + NETBOX_ADDRESS_LEN, // address_end: end of address
1928  NETBOX_COMMAND_OFFSET, // command_offset: command offset
1929  NETBOX_COMMAND_OFFSET + NETBOX_COMMAND_LEN, // command_end: end of command
1930  NETBOX_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1931  NETBOX_STOP_BIT, // stop_bit: flag: frame has stop bit
1932  NETBOX_LSB, // lsb_first: flag: LSB first
1933  NETBOX_FLAGS // flags: some flags
1934 };
1935 
1936 #endif
1937 
1938 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1939 
1940 static const PROGMEM IRMP_PARAMETER lego_param =
1941 {
1942  IRMP_LEGO_PROTOCOL, // protocol: ir protocol
1943  LEGO_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1944  LEGO_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1945  LEGO_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1946  LEGO_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1947  LEGO_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1948  LEGO_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1949  LEGO_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1950  LEGO_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1951  LEGO_ADDRESS_OFFSET, // address_offset: address offset
1952  LEGO_ADDRESS_OFFSET + LEGO_ADDRESS_LEN, // address_end: end of address
1953  LEGO_COMMAND_OFFSET, // command_offset: command offset
1954  LEGO_COMMAND_OFFSET + LEGO_COMMAND_LEN, // command_end: end of command
1955  LEGO_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1956  LEGO_STOP_BIT, // stop_bit: flag: frame has stop bit
1957  LEGO_LSB, // lsb_first: flag: LSB first
1958  LEGO_FLAGS // flags: some flags
1959 };
1960 
1961 #endif
1962 
1963 #if IRMP_SUPPORT_IRMP16_PROTOCOL == 1
1964 
1965 static const PROGMEM IRMP_PARAMETER irmp16_param =
1966 {
1967  IRMP_IRMP16_PROTOCOL, // protocol: ir protocol
1968  IRMP16_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1969  IRMP16_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1970  IRMP16_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1971  IRMP16_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1972  IRMP16_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1973  IRMP16_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1974  IRMP16_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
1975  IRMP16_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
1976  IRMP16_ADDRESS_OFFSET, // address_offset: address offset
1977  IRMP16_ADDRESS_OFFSET + IRMP16_ADDRESS_LEN, // address_end: end of address
1978  IRMP16_COMMAND_OFFSET, // command_offset: command offset
1979  IRMP16_COMMAND_OFFSET + IRMP16_COMMAND_LEN, // command_end: end of command
1980  IRMP16_COMPLETE_DATA_LEN, // complete_len: complete length of frame
1981  IRMP16_STOP_BIT, // stop_bit: flag: frame has stop bit
1982  IRMP16_LSB, // lsb_first: flag: LSB first
1983  IRMP16_FLAGS // flags: some flags
1984 };
1985 
1986 #endif
1987 
1988 #if IRMP_SUPPORT_GREE_PROTOCOL == 1
1989 
1990 static const PROGMEM IRMP_PARAMETER gree_param =
1991 {
1992  IRMP_GREE_PROTOCOL, // protocol: ir protocol
1993  GREE_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
1994  GREE_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
1995  GREE_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
1996  GREE_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
1997  GREE_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
1998  GREE_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
1999  GREE_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2000  GREE_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2001  GREE_ADDRESS_OFFSET, // address_offset: address offset
2002  GREE_ADDRESS_OFFSET + GREE_ADDRESS_LEN, // address_end: end of address
2003  GREE_COMMAND_OFFSET, // command_offset: command offset
2004  GREE_COMMAND_OFFSET + GREE_COMMAND_LEN, // command_end: end of command
2005  GREE_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2006  GREE_STOP_BIT, // stop_bit: flag: frame has stop bit
2007  GREE_LSB, // lsb_first: flag: LSB first
2008  GREE_FLAGS // flags: some flags
2009 };
2010 
2011 #endif
2012 
2013 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2014 
2015 static const PROGMEM IRMP_PARAMETER thomson_param =
2016 {
2017  IRMP_THOMSON_PROTOCOL, // protocol: ir protocol
2018  THOMSON_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2019  THOMSON_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2020  THOMSON_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2021  THOMSON_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2022  THOMSON_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2023  THOMSON_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2024  THOMSON_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2025  THOMSON_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2026  THOMSON_ADDRESS_OFFSET, // address_offset: address offset
2027  THOMSON_ADDRESS_OFFSET + THOMSON_ADDRESS_LEN, // address_end: end of address
2028  THOMSON_COMMAND_OFFSET, // command_offset: command offset
2029  THOMSON_COMMAND_OFFSET + THOMSON_COMMAND_LEN, // command_end: end of command
2030  THOMSON_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2031  THOMSON_STOP_BIT, // stop_bit: flag: frame has stop bit
2032  THOMSON_LSB, // lsb_first: flag: LSB first
2033  THOMSON_FLAGS // flags: some flags
2034 };
2035 
2036 #endif
2037 
2038 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2039 
2040 static const PROGMEM IRMP_PARAMETER bose_param =
2041 {
2042  IRMP_BOSE_PROTOCOL, // protocol: ir protocol
2043  BOSE_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2044  BOSE_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2045  BOSE_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2046  BOSE_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2047  BOSE_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2048  BOSE_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2049  BOSE_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2050  BOSE_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2051  BOSE_ADDRESS_OFFSET, // address_offset: address offset
2052  BOSE_ADDRESS_OFFSET + BOSE_ADDRESS_LEN, // address_end: end of address
2053  BOSE_COMMAND_OFFSET, // command_offset: command offset
2054  BOSE_COMMAND_OFFSET + BOSE_COMMAND_LEN, // command_end: end of command
2055  BOSE_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2056  BOSE_STOP_BIT, // stop_bit: flag: frame has stop bit
2057  BOSE_LSB, // lsb_first: flag: LSB first
2058  BOSE_FLAGS // flags: some flags
2059 };
2060 
2061 #endif
2062 
2063 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
2064 
2065 static const PROGMEM IRMP_PARAMETER a1tvbox_param =
2066 {
2067  IRMP_A1TVBOX_PROTOCOL, // protocol: ir protocol
2068 
2069  A1TVBOX_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
2070  A1TVBOX_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
2071  A1TVBOX_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
2072  A1TVBOX_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
2073  0, // pulse_0_len_min: here: not used
2074  0, // pulse_0_len_max: here: not used
2075  0, // pause_0_len_min: here: not used
2076  0, // pause_0_len_max: here: not used
2077  A1TVBOX_ADDRESS_OFFSET, // address_offset: address offset
2078  A1TVBOX_ADDRESS_OFFSET + A1TVBOX_ADDRESS_LEN, // address_end: end of address
2079  A1TVBOX_COMMAND_OFFSET, // command_offset: command offset
2080  A1TVBOX_COMMAND_OFFSET + A1TVBOX_COMMAND_LEN, // command_end: end of command
2081  A1TVBOX_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2082  A1TVBOX_STOP_BIT, // stop_bit: flag: frame has stop bit
2083  A1TVBOX_LSB, // lsb_first: flag: LSB first
2084  A1TVBOX_FLAGS // flags: some flags
2085 };
2086 
2087 #endif
2088 
2089 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
2090 
2091 static const PROGMEM IRMP_PARAMETER merlin_param =
2092 {
2093  IRMP_MERLIN_PROTOCOL, // protocol: ir protocol
2094 
2095  MERLIN_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
2096  MERLIN_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
2097  MERLIN_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
2098  MERLIN_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
2099  0, // pulse_0_len_min: here: not used
2100  0, // pulse_0_len_max: here: not used
2101  0, // pause_0_len_min: here: not used
2102  0, // pause_0_len_max: here: not used
2103  MERLIN_ADDRESS_OFFSET, // address_offset: address offset
2104  MERLIN_ADDRESS_OFFSET + MERLIN_ADDRESS_LEN, // address_end: end of address
2105  MERLIN_COMMAND_OFFSET, // command_offset: command offset
2106  MERLIN_COMMAND_OFFSET + MERLIN_COMMAND_LEN, // command_end: end of command
2107  MERLIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2108  MERLIN_STOP_BIT, // stop_bit: flag: frame has stop bit
2109  MERLIN_LSB, // lsb_first: flag: LSB first
2110  MERLIN_FLAGS // flags: some flags
2111 };
2112 
2113 #endif
2114 
2115 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2116 
2117 static const PROGMEM IRMP_PARAMETER ortek_param =
2118 {
2119  IRMP_ORTEK_PROTOCOL, // protocol: ir protocol
2120 
2121  ORTEK_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
2122  ORTEK_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
2123  ORTEK_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
2124  ORTEK_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
2125  0, // pulse_0_len_min: here: not used
2126  0, // pulse_0_len_max: here: not used
2127  0, // pause_0_len_min: here: not used
2128  0, // pause_0_len_max: here: not used
2129  ORTEK_ADDRESS_OFFSET, // address_offset: address offset
2130  ORTEK_ADDRESS_OFFSET + ORTEK_ADDRESS_LEN, // address_end: end of address
2131  ORTEK_COMMAND_OFFSET, // command_offset: command offset
2132  ORTEK_COMMAND_OFFSET + ORTEK_COMMAND_LEN, // command_end: end of command
2133  ORTEK_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2134  ORTEK_STOP_BIT, // stop_bit: flag: frame has stop bit
2135  ORTEK_LSB, // lsb_first: flag: LSB first
2136  ORTEK_FLAGS // flags: some flags
2137 };
2138 
2139 #endif
2140 
2141 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2142 
2143 static const PROGMEM IRMP_PARAMETER roomba_param =
2144 {
2145  IRMP_ROOMBA_PROTOCOL, // protocol: ir protocol
2146  ROOMBA_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2147  ROOMBA_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2148  ROOMBA_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2149  ROOMBA_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2150  ROOMBA_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2151  ROOMBA_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2152  ROOMBA_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2153  ROOMBA_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2154  ROOMBA_ADDRESS_OFFSET, // address_offset: address offset
2155  ROOMBA_ADDRESS_OFFSET + ROOMBA_ADDRESS_LEN, // address_end: end of address
2156  ROOMBA_COMMAND_OFFSET, // command_offset: command offset
2157  ROOMBA_COMMAND_OFFSET + ROOMBA_COMMAND_LEN, // command_end: end of command
2158  ROOMBA_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2159  ROOMBA_STOP_BIT, // stop_bit: flag: frame has stop bit
2160  ROOMBA_LSB, // lsb_first: flag: LSB first
2161  ROOMBA_FLAGS // flags: some flags
2162 };
2163 
2164 #endif
2165 
2166 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2167 
2168 static const PROGMEM IRMP_PARAMETER rcmm_param =
2169 {
2170  IRMP_RCMM32_PROTOCOL, // protocol: ir protocol
2171 
2172  RCMM32_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
2173  RCMM32_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
2174  0, // pause_1_len_min: here: minimum length of short pause
2175  0, // pause_1_len_max: here: maximum length of short pause
2176  RCMM32_BIT_PULSE_LEN_MIN, // pulse_0_len_min: here: not used
2177  RCMM32_BIT_PULSE_LEN_MAX, // pulse_0_len_max: here: not used
2178  0, // pause_0_len_min: here: not used
2179  0, // pause_0_len_max: here: not used
2180  RCMM32_ADDRESS_OFFSET, // address_offset: address offset
2181  RCMM32_ADDRESS_OFFSET + RCMM32_ADDRESS_LEN, // address_end: end of address
2182  RCMM32_COMMAND_OFFSET, // command_offset: command offset
2183  RCMM32_COMMAND_OFFSET + RCMM32_COMMAND_LEN, // command_end: end of command
2184  RCMM32_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2185  RCMM32_STOP_BIT, // stop_bit: flag: frame has stop bit
2186  RCMM32_LSB, // lsb_first: flag: LSB first
2187  RCMM32_FLAGS // flags: some flags
2188 };
2189 
2190 #endif
2191 
2192 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2193 
2194 static const PROGMEM IRMP_PARAMETER pentax_param =
2195 {
2196  IRMP_PENTAX_PROTOCOL, // protocol: ir protocol
2197  PENTAX_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2198  PENTAX_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2199  PENTAX_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2200  PENTAX_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2201  PENTAX_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2202  PENTAX_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2203  PENTAX_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2204  PENTAX_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2205  PENTAX_ADDRESS_OFFSET, // address_offset: address offset
2206  PENTAX_ADDRESS_OFFSET + PENTAX_ADDRESS_LEN, // address_end: end of address
2207  PENTAX_COMMAND_OFFSET, // command_offset: command offset
2208  PENTAX_COMMAND_OFFSET + PENTAX_COMMAND_LEN, // command_end: end of command
2209  PENTAX_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2210  PENTAX_STOP_BIT, // stop_bit: flag: frame has stop bit
2211  PENTAX_LSB, // lsb_first: flag: LSB first
2212  PENTAX_FLAGS // flags: some flags
2213 };
2214 
2215 #endif
2216 
2217 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2218 
2219 static const PROGMEM IRMP_PARAMETER acp24_param =
2220 {
2221  IRMP_ACP24_PROTOCOL, // protocol: ir protocol
2222  ACP24_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2223  ACP24_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2224  ACP24_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2225  ACP24_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2226  ACP24_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2227  ACP24_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2228  ACP24_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2229  ACP24_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2230  ACP24_ADDRESS_OFFSET, // address_offset: address offset
2231  ACP24_ADDRESS_OFFSET + ACP24_ADDRESS_LEN, // address_end: end of address
2232  ACP24_COMMAND_OFFSET, // command_offset: command offset
2233  ACP24_COMMAND_OFFSET + ACP24_COMMAND_LEN, // command_end: end of command
2234  ACP24_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2235  ACP24_STOP_BIT, // stop_bit: flag: frame has stop bit
2236  ACP24_LSB, // lsb_first: flag: LSB first
2237  ACP24_FLAGS // flags: some flags
2238 };
2239 
2240 #endif
2241 
2242 #if IRMP_SUPPORT_METZ_PROTOCOL == 1
2243 
2244 static const PROGMEM IRMP_PARAMETER metz_param =
2245 {
2246  IRMP_METZ_PROTOCOL, // protocol: ir protocol
2247  METZ_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2248  METZ_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2249  METZ_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2250  METZ_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2251  METZ_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2252  METZ_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2253  METZ_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2254  METZ_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2255  METZ_ADDRESS_OFFSET, // address_offset: address offset
2256  METZ_ADDRESS_OFFSET + METZ_ADDRESS_LEN, // address_end: end of address
2257  METZ_COMMAND_OFFSET, // command_offset: command offset
2258  METZ_COMMAND_OFFSET + METZ_COMMAND_LEN, // command_end: end of command
2259  METZ_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2260  METZ_STOP_BIT, // stop_bit: flag: frame has stop bit
2261  METZ_LSB, // lsb_first: flag: LSB first
2262  METZ_FLAGS // flags: some flags
2263 };
2264 
2265 #endif
2266 
2267 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2268 
2269 static const PROGMEM IRMP_PARAMETER radio1_param =
2270 {
2271  IRMP_RADIO1_PROTOCOL, // protocol: ir protocol
2272 
2273  RADIO1_1_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
2274  RADIO1_1_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
2275  RADIO1_1_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
2276  RADIO1_1_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
2277  RADIO1_0_PULSE_LEN_MIN, // pulse_0_len_min: minimum length of pulse with bit value 0
2278  RADIO1_0_PULSE_LEN_MAX, // pulse_0_len_max: maximum length of pulse with bit value 0
2279  RADIO1_0_PAUSE_LEN_MIN, // pause_0_len_min: minimum length of pause with bit value 0
2280  RADIO1_0_PAUSE_LEN_MAX, // pause_0_len_max: maximum length of pause with bit value 0
2281  RADIO1_ADDRESS_OFFSET, // address_offset: address offset
2282  RADIO1_ADDRESS_OFFSET + RADIO1_ADDRESS_LEN, // address_end: end of address
2283  RADIO1_COMMAND_OFFSET, // command_offset: command offset
2284  RADIO1_COMMAND_OFFSET + RADIO1_COMMAND_LEN, // command_end: end of command
2285  RADIO1_COMPLETE_DATA_LEN, // complete_len: complete length of frame
2286  RADIO1_STOP_BIT, // stop_bit: flag: frame has stop bit
2287  RADIO1_LSB, // lsb_first: flag: LSB first
2288  RADIO1_FLAGS // flags: some flags
2289 };
2290 
2291 #endif
2292 
2293 static uint_fast8_t irmp_bit; // current bit position
2294 static IRMP_PARAMETER irmp_param;
2295 
2296 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2297 static IRMP_PARAMETER irmp_param2;
2298 #endif
2299 
2300 static volatile uint_fast8_t irmp_ir_detected = FALSE;
2301 static volatile uint_fast8_t irmp_protocol;
2302 static volatile uint_fast16_t irmp_address;
2303 #if IRMP_32_BIT == 1
2304 static volatile uint_fast32_t irmp_command;
2305 #else
2306 static volatile uint_fast16_t irmp_command;
2307 #endif
2308 static volatile uint_fast16_t irmp_id; // only used for SAMSUNG protocol
2309 static volatile uint_fast8_t irmp_flags;
2310 // static volatile uint_fast8_t irmp_busy_flag;
2311 
2312 #if defined(__MBED__)
2313 // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp
2314 gpio_t gpioIRin; // use low level c function instead
2315 #endif
2316 
2317 
2318 #ifdef ANALYZE
2319 #define input(x) (x)
2320 static uint_fast8_t IRMP_PIN;
2321 static uint_fast8_t radio;
2322 #endif
2323 
2324 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2325  * Initialize IRMP decoder
2326  * @details Configures IRMP input pin
2327  *---------------------------------------------------------------------------------------------------------------------------------------------------
2328  */
2329 #ifndef ANALYZE
2330 void
2331 irmp_init (void)
2332 {
2333 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2334 #elif defined (ARM_STM32_HAL) // STM32 with Hal Library: do nothing
2335 #elif defined (ARM_STM32) // STM32
2336  GPIO_InitTypeDef GPIO_InitStructure;
2337 
2338  /* GPIOx clock enable */
2339 # if defined (ARM_STM32L1XX)
2340  RCC_AHBPeriphClockCmd(IRMP_PORT_RCC, ENABLE);
2341 # elif defined (ARM_STM32F10X)
2342  RCC_APB2PeriphClockCmd(IRMP_PORT_RCC, ENABLE);
2343 # elif defined (ARM_STM32F4XX)
2344  RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC, ENABLE);
2345 # endif
2346 
2347  /* GPIO Configuration */
2348  GPIO_InitStructure.GPIO_Pin = IRMP_BIT;
2349 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2350  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
2351  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
2352  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
2353  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
2354 # elif defined (ARM_STM32F10X)
2355  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
2356  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
2357 # endif
2358  GPIO_Init(IRMP_PORT, &GPIO_InitStructure);
2359 
2360 #elif defined(STELLARIS_ARM_CORTEX_M4)
2361  // Enable the GPIO port
2362  ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH);
2363 
2364  // Set as an input
2365  ROM_GPIODirModeSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_DIR_MODE_IN);
2366  ROM_GPIOPadConfigSet(IRMP_PORT_BASE, IRMP_PORT_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
2367 
2368 #elif defined(__SDCC_stm8) // STM8
2369  IRMP_GPIO_STRUCT->DDR &= ~(1<<IRMP_BIT); // pin is input
2370  IRMP_GPIO_STRUCT->CR1 |= (1<<IRMP_BIT); // activate pullup
2371 
2372 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2373  pinMode(IRMP_PIN, INPUT);
2374 
2375 #elif defined(__xtensa__) // ESP8266
2376  pinMode(IRMP_BIT_NUMBER, INPUT);
2377  // select pin function
2378 # if (IRMP_BIT_NUMBER == 12)
2379  PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);
2380 // doesn't work for me:
2381 // # elif (IRMP_BIT_NUMBER == 13)
2382 // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);
2383 # else
2384 # warning Please add PIN_FUNC_SELECT when necessary.
2385 # endif
2386  GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER);
2387 
2388 #elif defined(__MBED__)
2389  gpio_init_in_ex(&gpioIRin, IRMP_PIN, IRMP_PINMODE); // initialize input for IR diode
2390 
2391 #elif defined(_CHIBIOS_HAL_)
2392  // ChibiOS HAL automatically initializes all pins according to the board config file, no need to repeat here
2393 
2394 #else // AVR
2395  IRMP_PORT &= ~(1<<IRMP_BIT); // deactivate pullup
2396  IRMP_DDR &= ~(1<<IRMP_BIT); // set pin to input
2397 #endif
2398 
2399 #if IRMP_LOGGING == 1
2400  irmp_uart_init ();
2401 #endif
2402 }
2403 #endif
2404 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2405  * Get IRMP data
2406  * @details gets decoded IRMP data
2407  * @param pointer in order to store IRMP data
2408  * @return TRUE: successful, FALSE: failed
2409  *---------------------------------------------------------------------------------------------------------------------------------------------------
2410  */
2411 uint_fast8_t
2412 irmp_get_data (IRMP_DATA * irmp_data_p)
2413 {
2414  uint_fast8_t rtc = FALSE;
2415 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
2416  uint_fast8_t cmd_len = 0;
2417 #endif
2418 
2419  if (irmp_ir_detected)
2420  {
2421  switch (irmp_protocol)
2422  {
2423 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2424  case IRMP_SAMSUNG_PROTOCOL:
2425  if ((irmp_command >> 8) == (~irmp_command & 0x00FF))
2426  {
2427  irmp_command &= 0xff;
2428  irmp_command |= irmp_id << 8;
2429  rtc = TRUE;
2430  }
2431  break;
2432 
2433 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2435  irmp_command = (irmp_command & 0x00FF) | ((irmp_id & 0x00FF) << 8);
2436  rtc = TRUE;
2437  break;
2438 #endif
2439 #endif
2440 
2441 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2442  case IRMP_NEC_PROTOCOL:
2443  if ((irmp_command >> 8) == (~irmp_command & 0x00FF))
2444  {
2445  irmp_command &= 0xff;
2446  rtc = TRUE;
2447  }
2448  else if (irmp_address == 0x87EE)
2449  {
2450 #ifdef ANALYZE
2451  ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2452 #endif // ANALYZE
2453  irmp_protocol = IRMP_APPLE_PROTOCOL;
2454  irmp_address = (irmp_command & 0xFF00) >> 8;
2455  irmp_command &= 0x00FF;
2456  rtc = TRUE;
2457  }
2458  else
2459  {
2460 #ifdef ANALYZE
2461  ANALYZE_PRINTF ("Switching to ONKYO protocol\n");
2462 #endif // ANALYZE
2463  irmp_protocol = IRMP_ONKYO_PROTOCOL;
2464  rtc = TRUE;
2465  }
2466  break;
2467 #endif
2468 
2469 
2470 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2471  case IRMP_VINCENT_PROTOCOL:
2472  if ((irmp_command >> 8) == (irmp_command & 0x00FF))
2473  {
2474  irmp_command &= 0xff;
2475  rtc = TRUE;
2476  }
2477  break;
2478 #endif
2479 
2480 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2481  case IRMP_BOSE_PROTOCOL:
2482  if ((irmp_command >> 8) == (~irmp_command & 0x00FF))
2483  {
2484  irmp_command &= 0xff;
2485  rtc = TRUE;
2486  }
2487  break;
2488 #endif
2489 
2490 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
2491  case IRMP_MERLIN_PROTOCOL:
2492  if (irmp_bit == 10)
2493  {
2494  rtc = TRUE;
2495  }
2496  else if (irmp_bit >= 19 && ((irmp_bit - 3) % 8 == 0))
2497  {
2498  if (((irmp_command >> 1) & 1) != (irmp_command & 1))
2499  {
2500  irmp_command >>= 1;
2501  irmp_command |= ((irmp_address & 1) << (irmp_bit - 12));
2502  irmp_address >>= 1;
2503  cmd_len = (irmp_bit - 11) >> 3;
2504  rtc = TRUE;
2505  }
2506  }
2507  break;
2508 #endif
2509 
2510 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2511  case IRMP_SIEMENS_PROTOCOL:
2512  case IRMP_RUWIDO_PROTOCOL:
2513  if (((irmp_command >> 1) & 0x0001) == (~irmp_command & 0x0001))
2514  {
2515  irmp_command >>= 1;
2516  rtc = TRUE;
2517  }
2518  break;
2519 #endif
2520 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2522  if (irmp_command != 0x0000)
2523  {
2524  rtc = TRUE;
2525  }
2526  break;
2527 #endif
2528 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2529  case IRMP_RC5_PROTOCOL:
2530  irmp_address &= ~0x20; // clear toggle bit
2531  rtc = TRUE;
2532  break;
2533 #endif
2534 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2535  case IRMP_S100_PROTOCOL:
2536  irmp_address &= ~0x20; // clear toggle bit
2537  rtc = TRUE;
2538  break;
2539 #endif
2540 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2541  case IRMP_IR60_PROTOCOL:
2542  if (irmp_command != 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2543  {
2544  rtc = TRUE;
2545  }
2546  else
2547  {
2548 #ifdef ANALYZE
2549  ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2550 #endif // ANALYZE
2551  }
2552  break;
2553 #endif
2554 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2555  case IRMP_RCCAR_PROTOCOL:
2556  // frame in irmp_data:
2557  // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2558  // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2559  irmp_address = (irmp_command & 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2560  irmp_command = ((irmp_command & 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2561  ((irmp_command & 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2562  ((irmp_command & 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2563  rtc = TRUE; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2564  break;
2565 #endif
2566 
2567 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2568  case IRMP_NETBOX_PROTOCOL:
2569  if (irmp_command & 0x1000) // last bit set?
2570  {
2571  if ((irmp_command & 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2572  {
2573  irmp_command >>= 5;
2574  irmp_command &= 0x7F;
2575  rtc = TRUE;
2576  }
2577  else if ((irmp_command & 0x1f) == 0x10) // key released: 000 01 (LSB)
2578  {
2579  irmp_command >>= 5;
2580  irmp_command |= 0x80;
2581  rtc = TRUE;
2582  }
2583  else
2584  {
2585 #ifdef ANALYZE
2586  ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2587 #endif // ANALYZE
2588  }
2589  }
2590  else
2591  {
2592 #ifdef ANALYZE
2593  ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2594 #endif // ANALYZE
2595  }
2596  break;
2597 #endif
2598 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2599  case IRMP_LEGO_PROTOCOL:
2600  {
2601  uint_fast8_t crc = 0x0F ^ ((irmp_command & 0xF000) >> 12) ^ ((irmp_command & 0x0F00) >> 8) ^ ((irmp_command & 0x00F0) >> 4);
2602 
2603  if ((irmp_command & 0x000F) == crc)
2604  {
2605  irmp_command >>= 4;
2606  rtc = TRUE;
2607  }
2608  else
2609  {
2610 #ifdef ANALYZE
2611  ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2612 #endif // ANALYZE
2613  // rtc = TRUE; // don't accept codes with CRC errors
2614  }
2615  break;
2616  }
2617 #endif
2618 
2619 #if IRMP_SUPPORT_METZ_PROTOCOL == 1
2620  case IRMP_METZ_PROTOCOL:
2621  irmp_address &= ~0x40; // clear toggle bit
2622  if (((~irmp_address) & 0x07) == (irmp_address >> 3) && ((~irmp_command) & 0x3f) == (irmp_command >> 6))
2623  {
2624  irmp_address >>= 3;
2625  irmp_command >>= 6;
2626  rtc = TRUE;
2627  }
2628  break;
2629 #endif
2630  default:
2631  {
2632  rtc = TRUE;
2633  break;
2634  }
2635  }
2636 
2637  if (rtc)
2638  {
2639  irmp_data_p->protocol = irmp_protocol;
2640  irmp_data_p->address = irmp_address;
2641  irmp_data_p->command = irmp_command;
2642  irmp_data_p->flags = irmp_flags;
2643 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
2644  irmp_data_p->flags |= cmd_len;
2645 #endif
2646  }
2647  else
2648  {
2649  irmp_protocol = IRMP_UNKNOWN_PROTOCOL;
2650  }
2651 
2652  irmp_command = 0; // don't reset irmp_protocol here, needed for detection of NEC & JVC repetition frames!
2653  irmp_address = 0;
2654  irmp_flags = 0;
2655 
2656  irmp_ir_detected = FALSE;
2657  }
2658 
2659  return rtc;
2660 }
2661 
2662 #if IRMP_USE_CALLBACK == 1
2663 void
2664 irmp_set_callback_ptr (void (*cb)(uint_fast8_t))
2665 {
2666  irmp_callback_ptr = cb;
2667 }
2668 #endif // IRMP_USE_CALLBACK == 1
2669 
2670 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2671 static uint_fast16_t irmp_tmp_address; // ir address
2672 #if IRMP_32_BIT == 1
2673 static uint_fast32_t irmp_tmp_command; // ir command
2674 #else
2675 static uint_fast16_t irmp_tmp_command; // ir command
2676 #endif
2677 
2678 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2679 static uint_fast16_t irmp_tmp_address2; // ir address
2680 static uint_fast16_t irmp_tmp_command2; // ir command
2681 #endif
2682 
2683 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2684 static uint_fast16_t irmp_lgair_address; // ir address
2685 static uint_fast16_t irmp_lgair_command; // ir command
2686 #endif
2687 
2688 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2689 static uint_fast16_t irmp_tmp_id; // ir id (only SAMSUNG)
2690 #endif
2691 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2692 static uint8_t xor_check[6]; // check kaseikyo "parity" bits
2693 static uint_fast8_t genre2; // save genre2 bits here, later copied to MSB in flags
2694 #endif
2695 
2696 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2697 static uint_fast8_t parity; // number of '1' of the first 14 bits, check if even.
2698 #endif
2699 
2700 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2701 static uint_fast8_t check; // number of '1' of the first 14 bits, check if even.
2702 static uint_fast8_t mitsu_parity; // number of '1' of the first 14 bits, check if even.
2703 #endif
2704 
2705 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2706  * store bit
2707  * @details store bit in temp address or temp command
2708  * @param value to store: 0 or 1
2709  *---------------------------------------------------------------------------------------------------------------------------------------------------
2710  */
2711 // verhindert, dass irmp_store_bit() inline compiliert wird:
2712 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2713 
2714 static void
2715 irmp_store_bit (uint_fast8_t value)
2716 {
2717 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2718  if (irmp_param.protocol == IRMP_ACP24_PROTOCOL) // squeeze 64 bits into 16 bits:
2719  {
2720  if (value)
2721  {
2722  // ACP24-Frame:
2723  // 1 2 3 4 5 6
2724  // 0123456789012345678901234567890123456789012345678901234567890123456789
2725  // N VVMMM ? ??? t vmA x y TTTT
2726  //
2727  // irmp_data_p->command:
2728  //
2729  // 5432109876543210
2730  // NAVVvMMMmtxyTTTT
2731 
2732  switch (irmp_bit)
2733  {
2734  case 0: irmp_tmp_command |= (1<<15); break; // N
2735  case 2: irmp_tmp_command |= (1<<13); break; // V
2736  case 3: irmp_tmp_command |= (1<<12); break; // V
2737  case 4: irmp_tmp_command |= (1<<10); break; // M
2738  case 5: irmp_tmp_command |= (1<< 9); break; // M
2739  case 6: irmp_tmp_command |= (1<< 8); break; // M
2740  case 20: irmp_tmp_command |= (1<< 6); break; // t
2741  case 22: irmp_tmp_command |= (1<<11); break; // v
2742  case 23: irmp_tmp_command |= (1<< 7); break; // m
2743  case 24: irmp_tmp_command |= (1<<14); break; // A
2744  case 26: irmp_tmp_command |= (1<< 5); break; // x
2745  case 44: irmp_tmp_command |= (1<< 4); break; // y
2746  case 66: irmp_tmp_command |= (1<< 3); break; // T
2747  case 67: irmp_tmp_command |= (1<< 2); break; // T
2748  case 68: irmp_tmp_command |= (1<< 1); break; // T
2749  case 69: irmp_tmp_command |= (1<< 0); break; // T
2750  }
2751  }
2752  }
2753  else
2754 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2755 
2756 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2757  if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)
2758  {
2759  if (irmp_bit < 14)
2760  {
2761  if (value)
2762  {
2763  parity++;
2764  }
2765  }
2766  else if (irmp_bit == 14)
2767  {
2768  if (value) // value == 1: even parity
2769  {
2770  if (parity & 0x01)
2771  {
2772  parity = PARITY_CHECK_FAILED;
2773  }
2774  else
2775  {
2776  parity = PARITY_CHECK_OK;
2777  }
2778  }
2779  else
2780  {
2781  if (parity & 0x01) // value == 0: odd parity
2782  {
2783  parity = PARITY_CHECK_OK;
2784  }
2785  else
2786  {
2787  parity = PARITY_CHECK_FAILED;
2788  }
2789  }
2790  }
2791  }
2792  else
2793 #endif
2794  {
2795  ;
2796  }
2797 
2798 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2799  if (irmp_bit == 0 && irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL)
2800  {
2801  first_bit = value;
2802  }
2803  else
2804 #endif
2805 
2806  if (irmp_bit >= irmp_param.address_offset && irmp_bit < irmp_param.address_end)
2807  {
2808  if (irmp_param.lsb_first)
2809  {
2810  irmp_tmp_address |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.address_offset)); // CV wants cast
2811  }
2812  else
2813  {
2814  irmp_tmp_address <<= 1;
2815  irmp_tmp_address |= value;
2816  }
2817  }
2818  else if (irmp_bit >= irmp_param.command_offset && irmp_bit < irmp_param.command_end)
2819  {
2820  if (irmp_param.lsb_first)
2821  {
2822 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2823  if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit >= 32)
2824  {
2825  irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - 32)); // CV wants cast
2826  }
2827  else
2828 #endif
2829  {
2830  irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - irmp_param.command_offset)); // CV wants cast
2831  }
2832  }
2833  else
2834  {
2835  irmp_tmp_command <<= 1;
2836  irmp_tmp_command |= value;
2837  }
2838  }
2839 
2840 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2841  if (irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL)
2842  {
2843  if (irmp_bit < 8)
2844  {
2845  irmp_lgair_address <<= 1; // LGAIR uses MSB
2846  irmp_lgair_address |= value;
2847  }
2848  else if (irmp_bit < 24)
2849  {
2850  irmp_lgair_command <<= 1; // LGAIR uses MSB
2851  irmp_lgair_command |= value;
2852  }
2853  }
2854  // NO else!
2855 #endif
2856 
2857 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2858  if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit >= 13 && irmp_bit < 26)
2859  {
2860  irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit - 13)); // CV wants cast
2861  }
2862  else
2863 #endif
2864 
2865 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2866  if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit >= SAMSUNG_ID_OFFSET && irmp_bit < SAMSUNG_ID_OFFSET + SAMSUNG_ID_LEN)
2867  {
2868  irmp_tmp_id |= (((uint_fast16_t) (value)) << (irmp_bit - SAMSUNG_ID_OFFSET)); // store with LSB first
2869  }
2870  else
2871 #endif
2872 
2873 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2874  if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)
2875  {
2876  if (irmp_bit >= 20 && irmp_bit < 24)
2877  {
2878  irmp_tmp_command |= (((uint_fast16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2879  }
2880  else if (irmp_bit >= 24 && irmp_bit < 28)
2881  {
2882  genre2 |= (((uint_fast8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2883  }
2884 
2885  if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)
2886  {
2887  if (value)
2888  {
2889  xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8);
2890  }
2891  else
2892  {
2893  xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8));
2894  }
2895  }
2896  }
2897  else
2898 #endif
2899 
2900 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2901  if (irmp_param.protocol == IRMP_MITSU_HEAVY_PROTOCOL) // squeeze 64 bits into 16 bits:
2902  {
2903  if (irmp_bit == 72 )
2904  { // irmp_tmp_address, irmp_tmp_command received: check parity & compress
2905  mitsu_parity = PARITY_CHECK_OK;
2906 
2907  check = irmp_tmp_address >> 8; // inverted upper byte == lower byte?
2908  check = ~ check;
2909 
2910  if (check == (irmp_tmp_address & 0xFF))
2911  { // ok:
2912  irmp_tmp_address <<= 8; // throw away upper byte
2913  }
2914  else
2915  {
2916  mitsu_parity = PARITY_CHECK_FAILED;
2917  }
2918 
2919  check = irmp_tmp_command >> 8; // inverted upper byte == lower byte?
2920  check = ~ check;
2921  if (check == (irmp_tmp_command & 0xFF))
2922  { // ok: pack together
2923  irmp_tmp_address |= irmp_tmp_command & 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3
2924  }
2925  else
2926  {
2927  mitsu_parity = PARITY_CHECK_FAILED;
2928  }
2929  irmp_tmp_command = 0;
2930  }
2931 
2932  if (irmp_bit >= 72 )
2933  { // receive 3. word in irmp_tmp_command
2934  irmp_tmp_command <<= 1;
2935  irmp_tmp_command |= value;
2936  }
2937  }
2938  else
2939 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
2940  {
2941  ;
2942  }
2943 
2944  irmp_bit++;
2945 }
2946 
2947 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2948  * store bit
2949  * @details store bit in temp address or temp command
2950  * @param value to store: 0 or 1
2951  *---------------------------------------------------------------------------------------------------------------------------------------------------
2952  */
2953 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2954 static void
2955 irmp_store_bit2 (uint_fast8_t value)
2956 {
2957  uint_fast8_t irmp_bit2;
2958 
2959  if (irmp_param.protocol)
2960  {
2961  irmp_bit2 = irmp_bit - 2;
2962  }
2963  else
2964  {
2965  irmp_bit2 = irmp_bit - 1;
2966  }
2967 
2968  if (irmp_bit2 >= irmp_param2.address_offset && irmp_bit2 < irmp_param2.address_end)
2969  {
2970  irmp_tmp_address2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.address_offset)); // CV wants cast
2971  }
2972  else if (irmp_bit2 >= irmp_param2.command_offset && irmp_bit2 < irmp_param2.command_end)
2973  {
2974  irmp_tmp_command2 |= (((uint_fast16_t) (value)) << (irmp_bit2 - irmp_param2.command_offset)); // CV wants cast
2975  }
2976 }
2977 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2978 
2979 #ifdef ANALYZE
2980 static uint32_t s_curSample;
2981 static uint32_t s_startBitSample;
2982 #endif
2983 
2984 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2985  * ISR routine
2986  * @details ISR routine, called 10000 times per second
2987  *---------------------------------------------------------------------------------------------------------------------------------------------------
2988  */
2989 uint_fast8_t
2990 irmp_ISR (void)
2991 {
2992  static uint_fast8_t irmp_start_bit_detected; // flag: start bit detected
2993  static uint_fast8_t wait_for_space; // flag: wait for data bit space
2994  static uint_fast8_t wait_for_start_space; // flag: wait for start bit space
2995  static uint_fast8_t irmp_pulse_time; // count bit time for pulse
2996  static PAUSE_LEN irmp_pause_time; // count bit time for pause
2997  static uint_fast16_t last_irmp_address = 0xFFFF; // save last irmp address to recognize key repetition
2998 #if IRMP_32_BIT == 1
2999  static uint_fast32_t last_irmp_command = 0xFFFFFFFF; // save last irmp command to recognize key repetition
3000 #else
3001  static uint_fast16_t last_irmp_command = 0xFFFF; // save last irmp command to recognize key repetition
3002 #endif
3003  static uint_fast16_t key_repetition_len; // SIRCS repeats frame 2-5 times with 45 ms pause
3004  static uint_fast8_t repetition_frame_number;
3005 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3006  static uint_fast16_t last_irmp_denon_command; // save last irmp command to recognize DENON frame repetition
3007  static uint_fast16_t denon_repetition_len = 0xFFFF; // denon repetition len of 2nd auto generated frame
3008 #endif
3009 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
3010  static uint_fast8_t rc5_cmd_bit6; // bit 6 of RC5 command is the inverted 2nd start bit
3011 #endif
3012 #if IRMP_SUPPORT_MANCHESTER == 1
3013  static PAUSE_LEN last_pause; // last pause value
3014 #endif
3015 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3016  static uint_fast8_t last_value; // last bit value
3017 #endif
3018 #if IRMP_SUPPORT_RCII_PROTOCOL == 1
3019  static uint_fast8_t waiting_for_2nd_pulse = 0;
3020 #endif
3021  uint_fast8_t irmp_input; // input value
3022 
3023 #ifdef ANALYZE
3024 
3025 #if 0 // only for test
3026  static uint_fast8_t last_irmp_start_bit_detected = 0xFF;
3027  static uint_fast8_t last_irmp_pulse_time = 0xFF;
3028 
3029  if (last_irmp_start_bit_detected != irmp_start_bit_detected || last_irmp_pulse_time != irmp_pulse_time)
3030  {
3031  last_irmp_start_bit_detected = irmp_start_bit_detected;
3032  last_irmp_pulse_time = irmp_pulse_time;
3033 
3034  printf ("%d %d %d\n", time_counter, irmp_start_bit_detected, irmp_pulse_time);
3035  }
3036 #endif // 0
3037 
3038  time_counter++;
3039 #endif // ANALYZE
3040 
3041 #if defined(__SDCC_stm8)
3042  irmp_input = input(IRMP_GPIO_STRUCT->IDR)
3043 #elif defined(__MBED__)
3044  //irmp_input = inputPin;
3045  irmp_input = gpio_read (&gpioIRin);
3046 #else
3047  irmp_input = input(IRMP_PIN);
3048 #endif
3049 
3050 #if IRMP_USE_CALLBACK == 1
3051  if (irmp_callback_ptr)
3052  {
3053  static uint_fast8_t last_inverted_input;
3054 
3055  if (last_inverted_input != !irmp_input)
3056  {
3057  (*irmp_callback_ptr) (! irmp_input);
3058  last_inverted_input = !irmp_input;
3059  }
3060  }
3061 #endif // IRMP_USE_CALLBACK == 1
3062 
3063  irmp_log(irmp_input); // log ir signal, if IRMP_LOGGING defined
3064 
3065  if (! irmp_ir_detected) // ir code already detected?
3066  { // no...
3067  if (! irmp_start_bit_detected) // start bit detected?
3068  { // no...
3069  if (! irmp_input) // receiving burst?
3070  { // yes...
3071 // irmp_busy_flag = TRUE;
3072 #ifdef ANALYZE
3073  if (! irmp_pulse_time)
3074  {
3075  s_startBitSample = s_curSample;
3076  ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);
3077  }
3078 #endif // ANALYZE
3079  irmp_pulse_time++; // increment counter
3080  }
3081  else
3082  { // no...
3083  if (irmp_pulse_time) // it's dark....
3084  { // set flags for counting the time of darkness...
3085  irmp_start_bit_detected = 1;
3086  wait_for_start_space = 1;
3087  wait_for_space = 0;
3088  irmp_tmp_command = 0;
3089  irmp_tmp_address = 0;
3090 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3091  genre2 = 0;
3092 #endif
3093 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3094  irmp_tmp_id = 0;
3095 #endif
3096 
3097 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
3098  irmp_tmp_command2 = 0;
3099  irmp_tmp_address2 = 0;
3100 #endif
3101 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3102  irmp_lgair_command = 0;
3103  irmp_lgair_address = 0;
3104 #endif
3105  irmp_bit = 0xff;
3106  irmp_pause_time = 1; // 1st pause: set to 1, not to 0!
3107 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
3108  rc5_cmd_bit6 = 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
3109 #endif
3110  }
3111  else
3112  {
3113  if (key_repetition_len < 0xFFFF) // avoid overflow of counter
3114  {
3115  key_repetition_len++;
3116 
3117 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3118  if (denon_repetition_len < 0xFFFF) // avoid overflow of counter
3119  {
3120  denon_repetition_len++;
3121 
3122  if (denon_repetition_len >= DENON_AUTO_REPETITION_PAUSE_LEN && last_irmp_denon_command != 0)
3123  {
3124 #ifdef ANALYZE
3125  ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
3126  (double) (time_counter * 1000) / F_INTERRUPTS);
3127 #endif // ANALYZE
3128  last_irmp_denon_command = 0;
3129  denon_repetition_len = 0xFFFF;
3130  }
3131  }
3132 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3133  }
3134  }
3135  }
3136  }
3137  else
3138  {
3139  if (wait_for_start_space) // we have received start bit...
3140  { // ...and are counting the time of darkness
3141  if (irmp_input) // still dark?
3142  { // yes
3143  irmp_pause_time++; // increment counter
3144 
3145 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
3146  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) ||
3147  irmp_pause_time > IRMP_TIMEOUT_NIKON_LEN)
3148 #else
3149  if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?
3150 #endif
3151  { // yes...
3152 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3153  if (irmp_protocol == IRMP_JVC_PROTOCOL) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
3154  {
3155  ;
3156  }
3157  else
3158 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3159  {
3160 #ifdef ANALYZE
3161  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);
3163 #endif // ANALYZE
3164  }
3165 
3166  irmp_start_bit_detected = 0; // reset flags, let's wait for another start bit
3167  irmp_pulse_time = 0;
3168  irmp_pause_time = 0;
3169  }
3170  }
3171  else
3172  { // receiving first data pulse!
3173  IRMP_PARAMETER * irmp_param_p;
3174  irmp_param_p = (IRMP_PARAMETER *) 0;
3175 
3176 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3177  irmp_param2.protocol = 0;
3178 #endif
3179 
3180 #ifdef ANALYZE
3181  ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);
3182 #endif // ANALYZE
3183 
3184 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3185  if (irmp_pulse_time >= SIRCS_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIRCS_START_BIT_PULSE_LEN_MAX &&
3186  irmp_pause_time >= SIRCS_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIRCS_START_BIT_PAUSE_LEN_MAX)
3187  { // it's SIRCS
3188 #ifdef ANALYZE
3189  ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3192 #endif // ANALYZE
3193  irmp_param_p = (IRMP_PARAMETER *) &sircs_param;
3194  }
3195  else
3196 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3197 
3198 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3199  if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame
3200  irmp_pulse_time >= JVC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= JVC_START_BIT_PULSE_LEN_MAX &&
3201  irmp_pause_time >= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX)
3202  {
3203 #ifdef ANALYZE
3204  ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3207 #endif // ANALYZE
3208  irmp_param_p = (IRMP_PARAMETER *) &nec_param;
3209  }
3210  else
3211 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3212 
3213 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3214  if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&
3215  irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)
3216  {
3217 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3218 #ifdef ANALYZE
3219  ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3222 #endif // ANALYZE
3223  irmp_param_p = (IRMP_PARAMETER *) &nec42_param;
3224 #else
3225 #ifdef ANALYZE
3226  ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3229 #endif // ANALYZE
3230  irmp_param_p = (IRMP_PARAMETER *) &nec_param;
3231 #endif
3232  }
3233  else if (irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&
3234  irmp_pause_time >= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX)
3235  { // it's NEC
3236 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3237  if (irmp_protocol == IRMP_JVC_PROTOCOL) // last protocol was JVC, awaiting repeat frame
3238  { // some jvc remote controls use nec repetition frame for jvc repetition frame
3239 #ifdef ANALYZE
3240  ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3243 #endif // ANALYZE
3244  irmp_param_p = (IRMP_PARAMETER *) &nec_param;
3245  }
3246  else
3247 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3248  {
3249 #ifdef ANALYZE
3250  ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3253 #endif // ANALYZE
3254 
3255  irmp_param_p = (IRMP_PARAMETER *) &nec_rep_param;
3256  }
3257  }
3258  else
3259 
3260 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3261  if (irmp_protocol == IRMP_JVC_PROTOCOL && // last protocol was JVC, awaiting repeat frame
3262  irmp_pulse_time >= NEC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NEC_START_BIT_PULSE_LEN_MAX &&
3263  irmp_pause_time >= NEC_0_PAUSE_LEN_MIN && irmp_pause_time <= NEC_0_PAUSE_LEN_MAX)
3264  { // it's JVC repetition type 3
3265 #ifdef ANALYZE
3266  ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3269 #endif // ANALYZE
3270  irmp_param_p = (IRMP_PARAMETER *) &nec_param;
3271  }
3272  else
3273 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3274 
3275 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3276 
3277 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3278  if (irmp_pulse_time >= TELEFUNKEN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= TELEFUNKEN_START_BIT_PULSE_LEN_MAX &&
3279  irmp_pause_time >= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX)
3280  {
3281 #ifdef ANALYZE
3282  ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3285 #endif // ANALYZE
3286  irmp_param_p = (IRMP_PARAMETER *) &telefunken_param;
3287  }
3288  else
3289 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3290 
3291 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3292  if (irmp_pulse_time >= ROOMBA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_START_BIT_PULSE_LEN_MAX &&
3293  irmp_pause_time >= ROOMBA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ROOMBA_START_BIT_PAUSE_LEN_MAX)
3294  {
3295 #ifdef ANALYZE
3296  ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3299 #endif // ANALYZE
3300  irmp_param_p = (IRMP_PARAMETER *) &roomba_param;
3301  }
3302  else
3303 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3304 
3305 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
3306  if (irmp_pulse_time >= ACP24_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ACP24_START_BIT_PULSE_LEN_MAX &&
3307  irmp_pause_time >= ACP24_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ACP24_START_BIT_PAUSE_LEN_MAX)
3308  {
3309 #ifdef ANALYZE
3310  ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3313 #endif // ANALYZE
3314  irmp_param_p = (IRMP_PARAMETER *) &acp24_param;
3315  }
3316  else
3317 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3318 
3319 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3320  if (irmp_pulse_time >= PENTAX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PENTAX_START_BIT_PULSE_LEN_MAX &&
3321  irmp_pause_time >= PENTAX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PENTAX_START_BIT_PAUSE_LEN_MAX)
3322  {
3323 #ifdef ANALYZE
3324  ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3327 #endif // ANALYZE
3328  irmp_param_p = (IRMP_PARAMETER *) &pentax_param;
3329  }
3330  else
3331 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3332 
3333 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
3334  if (irmp_pulse_time >= NIKON_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NIKON_START_BIT_PULSE_LEN_MAX &&
3335  irmp_pause_time >= NIKON_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NIKON_START_BIT_PAUSE_LEN_MAX)
3336  {
3337 #ifdef ANALYZE
3338  ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3341 #endif // ANALYZE
3342  irmp_param_p = (IRMP_PARAMETER *) &nikon_param;
3343  }
3344  else
3345 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
3346 
3347 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3348  if (irmp_pulse_time >= SAMSUNG_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_START_BIT_PULSE_LEN_MAX &&
3349  irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)
3350  { // it's SAMSUNG
3351 #ifdef ANALYZE
3352  ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3355 #endif // ANALYZE
3356  irmp_param_p = (IRMP_PARAMETER *) &samsung_param;
3357  }
3358  else
3359 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3360 
3361 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3362  if (irmp_pulse_time >= SAMSUNGAH_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNGAH_START_BIT_PULSE_LEN_MAX &&
3363  irmp_pause_time >= SAMSUNGAH_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNGAH_START_BIT_PAUSE_LEN_MAX)
3364  { // it's SAMSUNGAH
3365 #ifdef ANALYZE
3366  ANALYZE_PRINTF ("protocol = SAMSUNGAH, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3369 #endif // ANALYZE
3370  irmp_param_p = (IRMP_PARAMETER *) &samsungah_param;
3371  }
3372  else
3373 #endif // IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3374 
3375 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3376  if (irmp_pulse_time >= MATSUSHITA_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MATSUSHITA_START_BIT_PULSE_LEN_MAX &&
3377  irmp_pause_time >= MATSUSHITA_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MATSUSHITA_START_BIT_PAUSE_LEN_MAX)
3378  { // it's MATSUSHITA
3379 #ifdef ANALYZE
3380  ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3383 #endif // ANALYZE
3384  irmp_param_p = (IRMP_PARAMETER *) &matsushita_param;
3385  }
3386  else
3387 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3388 
3389 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3390  if (irmp_pulse_time >= KASEIKYO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KASEIKYO_START_BIT_PULSE_LEN_MAX &&
3391  irmp_pause_time >= KASEIKYO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KASEIKYO_START_BIT_PAUSE_LEN_MAX)
3392  { // it's KASEIKYO
3393 #ifdef ANALYZE
3394  ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3397 #endif // ANALYZE
3398  irmp_param_p = (IRMP_PARAMETER *) &kaseikyo_param;
3399  }
3400  else
3401 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3402 
3403 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3404  if (irmp_pulse_time >= PANASONIC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= PANASONIC_START_BIT_PULSE_LEN_MAX &&
3405  irmp_pause_time >= PANASONIC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= PANASONIC_START_BIT_PAUSE_LEN_MAX)
3406  { // it's PANASONIC
3407 #ifdef ANALYZE
3408  ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3411 #endif // ANALYZE
3412  irmp_param_p = (IRMP_PARAMETER *) &panasonic_param;
3413  }
3414  else
3415 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3416 
3417 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3418  if (irmp_pulse_time >= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX &&
3419  irmp_pause_time >= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX)
3420  { // it's MITSU_HEAVY
3421 #ifdef ANALYZE
3422  ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3425 #endif // ANALYZE
3426  irmp_param_p = (IRMP_PARAMETER *) &mitsu_heavy_param;
3427  }
3428  else
3429 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3430 
3431 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3432  if (irmp_pulse_time >= VINCENT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= VINCENT_START_BIT_PULSE_LEN_MAX &&
3433  irmp_pause_time >= VINCENT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= VINCENT_START_BIT_PAUSE_LEN_MAX)
3434  { // it's VINCENT
3435 #ifdef ANALYZE
3436  ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3439 #endif // ANALYZE
3440  irmp_param_p = (IRMP_PARAMETER *) &vincent_param;
3441  }
3442  else
3443 #endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3444 
3445 #if IRMP_SUPPORT_METZ_PROTOCOL == 1
3446  if (irmp_pulse_time >= METZ_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= METZ_START_BIT_PULSE_LEN_MAX &&
3447  irmp_pause_time >= METZ_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= METZ_START_BIT_PAUSE_LEN_MAX)
3448  {
3449 #ifdef ANALYZE
3450  ANALYZE_PRINTF ("protocol = METZ, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3453 #endif // ANALYZE
3454  irmp_param_p = (IRMP_PARAMETER *) &metz_param;
3455  }
3456  else
3457 #endif // IRMP_SUPPORT_METZ_PROTOCOL == 1
3458 
3459 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
3460  if (irmp_pulse_time >= RADIO1_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RADIO1_START_BIT_PULSE_LEN_MAX &&
3461  irmp_pause_time >= RADIO1_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RADIO1_START_BIT_PAUSE_LEN_MAX)
3462  {
3463 #ifdef ANALYZE
3464  ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3467 #endif // ANALYZE
3468  irmp_param_p = (IRMP_PARAMETER *) &radio1_param;
3469  }
3470  else
3471 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
3472 
3473 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
3474  if (irmp_pulse_time >= RECS80_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80_START_BIT_PULSE_LEN_MAX &&
3475  irmp_pause_time >= RECS80_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80_START_BIT_PAUSE_LEN_MAX)
3476  { // it's RECS80
3477 #ifdef ANALYZE
3478  ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3481 #endif // ANALYZE
3482  irmp_param_p = (IRMP_PARAMETER *) &recs80_param;
3483  }
3484  else
3485 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
3486 
3487 #if IRMP_SUPPORT_S100_PROTOCOL == 1
3488  if (((irmp_pulse_time >= S100_START_BIT_LEN_MIN && irmp_pulse_time <= S100_START_BIT_LEN_MAX) ||
3489  (irmp_pulse_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX)) &&
3490  ((irmp_pause_time >= S100_START_BIT_LEN_MIN && irmp_pause_time <= S100_START_BIT_LEN_MAX) ||
3491  (irmp_pause_time >= 2 * S100_START_BIT_LEN_MIN && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX)))
3492  { // it's S100
3493 #ifdef ANALYZE
3494  ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3499 #endif // ANALYZE
3500 
3501  irmp_param_p = (IRMP_PARAMETER *) &s100_param;
3502  last_pause = irmp_pause_time;
3503 
3504  if ((irmp_pulse_time > S100_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * S100_START_BIT_LEN_MAX) ||
3505  (irmp_pause_time > S100_START_BIT_LEN_MAX && irmp_pause_time <= 2 * S100_START_BIT_LEN_MAX))
3506  {
3507  last_value = 0;
3508  rc5_cmd_bit6 = 1<<6;
3509  }
3510  else
3511  {
3512  last_value = 1;
3513  }
3514  }
3515  else
3516 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3517 
3518 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3519  if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||
3520  (irmp_pulse_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX)) &&
3521  ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||
3522  (irmp_pause_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX)))
3523  { // it's RC5
3524 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3525  if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&
3526  irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)
3527  {
3528 #ifdef ANALYZE
3529  ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3530  ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3533  ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3536 #endif // ANALYZE
3537  memcpy_P (&irmp_param2, &fdc_param, sizeof (IRMP_PARAMETER));
3538  }
3539  else
3540 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3541 
3542 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3543  if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&
3544  irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)
3545  {
3546 #ifdef ANALYZE
3547  ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3548  ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3551  ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3554 #endif // ANALYZE
3555  memcpy_P (&irmp_param2, &rccar_param, sizeof (IRMP_PARAMETER));
3556  }
3557  else
3558 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3559  {
3560 #ifdef ANALYZE
3561  ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3566 #endif // ANALYZE
3567  }
3568 
3569  irmp_param_p = (IRMP_PARAMETER *) &rc5_param;
3570  last_pause = irmp_pause_time;
3571 
3572  if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX) ||
3573  (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX))
3574  {
3575  last_value = 0;
3576  rc5_cmd_bit6 = 1<<6;
3577  }
3578  else
3579  {
3580  last_value = 1;
3581  }
3582  }
3583  else
3584 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3585 
3586 #if IRMP_SUPPORT_RCII_PROTOCOL == 1
3587  if ((irmp_pulse_time >= RCII_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCII_START_BIT_PULSE_LEN_MAX) &&
3588  (irmp_pause_time >= RCII_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCII_START_BIT_PAUSE_LEN_MAX))
3589  { // it's RCII
3590 #ifdef ANALYZE
3591  ANALYZE_PRINTF ("protocol = RCII, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3594 #endif // ANALYZE
3595  irmp_param_p = (IRMP_PARAMETER *) &rcii_param;
3596  last_pause = irmp_pause_time;
3597  waiting_for_2nd_pulse = 1;
3598  last_value = 1;
3599  }
3600  else
3601 #endif // IRMP_SUPPORT_RCII_PROTOCOL == 1
3602 
3603 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3604  if ( (irmp_pulse_time >= DENON_PULSE_LEN_MIN && irmp_pulse_time <= DENON_PULSE_LEN_MAX) &&
3605  ((irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX) ||
3606  (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)))
3607  { // it's DENON
3608 #ifdef ANALYZE
3609  ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3613 #endif // ANALYZE
3614  irmp_param_p = (IRMP_PARAMETER *) &denon_param;
3615  }
3616  else
3617 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3618 
3619 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3620  if ( (irmp_pulse_time >= THOMSON_PULSE_LEN_MIN && irmp_pulse_time <= THOMSON_PULSE_LEN_MAX) &&
3621  ((irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX) ||
3622  (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)))
3623  { // it's THOMSON
3624 #ifdef ANALYZE
3625  ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3629 #endif // ANALYZE
3630  irmp_param_p = (IRMP_PARAMETER *) &thomson_param;
3631  }
3632  else
3633 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3634 
3635 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3636  if (irmp_pulse_time >= BOSE_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= BOSE_START_BIT_PULSE_LEN_MAX &&
3637  irmp_pause_time >= BOSE_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BOSE_START_BIT_PAUSE_LEN_MAX)
3638  {
3639 #ifdef ANALYZE
3640  ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3643 #endif // ANALYZE
3644  irmp_param_p = (IRMP_PARAMETER *) &bose_param;
3645  }
3646  else
3647 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3648 
3649 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3650  if (irmp_pulse_time >= RC6_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RC6_START_BIT_PULSE_LEN_MAX &&
3651  irmp_pause_time >= RC6_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RC6_START_BIT_PAUSE_LEN_MAX)
3652  { // it's RC6
3653 #ifdef ANALYZE
3654  ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3657 #endif // ANALYZE
3658  irmp_param_p = (IRMP_PARAMETER *) &rc6_param;
3659  last_pause = 0;
3660  last_value = 1;
3661  }
3662  else
3663 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3664 
3665 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3666  if (irmp_pulse_time >= RECS80EXT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RECS80EXT_START_BIT_PULSE_LEN_MAX &&
3667  irmp_pause_time >= RECS80EXT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RECS80EXT_START_BIT_PAUSE_LEN_MAX)
3668  { // it's RECS80EXT
3669 #ifdef ANALYZE
3670  ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3673 #endif // ANALYZE
3674  irmp_param_p = (IRMP_PARAMETER *) &recs80ext_param;
3675  }
3676  else
3677 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3678 
3679 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3680  if (irmp_pulse_time >= NUBERT_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NUBERT_START_BIT_PULSE_LEN_MAX &&
3681  irmp_pause_time >= NUBERT_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NUBERT_START_BIT_PAUSE_LEN_MAX)
3682  { // it's NUBERT
3683 #ifdef ANALYZE
3684  ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3687 #endif // ANALYZE
3688  irmp_param_p = (IRMP_PARAMETER *) &nubert_param;
3689  }
3690  else
3691 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3692 
3693 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3694  if (irmp_pulse_time >= FAN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FAN_START_BIT_PULSE_LEN_MAX &&
3695  irmp_pause_time >= FAN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FAN_START_BIT_PAUSE_LEN_MAX)
3696  { // it's FAN
3697 #ifdef ANALYZE
3698  ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3701 #endif // ANALYZE
3702  irmp_param_p = (IRMP_PARAMETER *) &fan_param;
3703  }
3704  else
3705 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3706 
3707 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3708  if (irmp_pulse_time >= SPEAKER_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SPEAKER_START_BIT_PULSE_LEN_MAX &&
3709  irmp_pause_time >= SPEAKER_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SPEAKER_START_BIT_PAUSE_LEN_MAX)
3710  { // it's SPEAKER
3711 #ifdef ANALYZE
3712  ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3715 #endif // ANALYZE
3716  irmp_param_p = (IRMP_PARAMETER *) &speaker_param;
3717  }
3718  else
3719 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3720 
3721 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3722  if (irmp_pulse_time >= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX &&
3723  irmp_pause_time >= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX)
3724  { // it's BANG_OLUFSEN
3725 #ifdef ANALYZE
3726  ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3727  ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3730  ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3733  ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3736  ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3739 #endif // ANALYZE
3740  irmp_param_p = (IRMP_PARAMETER *) &bang_olufsen_param;
3741  last_value = 0;
3742  }
3743  else
3744 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3745 
3746 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3747  if (irmp_pulse_time >= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN && irmp_pulse_time <= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX &&
3748  irmp_pause_time >= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN && irmp_pause_time <= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX)
3749  { // it's GRUNDIG
3750 #ifdef ANALYZE
3751  ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3754 #endif // ANALYZE
3755  irmp_param_p = (IRMP_PARAMETER *) &grundig_param;
3756  last_pause = irmp_pause_time;
3757  last_value = 1;
3758  }
3759  else
3760 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3761 
3762 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3763  if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&
3764  irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)
3765  { // it's MERLIN
3766 #ifdef ANALYZE
3767  ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3770 #endif // ANALYZE
3771  irmp_param_p = (IRMP_PARAMETER *) &merlin_param;
3772  last_pause = irmp_pause_time;
3773  last_value = 1;
3774  }
3775  else
3776 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3777 
3778 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3779  if (((irmp_pulse_time >= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX) ||
3780  (irmp_pulse_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX)) &&
3781  ((irmp_pause_time >= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX) ||
3782  (irmp_pause_time >= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX)))
3783  { // it's RUWIDO or SIEMENS
3784 #ifdef ANALYZE
3785  ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3790 #endif // ANALYZE
3791  irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;
3792  last_pause = irmp_pause_time;
3793  last_value = 1;
3794  }
3795  else
3796 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3797 
3798 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3799  if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&
3800  irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)
3801  {
3802 #ifdef ANALYZE
3803  ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3806 #endif // ANALYZE
3807  irmp_param_p = (IRMP_PARAMETER *) &fdc_param;
3808  }
3809  else
3810 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3811 
3812 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3813  if (irmp_pulse_time >= RCCAR_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_START_BIT_PULSE_LEN_MAX &&
3814  irmp_pause_time >= RCCAR_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_START_BIT_PAUSE_LEN_MAX)
3815  {
3816 #ifdef ANALYZE
3817  ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3820 #endif // ANALYZE
3821  irmp_param_p = (IRMP_PARAMETER *) &rccar_param;
3822  }
3823  else
3824 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3825 
3826 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3827  if (irmp_pulse_time >= KATHREIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= KATHREIN_START_BIT_PULSE_LEN_MAX &&
3828  irmp_pause_time >= KATHREIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_START_BIT_PAUSE_LEN_MAX)
3829  { // it's KATHREIN
3830 #ifdef ANALYZE
3831  ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3834 #endif // ANALYZE
3835  irmp_param_p = (IRMP_PARAMETER *) &kathrein_param;
3836  }
3837  else
3838 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3839 
3840 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3841  if (irmp_pulse_time >= NETBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= NETBOX_START_BIT_PULSE_LEN_MAX &&
3842  irmp_pause_time >= NETBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NETBOX_START_BIT_PAUSE_LEN_MAX)
3843  { // it's NETBOX
3844 #ifdef ANALYZE
3845  ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3848 #endif // ANALYZE
3849  irmp_param_p = (IRMP_PARAMETER *) &netbox_param;
3850  }
3851  else
3852 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3853 
3854 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3855  if (irmp_pulse_time >= LEGO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= LEGO_START_BIT_PULSE_LEN_MAX &&
3856  irmp_pause_time >= LEGO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= LEGO_START_BIT_PAUSE_LEN_MAX)
3857  {
3858 #ifdef ANALYZE
3859  ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3862 #endif // ANALYZE
3863  irmp_param_p = (IRMP_PARAMETER *) &lego_param;
3864  }
3865  else
3866 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3867 
3868 #if IRMP_SUPPORT_IRMP16_PROTOCOL == 1
3869  if (irmp_pulse_time >= IRMP16_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= IRMP16_START_BIT_PULSE_LEN_MAX &&
3870  irmp_pause_time >= IRMP16_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= IRMP16_START_BIT_PAUSE_LEN_MAX)
3871  {
3872 #ifdef ANALYZE
3873  ANALYZE_PRINTF ("protocol = IRMP16, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3876 #endif // ANALYZE
3877  irmp_param_p = (IRMP_PARAMETER *) &irmp16_param;
3878  }
3879  else
3880 #endif // IRMP_SUPPORT_IRMP16_PROTOCOL == 1
3881 
3882 #if IRMP_SUPPORT_GREE_PROTOCOL == 1
3883  if (irmp_pulse_time >= GREE_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= GREE_START_BIT_PULSE_LEN_MAX &&
3884  irmp_pause_time >= GREE_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= GREE_START_BIT_PAUSE_LEN_MAX)
3885  {
3886 #ifdef ANALYZE
3887  ANALYZE_PRINTF ("protocol = GREE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3890 #endif // ANALYZE
3891  irmp_param_p = (IRMP_PARAMETER *) &gree_param;
3892  }
3893  else
3894 #endif // IRMP_SUPPORT_GREE_PROTOCOL == 1
3895 
3896 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3897  if (irmp_pulse_time >= A1TVBOX_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= A1TVBOX_START_BIT_PULSE_LEN_MAX &&
3898  irmp_pause_time >= A1TVBOX_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= A1TVBOX_START_BIT_PAUSE_LEN_MAX)
3899  { // it's A1TVBOX
3900 #ifdef ANALYZE
3901  ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3904 #endif // ANALYZE
3905  irmp_param_p = (IRMP_PARAMETER *) &a1tvbox_param;
3906  last_pause = 0;
3907  last_value = 1;
3908  }
3909  else
3910 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3911 
3912 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3913  if (irmp_pulse_time >= ORTEK_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ORTEK_START_BIT_PULSE_LEN_MAX &&
3914  irmp_pause_time >= ORTEK_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ORTEK_START_BIT_PAUSE_LEN_MAX)
3915  { // it's ORTEK (Hama)
3916 #ifdef ANALYZE
3917  ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3920 #endif // ANALYZE
3921  irmp_param_p = (IRMP_PARAMETER *) &ortek_param;
3922  last_pause = 0;
3923  last_value = 1;
3924  parity = 0;
3925  }
3926  else
3927 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3928 
3929 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3930  if (irmp_pulse_time >= RCMM32_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RCMM32_START_BIT_PULSE_LEN_MAX &&
3931  irmp_pause_time >= RCMM32_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_START_BIT_PAUSE_LEN_MAX)
3932  { // it's RCMM
3933 #ifdef ANALYZE
3934  ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3937 #endif // ANALYZE
3938  irmp_param_p = (IRMP_PARAMETER *) &rcmm_param;
3939  }
3940  else
3941 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3942  {
3943 #ifdef ANALYZE
3944  ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3945 #endif // ANALYZE
3946  irmp_start_bit_detected = 0; // wait for another start bit...
3947  }
3948 
3949  if (irmp_start_bit_detected)
3950  {
3951  memcpy_P (&irmp_param, irmp_param_p, sizeof (IRMP_PARAMETER));
3952 
3953  if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))
3954  {
3955 #ifdef ANALYZE
3956  ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max);
3957  ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max);
3958 #endif // ANALYZE
3959  }
3960  else
3961  {
3962 #ifdef ANALYZE
3963  ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max,
3964  2 * irmp_param.pulse_1_len_min, 2 * irmp_param.pulse_1_len_max);
3965  ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max,
3966  2 * irmp_param.pause_1_len_min, 2 * irmp_param.pause_1_len_max);
3967 #endif // ANALYZE
3968  }
3969 
3970 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3971  if (irmp_param2.protocol)
3972  {
3973 #ifdef ANALYZE
3974  ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2.pulse_0_len_min, irmp_param2.pulse_0_len_max);
3975  ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2.pause_0_len_min, irmp_param2.pause_0_len_max);
3976  ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2.pulse_1_len_min, irmp_param2.pulse_1_len_max);
3977  ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2.pause_1_len_min, irmp_param2.pause_1_len_max);
3978 #endif // ANALYZE
3979  }
3980 #endif
3981 
3982 
3983 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3984  if (irmp_param.protocol == IRMP_RC6_PROTOCOL)
3985  {
3986 #ifdef ANALYZE
3987  ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN, RC6_TOGGLE_BIT_LEN_MAX);
3988 #endif // ANALYZE
3989  }
3990 #endif
3991 
3992  if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))
3993  {
3994 #ifdef ANALYZE
3995  ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);
3996  ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max);
3997 #endif // ANALYZE
3998  }
3999  else
4000  {
4001 #ifdef ANALYZE
4002  ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max,
4003  2 * irmp_param.pulse_0_len_min, 2 * irmp_param.pulse_0_len_max);
4004  ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_0_len_min, irmp_param.pause_0_len_max,
4005  2 * irmp_param.pause_0_len_min, 2 * irmp_param.pause_0_len_max);
4006 #endif // ANALYZE
4007  }
4008 
4009 #ifdef ANALYZE
4010 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4011  if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)
4012  {
4013  ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);
4015  }
4016 #endif
4017 
4018  ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param.command_offset);
4019  ANALYZE_PRINTF ("command_len: %3d\n", irmp_param.command_end - irmp_param.command_offset);
4020  ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param.complete_len);
4021  ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param.stop_bit);
4022 #endif // ANALYZE
4023  }
4024 
4025  irmp_bit = 0;
4026 
4027 #if IRMP_SUPPORT_MANCHESTER == 1
4028  if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&
4029  irmp_param.protocol != IRMP_RUWIDO_PROTOCOL && // Manchester, but not RUWIDO
4030  irmp_param.protocol != IRMP_RC6_PROTOCOL /*** && // Manchester, but not RC6
4031  irmp_param.protocol != IRMP_RCII_PROTOCOL ****/) // Manchester, but not RCII
4032  {
4033  if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= 2 * irmp_param.pulse_1_len_max)
4034  {
4035 #ifdef ANALYZE
4036  ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
4037  ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');
4038  ANALYZE_NEWLINE ();
4039 #endif // ANALYZE
4040  irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1);
4041  }
4042  else if (! last_value) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
4043  {
4044 #ifdef ANALYZE
4045  ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
4046  ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');
4047  ANALYZE_NEWLINE ();
4048 #endif // ANALYZE
4049  irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0);
4050  }
4051  }
4052  else
4053 #endif // IRMP_SUPPORT_MANCHESTER == 1
4054 
4055 #if IRMP_SUPPORT_SERIAL == 1
4056  if (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL)
4057  {
4058  ; // do nothing
4059  }
4060  else
4061 #endif // IRMP_SUPPORT_SERIAL == 1
4062 
4063 
4064 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4065  if (irmp_param.protocol == IRMP_DENON_PROTOCOL)
4066  {
4067 #ifdef ANALYZE
4068  ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
4069 #endif // ANALYZE
4070 
4071  if (irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX)
4072  { // pause timings correct for "1"?
4073 #ifdef ANALYZE
4074  ANALYZE_PUTCHAR ('1'); // yes, store 1
4075  ANALYZE_NEWLINE ();
4076 #endif // ANALYZE
4077  irmp_store_bit (1);
4078  }
4079  else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
4080  { // pause timings correct for "0"?
4081 #ifdef ANALYZE
4082  ANALYZE_PUTCHAR ('0'); // yes, store 0
4083  ANALYZE_NEWLINE ();
4084 #endif // ANALYZE
4085  irmp_store_bit (0);
4086  }
4087  }
4088  else
4089 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
4090 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
4091  if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)
4092  {
4093 #ifdef ANALYZE
4094  ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
4095 #endif // ANALYZE
4096 
4097  if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)
4098  { // pause timings correct for "1"?
4099 #ifdef ANALYZE
4100  ANALYZE_PUTCHAR ('1'); // yes, store 1
4101  ANALYZE_NEWLINE ();
4102 #endif // ANALYZE
4103  irmp_store_bit (1);
4104  }
4105  else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
4106  { // pause timings correct for "0"?
4107 #ifdef ANALYZE
4108  ANALYZE_PUTCHAR ('0'); // yes, store 0
4109  ANALYZE_NEWLINE ();
4110 #endif // ANALYZE
4111  irmp_store_bit (0);
4112  }
4113  }
4114  else
4115 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
4116  {
4117  ; // else do nothing
4118  }
4119 
4120  irmp_pulse_time = 1; // set counter to 1, not 0
4121  irmp_pause_time = 0;
4122  wait_for_start_space = 0;
4123  }
4124  }
4125  else if (wait_for_space) // the data section....
4126  { // counting the time of darkness....
4127  uint_fast8_t got_light = FALSE;
4128 
4129  if (irmp_input) // still dark?
4130  { // yes...
4131  if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)
4132  {
4133  if (
4134 #if IRMP_SUPPORT_MANCHESTER == 1
4135  (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) ||
4136 #endif
4137 #if IRMP_SUPPORT_SERIAL == 1
4138  (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) ||
4139 #endif
4140  (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max))
4141  {
4142 #ifdef ANALYZE
4143  if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))
4144  {
4145  ANALYZE_PRINTF ("stop bit detected\n");
4146  }
4147 #endif // ANALYZE
4148  irmp_param.stop_bit = 0;
4149  }
4150  else
4151  {
4152 #ifdef ANALYZE
4153  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",
4154  irmp_bit, irmp_pulse_time, irmp_param.pulse_0_len_min, irmp_param.pulse_0_len_max);
4155 #endif // ANALYZE
4156  irmp_start_bit_detected = 0; // wait for another start bit...
4157  irmp_pulse_time = 0;
4158  irmp_pause_time = 0;
4159  }
4160  }
4161  else
4162  {
4163  irmp_pause_time++; // increment counter
4164 
4165 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4166  if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && // Sony has a variable number of bits:
4167  irmp_pause_time > SIRCS_PAUSE_LEN_MAX && // minimum is 12
4168  irmp_bit >= 12 - 1) // pause too long?
4169  { // yes, break and close this frame
4170  irmp_param.complete_len = irmp_bit + 1; // set new complete length
4171  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4172  irmp_tmp_address |= (irmp_bit - SIRCS_MINIMUM_DATA_LEN + 1) << 8; // new: store number of additional bits in upper byte of address!
4173  irmp_param.command_end = irmp_param.command_offset + irmp_bit + 1; // correct command length
4174  irmp_pause_time = SIRCS_PAUSE_LEN_MAX - 1; // correct pause length
4175  }
4176  else
4177 #endif
4178 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
4179  if (irmp_param.protocol == IRMP_MERLIN_PROTOCOL && // Merlin has a variable number of bits:
4180  irmp_pause_time > MERLIN_START_BIT_PAUSE_LEN_MAX && // minimum is 8
4181  irmp_bit >= 8 - 1) // pause too long?
4182  { // yes, break and close this frame
4183  irmp_param.complete_len = irmp_bit; // set new complete length
4184  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4185  irmp_pause_time = MERLIN_BIT_PAUSE_LEN_MAX - 1; // correct pause length
4186  }
4187  else
4188 #endif
4189 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
4190  if (irmp_param.protocol == IRMP_FAN_PROTOCOL && // FAN has no stop bit.
4191  irmp_bit >= FAN_COMPLETE_DATA_LEN - 1) // last bit in frame
4192  { // yes, break and close this frame
4193  if (irmp_pulse_time <= FAN_0_PULSE_LEN_MAX && irmp_pause_time >= FAN_0_PAUSE_LEN_MIN)
4194  {
4195 #ifdef ANALYZE
4196  ANALYZE_PRINTF ("Generating virtual stop bit\n");
4197 #endif // ANALYZE
4198  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4199  }
4200  else if (irmp_pulse_time >= FAN_1_PULSE_LEN_MIN && irmp_pause_time >= FAN_1_PAUSE_LEN_MIN)
4201  {
4202 #ifdef ANALYZE
4203  ANALYZE_PRINTF ("Generating virtual stop bit\n");
4204 #endif // ANALYZE
4205  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4206  }
4207  }
4208  else
4209 #endif
4210 #if IRMP_SUPPORT_SERIAL == 1
4211  // NETBOX generates no stop bit, here is the timeout condition:
4212  if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL) && irmp_param.protocol == IRMP_NETBOX_PROTOCOL &&
4213  irmp_pause_time >= NETBOX_PULSE_LEN * (NETBOX_COMPLETE_DATA_LEN - irmp_bit))
4214  {
4215  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4216  }
4217  else
4218 #endif
4219 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
4220  if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)
4221  {
4222  if (irmp_pause_time > IR60_TIMEOUT_LEN && (irmp_bit == 5 || irmp_bit == 6))
4223  {
4224 #ifdef ANALYZE
4225  ANALYZE_PRINTF ("Switching to IR60 protocol\n");
4226 #endif // ANALYZE
4227  got_light = TRUE; // this is a lie, but generates a stop bit ;-)
4228  irmp_param.stop_bit = TRUE; // set flag
4229 
4230  irmp_param.protocol = IRMP_IR60_PROTOCOL; // change protocol
4231  irmp_param.complete_len = IR60_COMPLETE_DATA_LEN; // correct complete len
4232  irmp_param.address_offset = IR60_ADDRESS_OFFSET;
4233  irmp_param.address_end = IR60_ADDRESS_OFFSET + IR60_ADDRESS_LEN;
4234  irmp_param.command_offset = IR60_COMMAND_OFFSET;
4235  irmp_param.command_end = IR60_COMMAND_OFFSET + IR60_COMMAND_LEN;
4236 
4237  irmp_tmp_command <<= 1;
4238  irmp_tmp_command |= first_bit;
4239  }
4240  else if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)
4241  { // special manchester decoder
4242  irmp_param.complete_len = GRUNDIG_COMPLETE_DATA_LEN; // correct complete len
4243  got_light = TRUE; // this is a lie, but generates a stop bit ;-)
4244  irmp_param.stop_bit = TRUE; // set flag
4245  }
4246  else if (irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN)
4247  {
4248 #ifdef ANALYZE
4249  ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit);
4250 #endif // ANALYZE
4251  irmp_param.protocol = IRMP_NOKIA_PROTOCOL; // change protocol
4252  irmp_param.address_offset = NOKIA_ADDRESS_OFFSET;
4253  irmp_param.address_end = NOKIA_ADDRESS_OFFSET + NOKIA_ADDRESS_LEN;
4254  irmp_param.command_offset = NOKIA_COMMAND_OFFSET;
4255  irmp_param.command_end = NOKIA_COMMAND_OFFSET + NOKIA_COMMAND_LEN;
4256 
4257  if (irmp_tmp_command & 0x300)
4258  {
4259  irmp_tmp_address = (irmp_tmp_command >> 8);
4260  irmp_tmp_command &= 0xFF;
4261  }
4262  }
4263  }
4264  else
4265 #endif
4266 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
4267  if (irmp_param.protocol == IRMP_RUWIDO_PROTOCOL && !irmp_param.stop_bit)
4268  {
4269  if (irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= RUWIDO_COMPLETE_DATA_LEN - 2)
4270  { // special manchester decoder
4271  irmp_param.complete_len = RUWIDO_COMPLETE_DATA_LEN; // correct complete len
4272  got_light = TRUE; // this is a lie, but generates a stop bit ;-)
4273  irmp_param.stop_bit = TRUE; // set flag
4274  }
4275  else if (irmp_bit >= RUWIDO_COMPLETE_DATA_LEN)
4276  {
4277 #ifdef ANALYZE
4278  ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
4279 #endif // ANALYZE
4280  irmp_param.protocol = IRMP_SIEMENS_PROTOCOL; // change protocol
4281  irmp_param.address_offset = SIEMENS_ADDRESS_OFFSET;
4282  irmp_param.address_end = SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN;
4283  irmp_param.command_offset = SIEMENS_COMMAND_OFFSET;
4284  irmp_param.command_end = SIEMENS_COMMAND_OFFSET + SIEMENS_COMMAND_LEN;
4285 
4286  // 76543210
4287  // RUWIDO: AAAAAAAAACCCCCCCp
4288  // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
4289  irmp_tmp_address <<= 2;
4290  irmp_tmp_address |= (irmp_tmp_command >> 6);
4291  irmp_tmp_command &= 0x003F;
4292 // irmp_tmp_command <<= 4;
4293  irmp_tmp_command |= last_value;
4294  }
4295  }
4296  else
4297 #endif
4298 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
4299  if (irmp_param.protocol == IRMP_ROOMBA_PROTOCOL && // Roomba has no stop bit
4300  irmp_bit >= ROOMBA_COMPLETE_DATA_LEN - 1) // it's the last data bit...
4301  { // break and close this frame
4302  if (irmp_pulse_time >= ROOMBA_1_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_1_PULSE_LEN_MAX)
4303  {
4304  irmp_pause_time = ROOMBA_1_PAUSE_LEN_EXACT;
4305  }
4306  else if (irmp_pulse_time >= ROOMBA_0_PULSE_LEN_MIN && irmp_pulse_time <= ROOMBA_0_PULSE_LEN_MAX)
4307  {
4308  irmp_pause_time = ROOMBA_0_PAUSE_LEN;
4309  }
4310 
4311  got_light = TRUE; // this is a lie, but helps (generates stop bit)
4312  }
4313  else
4314 #endif
4315 #if IRMP_SUPPORT_MANCHESTER == 1
4316  if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&
4317  irmp_pause_time >= 2 * irmp_param.pause_1_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)
4318  { // special manchester decoder
4319  got_light = TRUE; // this is a lie, but generates a stop bit ;-)
4320  irmp_param.stop_bit = TRUE; // set flag
4321  }
4322  else
4323 #endif // IRMP_SUPPORT_MANCHESTER == 1
4324  if (irmp_pause_time > IRMP_TIMEOUT_LEN) // timeout?
4325  { // yes...
4326  if (irmp_bit == irmp_param.complete_len - 1 && irmp_param.stop_bit == 0)
4327  {
4328  irmp_bit++;
4329  }
4330 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4331  else if ((irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL) && irmp_bit == 0)
4332  { // it was a non-standard repetition frame
4333 #ifdef ANALYZE // with 4500us pause instead of 2250us
4334  ANALYZE_PRINTF ("Detected non-standard repetition frame, switching to NEC repetition\n");
4335 #endif // ANALYZE
4336  if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)
4337  {
4338  irmp_param.stop_bit = TRUE; // set flag
4339  irmp_param.protocol = IRMP_NEC_PROTOCOL; // switch protocol
4340  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4341  irmp_tmp_address = last_irmp_address; // address is last address
4342  irmp_tmp_command = last_irmp_command; // command is last command
4343  irmp_flags |= IRMP_FLAG_REPETITION;
4344  key_repetition_len = 0;
4345  }
4346  else
4347  {
4348 #ifdef ANALYZE
4349  ANALYZE_PRINTF ("ignoring NEC repetition frame: timeout occured, key_repetition_len = %d > %d\n",
4350  (int)key_repetition_len, (int)NEC_FRAME_REPEAT_PAUSE_LEN_MAX);
4351 #endif // ANALYZE
4352  irmp_ir_detected = FALSE;
4353  }
4354  }
4355 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4356 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4357  else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit
4358  {
4359 #ifdef ANALYZE
4360  ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);
4361 #endif // ANALYZE
4362  irmp_param.stop_bit = TRUE; // set flag
4363  irmp_param.protocol = IRMP_JVC_PROTOCOL; // switch protocol
4364  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4365  irmp_tmp_command = (irmp_tmp_address >> 4); // set command: upper 12 bits are command bits
4366  irmp_tmp_address = irmp_tmp_address & 0x000F; // lower 4 bits are address bits
4367  irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...
4368  }
4369 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4370 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4371  else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 28 || irmp_bit == 29)) // it was a LGAIR stop bit
4372  {
4373 #ifdef ANALYZE
4374  ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit);
4375 #endif // ANALYZE
4376  irmp_param.stop_bit = TRUE; // set flag
4377  irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol
4378  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4379  irmp_tmp_command = irmp_lgair_command; // set command: upper 8 bits are command bits
4380  irmp_tmp_address = irmp_lgair_address; // lower 4 bits are address bits
4381  irmp_start_bit_detected = 1; // tricky: don't wait for another start bit...
4382  }
4383 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4384 
4385 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4386 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4387  else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 32) // it was a NEC stop bit
4388  {
4389 #ifdef ANALYZE
4390  ANALYZE_PRINTF ("Switching to NEC protocol\n");
4391 #endif // ANALYZE
4392  irmp_param.stop_bit = TRUE; // set flag
4393  irmp_param.protocol = IRMP_NEC_PROTOCOL; // switch protocol
4394  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4395 
4396  // 0123456789ABC0123456789ABC0123456701234567
4397  // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4398  // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
4399  irmp_tmp_address |= (irmp_tmp_address2 & 0x0007) << 13; // fm 2012-02-13: 12 -> 13
4400  irmp_tmp_command = (irmp_tmp_address2 >> 3) | (irmp_tmp_command << 10);
4401  }
4402 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4403 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4404  else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && irmp_bit == 28) // it was a NEC stop bit
4405  {
4406 #ifdef ANALYZE
4407  ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
4408 #endif // ANALYZE
4409  irmp_param.stop_bit = TRUE; // set flag
4410  irmp_param.protocol = IRMP_LGAIR_PROTOCOL; // switch protocol
4411  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4412  irmp_tmp_address = irmp_lgair_address;
4413  irmp_tmp_command = irmp_lgair_command;
4414  }
4415 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4416 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4417  else if (irmp_param.protocol == IRMP_NEC42_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit
4418  {
4419 #ifdef ANALYZE
4420  ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit);
4421 #endif // ANALYZE
4422  irmp_param.stop_bit = TRUE; // set flag
4423  irmp_param.protocol = IRMP_JVC_PROTOCOL; // switch protocol
4424  irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
4425 
4426  // 0123456789ABC0123456789ABC0123456701234567
4427  // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4428  // JVC: AAAACCCCCCCCCCCC
4429  irmp_tmp_command = (irmp_tmp_address >> 4) | (irmp_tmp_address2 << 9); // set command: upper 12 bits are command bits
4430  irmp_tmp_address = irmp_tmp_address & 0x000F; // lower 4 bits are address bits
4431  }
4432 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4433 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4434 
4435 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4436  else if (irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL && irmp_bit == 32) // it was a SAMSUNG32 stop bit
4437  {
4438 #ifdef ANALYZE
4439  ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
4440 #endif // ANALYZE
4441  irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;
4442  irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;
4443  irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;
4444  irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;
4445  }
4446 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4447 
4448 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4449  else if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL && (irmp_bit == 12 || irmp_bit == 24)) // it was a RCMM stop bit
4450  {
4451  if (irmp_bit == 12)
4452  {
4453  irmp_tmp_command = (irmp_tmp_address & 0xFF); // set command: lower 8 bits are command bits
4454  irmp_tmp_address >>= 8; // upper 4 bits are address bits
4455 
4456 #ifdef ANALYZE
4457  ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit);
4458 #endif // ANALYZE
4459  irmp_param.protocol = IRMP_RCMM12_PROTOCOL; // switch protocol
4460  }
4461  else // if ((irmp_bit == 24)
4462  {
4463 #ifdef ANALYZE
4464  ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit);
4465 #endif // ANALYZE
4466  irmp_param.protocol = IRMP_RCMM24_PROTOCOL; // switch protocol
4467  }
4468  irmp_param.stop_bit = TRUE; // set flag
4469  irmp_param.complete_len = irmp_bit; // patch length
4470  }
4471 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
4472 
4473 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4474  else if (irmp_param.protocol == IRMP_MATSUSHITA_PROTOCOL && irmp_bit == 22) // it was a TECHNICS stop bit
4475  {
4476 #ifdef ANALYZE
4477  ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit);
4478 #endif // ANALYZE
4479  // Situation:
4480  // The first 12 bits have been stored in irmp_tmp_command (LSB first)
4481  // The following 10 bits have been stored in irmp_tmp_address (LSB first)
4482  // The code of TECHNICS is:
4483  // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
4484  // ccccccccccccaaaaaaaaaa
4485  // where C is inverted value of c
4486 
4487  irmp_tmp_address <<= 1;
4488  if (irmp_tmp_command & (1<<11))
4489  {
4490  irmp_tmp_address |= 1;
4491  irmp_tmp_command &= ~(1<<11);
4492  }
4493 
4494  if (irmp_tmp_command == ((~irmp_tmp_address) & 0x07FF))
4495  {
4496  irmp_tmp_address = 0;
4497 
4498  irmp_param.protocol = IRMP_TECHNICS_PROTOCOL; // switch protocol
4499  irmp_param.complete_len = irmp_bit; // patch length
4500  }
4501  else
4502  {
4503 #ifdef ANALYZE
4504  ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
4506 #endif // ANALYZE
4507  irmp_start_bit_detected = 0; // wait for another start bit...
4508  irmp_pulse_time = 0;
4509  irmp_pause_time = 0;
4510  }
4511  }
4512 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4513  else
4514  {
4515 #ifdef ANALYZE
4516  ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time, irmp_bit);
4518 #endif // ANALYZE
4519  irmp_start_bit_detected = 0; // wait for another start bit...
4520  irmp_pulse_time = 0;
4521  irmp_pause_time = 0;
4522  }
4523  }
4524  }
4525  }
4526  else
4527  { // got light now!
4528  got_light = TRUE;
4529  }
4530 
4531  if (got_light)
4532  {
4533 #ifdef ANALYZE
4534  ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
4535 #endif // ANALYZE
4536 
4537 #if IRMP_SUPPORT_MANCHESTER == 1
4538  if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER)) // Manchester
4539  {
4540 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
4541  if (irmp_param.complete_len == irmp_bit && irmp_param.protocol == IRMP_MERLIN_PROTOCOL)
4542  {
4543  if (last_value == 0)
4544  {
4545  if (irmp_pulse_time >= 2 * irmp_param.pulse_1_len_min && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max &&
4546  last_pause >= irmp_param.pause_1_len_min && last_pause <= irmp_param.pulse_1_len_max)
4547  {
4548  irmp_param.complete_len += 2;
4549  irmp_store_bit(0);
4550  irmp_store_bit(1);
4551  }
4552  }
4553  else
4554  {
4555  if (last_pause >= 2 * irmp_param.pause_1_len_min && last_pause <= 2 * irmp_param.pulse_1_len_max)
4556  {
4557  if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max)
4558  {
4559  irmp_param.complete_len++;
4560  irmp_store_bit(0);
4561  }
4562  else if (irmp_pulse_time >= 2 * irmp_param.pulse_1_len_min && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max)
4563  {
4564  irmp_param.complete_len += 2;
4565  irmp_store_bit(0);
4566  irmp_store_bit(1);
4567  }
4568  }
4569  }
4570  }
4571  else
4572 #endif
4573 #if 1
4574  if (irmp_pulse_time > irmp_param.pulse_1_len_max /* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
4575 #else // better, but some IR-RCs use asymmetric timings :-/
4576  if (irmp_pulse_time > irmp_param.pulse_1_len_max && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max &&
4577  irmp_pause_time <= 2 * irmp_param.pause_1_len_max)
4578 #endif
4579  {
4580 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4581  if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit
4582  {
4583 #ifdef ANALYZE
4584  ANALYZE_PUTCHAR ('T');
4585 #endif // ANALYZE
4586  if (irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode 6A
4587  {
4588  irmp_store_bit (1);
4589  last_value = 1;
4590  }
4591  else // RC6 mode 0
4592  {
4593  irmp_store_bit (0);
4594  last_value = 0;
4595  }
4596 #ifdef ANALYZE
4597  ANALYZE_NEWLINE ();
4598 #endif // ANALYZE
4599  }
4600  else
4601 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4602  {
4603 #ifdef ANALYZE
4604  ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');
4605 #endif // ANALYZE
4606  irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1 );
4607 
4608 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4609  if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit
4610  {
4611 #ifdef ANALYZE
4612  ANALYZE_PUTCHAR ('T');
4613 #endif // ANALYZE
4614  irmp_store_bit (1);
4615 
4616  if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)
4617  {
4618  last_value = 0;
4619  }
4620  else
4621  {
4622  last_value = 1;
4623  }
4624 #ifdef ANALYZE
4625  ANALYZE_NEWLINE ();
4626 #endif // ANALYZE
4627  }
4628  else
4629 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4630  {
4631 #ifdef ANALYZE
4632  ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');
4633 #endif // ANALYZE
4634  irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0 );
4635 
4636 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCII_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4637  if (! irmp_param2.protocol)
4638 #endif
4639  {
4640 #ifdef ANALYZE
4641  ANALYZE_NEWLINE ();
4642 #endif // ANALYZE
4643  }
4644  last_value = (irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 1 : 0;
4645  }
4646  }
4647  }
4648  else if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max
4649  /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4650  {
4651  uint_fast8_t manchester_value;
4652 
4653  if (last_pause > irmp_param.pause_1_len_max && last_pause <= 2 * irmp_param.pause_1_len_max)
4654  {
4655  manchester_value = last_value ? 0 : 1;
4656  last_value = manchester_value;
4657  }
4658  else
4659  {
4660  manchester_value = last_value;
4661  }
4662 
4663 #ifdef ANALYZE
4664  ANALYZE_PUTCHAR (manchester_value + '0');
4665 #endif // ANALYZE
4666 
4667 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4668  if (! irmp_param2.protocol)
4669 #endif
4670  {
4671 #ifdef ANALYZE
4672  ANALYZE_NEWLINE ();
4673 #endif // ANALYZE
4674  }
4675 
4676 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4677  if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 1 && manchester_value == 1) // RC6 mode != 0 ???
4678  {
4679 #ifdef ANALYZE
4680  ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4681 #endif // ANALYZE
4682  irmp_param.complete_len = RC6_COMPLETE_DATA_LEN_LONG;
4683  irmp_param.address_offset = 5;
4684  irmp_param.address_end = irmp_param.address_offset + 15;
4685  irmp_param.command_offset = irmp_param.address_end + 1; // skip 1 system bit, changes like a toggle bit
4686  irmp_param.command_end = irmp_param.command_offset + 16 - 1;
4687  irmp_tmp_address = 0;
4688  }
4689 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4690 
4691  irmp_store_bit (manchester_value);
4692  }
4693  else
4694  {
4695 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4696  if (irmp_param2.protocol == IRMP_FDC_PROTOCOL &&
4697  irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX &&
4698  ((irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX) ||
4699  (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)))
4700  {
4701 #ifdef ANALYZE
4702  ANALYZE_PUTCHAR ('?');
4703 #endif // ANALYZE
4704  irmp_param.protocol = 0; // switch to FDC, see below
4705  }
4706  else
4707 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4708 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4709  if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL &&
4710  irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX &&
4711  ((irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX) ||
4712  (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)))
4713  {
4714 #ifdef ANALYZE
4715  ANALYZE_PUTCHAR ('?');
4716 #endif // ANALYZE
4717  irmp_param.protocol = 0; // switch to RCCAR, see below
4718  }
4719  else
4720 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4721  {
4722 #ifdef ANALYZE
4723  ANALYZE_PUTCHAR ('?');
4724  ANALYZE_NEWLINE ();
4725  ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
4727 #endif // ANALYZE
4728  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
4729  irmp_pause_time = 0;
4730  }
4731  }
4732 
4733 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4734  if (irmp_param2.protocol == IRMP_FDC_PROTOCOL && irmp_pulse_time >= FDC_PULSE_LEN_MIN && irmp_pulse_time <= FDC_PULSE_LEN_MAX)
4735  {
4736  if (irmp_pause_time >= FDC_1_PAUSE_LEN_MIN && irmp_pause_time <= FDC_1_PAUSE_LEN_MAX)
4737  {
4738 #ifdef ANALYZE
4739  ANALYZE_PRINTF (" 1 (FDC)\n");
4740 #endif // ANALYZE
4741  irmp_store_bit2 (1);
4742  }
4743  else if (irmp_pause_time >= FDC_0_PAUSE_LEN_MIN && irmp_pause_time <= FDC_0_PAUSE_LEN_MAX)
4744  {
4745 #ifdef ANALYZE
4746  ANALYZE_PRINTF (" 0 (FDC)\n");
4747 #endif // ANALYZE
4748  irmp_store_bit2 (0);
4749  }
4750 
4751  if (! irmp_param.protocol)
4752  {
4753 #ifdef ANALYZE
4754  ANALYZE_PRINTF ("Switching to FDC protocol\n");
4755 #endif // ANALYZE
4756  memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));
4757  irmp_param2.protocol = 0;
4758  irmp_tmp_address = irmp_tmp_address2;
4759  irmp_tmp_command = irmp_tmp_command2;
4760  }
4761  }
4762 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4763 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4764  if (irmp_param2.protocol == IRMP_RCCAR_PROTOCOL && irmp_pulse_time >= RCCAR_PULSE_LEN_MIN && irmp_pulse_time <= RCCAR_PULSE_LEN_MAX)
4765  {
4766  if (irmp_pause_time >= RCCAR_1_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_1_PAUSE_LEN_MAX)
4767  {
4768 #ifdef ANALYZE
4769  ANALYZE_PRINTF (" 1 (RCCAR)\n");
4770 #endif // ANALYZE
4771  irmp_store_bit2 (1);
4772  }
4773  else if (irmp_pause_time >= RCCAR_0_PAUSE_LEN_MIN && irmp_pause_time <= RCCAR_0_PAUSE_LEN_MAX)
4774  {
4775 #ifdef ANALYZE
4776  ANALYZE_PRINTF (" 0 (RCCAR)\n");
4777 #endif // ANALYZE
4778  irmp_store_bit2 (0);
4779  }
4780 
4781  if (! irmp_param.protocol)
4782  {
4783 #ifdef ANALYZE
4784  ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4785 #endif // ANALYZE
4786  memcpy (&irmp_param, &irmp_param2, sizeof (IRMP_PARAMETER));
4787  irmp_param2.protocol = 0;
4788  irmp_tmp_address = irmp_tmp_address2;
4789  irmp_tmp_command = irmp_tmp_command2;
4790  }
4791  }
4792 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4793 
4794  last_pause = irmp_pause_time;
4795  wait_for_space = 0;
4796  }
4797  else
4798 #endif // IRMP_SUPPORT_MANCHESTER == 1
4799 
4800 #if IRMP_SUPPORT_SERIAL == 1
4801  if (irmp_param.flags & IRMP_PARAM_FLAG_IS_SERIAL)
4802  {
4803  while (irmp_bit < irmp_param.complete_len && irmp_pulse_time > irmp_param.pulse_1_len_max)
4804  {
4805 #ifdef ANALYZE
4806  ANALYZE_PUTCHAR ('1');
4807 #endif // ANALYZE
4808  irmp_store_bit (1);
4809 
4810  if (irmp_pulse_time >= irmp_param.pulse_1_len_min)
4811  {
4812  irmp_pulse_time -= irmp_param.pulse_1_len_min;
4813  }
4814  else
4815  {
4816  irmp_pulse_time = 0;
4817  }
4818  }
4819 
4820  while (irmp_bit < irmp_param.complete_len && irmp_pause_time > irmp_param.pause_1_len_max)
4821  {
4822 #ifdef ANALYZE
4823  ANALYZE_PUTCHAR ('0');
4824 #endif // ANALYZE
4825  irmp_store_bit (0);
4826 
4827  if (irmp_pause_time >= irmp_param.pause_1_len_min)
4828  {
4829  irmp_pause_time -= irmp_param.pause_1_len_min;
4830  }
4831  else
4832  {
4833  irmp_pause_time = 0;
4834  }
4835  }
4836 #ifdef ANALYZE
4837  ANALYZE_NEWLINE ();
4838 #endif // ANALYZE
4839  wait_for_space = 0;
4840  }
4841  else
4842 #endif // IRMP_SUPPORT_SERIAL == 1
4843 
4844 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4845  if (irmp_param.protocol == IRMP_SAMSUNG_PROTOCOL && irmp_bit == 16) // Samsung: 16th bit
4846  {
4847  if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX &&
4848  irmp_pause_time >= SAMSUNG_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_START_BIT_PAUSE_LEN_MAX)
4849  {
4850 #ifdef ANALYZE
4851  ANALYZE_PRINTF ("SYNC\n");
4852 #endif // ANALYZE
4853  wait_for_space = 0;
4854  irmp_bit++;
4855  }
4856  else if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX)
4857  {
4858 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4859 #ifdef ANALYZE
4860  ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4861 #endif // ANALYZE
4862  irmp_param.protocol = IRMP_SAMSUNG48_PROTOCOL;
4863  irmp_param.command_offset = SAMSUNG48_COMMAND_OFFSET;
4864  irmp_param.command_end = SAMSUNG48_COMMAND_OFFSET + SAMSUNG48_COMMAND_LEN;
4865  irmp_param.complete_len = SAMSUNG48_COMPLETE_DATA_LEN;
4866 #else
4867 #ifdef ANALYZE
4868  ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4869 #endif // ANALYZE
4870  irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;
4871  irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;
4872  irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;
4873  irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;
4874 #endif
4875  if (irmp_pause_time >= SAMSUNG_1_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_1_PAUSE_LEN_MAX)
4876  {
4877 #ifdef ANALYZE
4878  ANALYZE_PUTCHAR ('1');
4879  ANALYZE_NEWLINE ();
4880 #endif // ANALYZE
4881  irmp_store_bit (1);
4882  wait_for_space = 0;
4883  }
4884  else
4885  {
4886 #ifdef ANALYZE
4887  ANALYZE_PUTCHAR ('0');
4888  ANALYZE_NEWLINE ();
4889 #endif // ANALYZE
4890  irmp_store_bit (0);
4891  wait_for_space = 0;
4892  }
4893  }
4894  else
4895  { // timing incorrect!
4896 #ifdef ANALYZE
4897  ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
4899 #endif // ANALYZE
4900  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
4901  irmp_pause_time = 0;
4902  }
4903  }
4904  else
4905 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4906 
4907 #if IRMP_SUPPORT_NEC16_PROTOCOL
4908 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4909  if (irmp_param.protocol == IRMP_NEC42_PROTOCOL &&
4910 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4911  if (irmp_param.protocol == IRMP_NEC_PROTOCOL &&
4912 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4913  irmp_bit == 8 && irmp_pause_time >= NEC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= NEC_START_BIT_PAUSE_LEN_MAX)
4914  {
4915 #ifdef ANALYZE
4916  ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4917 #endif // ANALYZE
4918  irmp_param.protocol = IRMP_NEC16_PROTOCOL;
4919  irmp_param.address_offset = NEC16_ADDRESS_OFFSET;
4920  irmp_param.address_end = NEC16_ADDRESS_OFFSET + NEC16_ADDRESS_LEN;
4921  irmp_param.command_offset = NEC16_COMMAND_OFFSET;
4922  irmp_param.command_end = NEC16_COMMAND_OFFSET + NEC16_COMMAND_LEN;
4923  irmp_param.complete_len = NEC16_COMPLETE_DATA_LEN;
4924  wait_for_space = 0;
4925  }
4926  else
4927 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4928 
4929 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4930  if (irmp_param.protocol == IRMP_BANG_OLUFSEN_PROTOCOL)
4931  {
4932  if (irmp_pulse_time >= BANG_OLUFSEN_PULSE_LEN_MIN && irmp_pulse_time <= BANG_OLUFSEN_PULSE_LEN_MAX)
4933  {
4934  if (irmp_bit == 1) // Bang & Olufsen: 3rd bit
4935  {
4936  if (irmp_pause_time >= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX)
4937  {
4938 #ifdef ANALYZE
4939  ANALYZE_PRINTF ("3rd start bit\n");
4940 #endif // ANALYZE
4941  wait_for_space = 0;
4942  irmp_bit++;
4943  }
4944  else
4945  { // timing incorrect!
4946 #ifdef ANALYZE
4947  ANALYZE_PRINTF ("error 3a B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
4948  ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4949 #endif // ANALYZE
4950  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
4951  irmp_pause_time = 0;
4952  }
4953  }
4954  else if (irmp_bit == 19) // Bang & Olufsen: trailer bit
4955  {
4956  if (irmp_pause_time >= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX)
4957  {
4958 #ifdef ANALYZE
4959  ANALYZE_PRINTF ("trailer bit\n");
4960 #endif // ANALYZE
4961  wait_for_space = 0;
4962  irmp_bit++;
4963  }
4964  else
4965  { // timing incorrect!
4966 #ifdef ANALYZE
4967  ANALYZE_PRINTF ("error 3b B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
4968  ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4969 #endif // ANALYZE
4970  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
4971  irmp_pause_time = 0;
4972  }
4973  }
4974  else
4975  {
4976  if (irmp_pause_time >= BANG_OLUFSEN_1_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_1_PAUSE_LEN_MAX)
4977  { // pulse & pause timings correct for "1"?
4978 #ifdef ANALYZE
4979  ANALYZE_PUTCHAR ('1');
4980  ANALYZE_NEWLINE ();
4981 #endif // ANALYZE
4982  irmp_store_bit (1);
4983  last_value = 1;
4984  wait_for_space = 0;
4985  }
4986  else if (irmp_pause_time >= BANG_OLUFSEN_0_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_0_PAUSE_LEN_MAX)
4987  { // pulse & pause timings correct for "0"?
4988 #ifdef ANALYZE
4989  ANALYZE_PUTCHAR ('0');
4990  ANALYZE_NEWLINE ();
4991 #endif // ANALYZE
4992  irmp_store_bit (0);
4993  last_value = 0;
4994  wait_for_space = 0;
4995  }
4996  else if (irmp_pause_time >= BANG_OLUFSEN_R_PAUSE_LEN_MIN && irmp_pause_time <= BANG_OLUFSEN_R_PAUSE_LEN_MAX)
4997  {
4998 #ifdef ANALYZE
4999  ANALYZE_PUTCHAR (last_value + '0');
5000  ANALYZE_NEWLINE ();
5001 #endif // ANALYZE
5002  irmp_store_bit (last_value);
5003  wait_for_space = 0;
5004  }
5005  else
5006  { // timing incorrect!
5007 #ifdef ANALYZE
5008  ANALYZE_PRINTF ("error 3c B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
5009  ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
5010 #endif // ANALYZE
5011  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
5012  irmp_pause_time = 0;
5013  }
5014  }
5015  }
5016  else
5017  { // timing incorrect!
5018 #ifdef ANALYZE
5019  ANALYZE_PRINTF ("error 3d B&O: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
5020  ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
5021 #endif // ANALYZE
5022  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
5023  irmp_pause_time = 0;
5024  }
5025  }
5026  else
5027 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
5028 
5029 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
5030  if (irmp_param.protocol == IRMP_RCMM32_PROTOCOL)
5031  {
5032  if (irmp_pause_time >= RCMM32_BIT_00_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_00_PAUSE_LEN_MAX)
5033  {
5034 #ifdef ANALYZE
5035  ANALYZE_PUTCHAR ('0');
5036  ANALYZE_PUTCHAR ('0');
5037 #endif // ANALYZE
5038  irmp_store_bit (0);
5039  irmp_store_bit (0);
5040  }
5041  else if (irmp_pause_time >= RCMM32_BIT_01_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_01_PAUSE_LEN_MAX)
5042  {
5043 #ifdef ANALYZE
5044  ANALYZE_PUTCHAR ('0');
5045  ANALYZE_PUTCHAR ('1');
5046 #endif // ANALYZE
5047  irmp_store_bit (0);
5048  irmp_store_bit (1);
5049  }
5050  else if (irmp_pause_time >= RCMM32_BIT_10_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_10_PAUSE_LEN_MAX)
5051  {
5052 #ifdef ANALYZE
5053  ANALYZE_PUTCHAR ('1');
5054  ANALYZE_PUTCHAR ('0');
5055 #endif // ANALYZE
5056  irmp_store_bit (1);
5057  irmp_store_bit (0);
5058  }
5059  else if (irmp_pause_time >= RCMM32_BIT_11_PAUSE_LEN_MIN && irmp_pause_time <= RCMM32_BIT_11_PAUSE_LEN_MAX)
5060  {
5061 #ifdef ANALYZE
5062  ANALYZE_PUTCHAR ('1');
5063  ANALYZE_PUTCHAR ('1');
5064 #endif // ANALYZE
5065  irmp_store_bit (1);
5066  irmp_store_bit (1);
5067  }
5068 #ifdef ANALYZE
5069  ANALYZE_PRINTF ("\n");
5070 #endif // ANALYZE
5071  wait_for_space = 0;
5072  }
5073  else
5074 #endif
5075 
5076  if (irmp_pulse_time >= irmp_param.pulse_1_len_min && irmp_pulse_time <= irmp_param.pulse_1_len_max &&
5077  irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
5078  { // pulse & pause timings correct for "1"?
5079 #ifdef ANALYZE
5080  ANALYZE_PUTCHAR ('1');
5081  ANALYZE_NEWLINE ();
5082 #endif // ANALYZE
5083  irmp_store_bit (1);
5084  wait_for_space = 0;
5085  }
5086  else if (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max &&
5087  irmp_pause_time >= irmp_param.pause_0_len_min && irmp_pause_time <= irmp_param.pause_0_len_max)
5088  { // pulse & pause timings correct for "0"?
5089 #ifdef ANALYZE
5090  ANALYZE_PUTCHAR ('0');
5091  ANALYZE_NEWLINE ();
5092 #endif // ANALYZE
5093  irmp_store_bit (0);
5094  wait_for_space = 0;
5095  }
5096  else
5097 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
5098 
5099  if (irmp_param.protocol == IRMP_KATHREIN_PROTOCOL &&
5100  irmp_pulse_time >= KATHREIN_1_PULSE_LEN_MIN && irmp_pulse_time <= KATHREIN_1_PULSE_LEN_MAX &&
5101  (((irmp_bit == 8 || irmp_bit == 6) &&
5102  irmp_pause_time >= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX) ||
5103  (irmp_bit == 12 &&
5104  irmp_pause_time >= KATHREIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= KATHREIN_START_BIT_PAUSE_LEN_MAX)))
5105 
5106  {
5107  if (irmp_bit == 8)
5108  {
5109  irmp_bit++;
5110 #ifdef ANALYZE
5111  ANALYZE_PUTCHAR ('S');
5112  ANALYZE_NEWLINE ();
5113 #endif // ANALYZE
5114  irmp_tmp_command <<= 1;
5115  }
5116  else
5117  {
5118 #ifdef ANALYZE
5119  ANALYZE_PUTCHAR ('S');
5120  ANALYZE_NEWLINE ();
5121 #endif // ANALYZE
5122  irmp_store_bit (1);
5123  }
5124  wait_for_space = 0;
5125  }
5126  else
5127 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
5128  { // timing incorrect!
5129 #ifdef ANALYZE
5130  ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit, irmp_pulse_time, irmp_pause_time);
5132 #endif // ANALYZE
5133  irmp_start_bit_detected = 0; // reset flags and wait for next start bit
5134  irmp_pause_time = 0;
5135  }
5136 
5137  irmp_pulse_time = 1; // set counter to 1, not 0
5138  }
5139  }
5140  else
5141  { // counting the pulse length ...
5142  if (! irmp_input) // still light?
5143  { // yes...
5144  irmp_pulse_time++; // increment counter
5145  }
5146  else
5147  { // now it's dark!
5148  wait_for_space = 1; // let's count the time (see above)
5149  irmp_pause_time = 1; // set pause counter to 1, not 0
5150 
5151 #if IRMP_SUPPORT_RCII_PROTOCOL == 1
5152  if (irmp_param.protocol == IRMP_RCII_PROTOCOL && waiting_for_2nd_pulse)
5153  {
5154 printf ("fm: %d %d\n", irmp_pulse_time * 1000000 / F_INTERRUPTS, RCII_BIT_LEN * 1000000 / F_INTERRUPTS); // fm: Ausgabe ist "1000 466" oder "1533 466"
5155 #if 0
5156  if (irmp_pulse_time >= RCII_BIT_LEN)
5157  {
5158  irmp_pulse_time -= RCII_BIT_LEN;
5159  last_value = 0;
5160  }
5161  else
5162  {
5163  last_value = 1;
5164  }
5165 #else // fm: das reicht für RCII
5166  irmp_pulse_time -= RCII_BIT_LEN;
5167  last_value = 0;
5168 #endif
5169 
5170 #ifdef ANALYZE
5171  ANALYZE_PRINTF ("RCII: got 2nd pulse, irmp_pulse_time = %d\n", irmp_pulse_time);
5172 #endif
5173  waiting_for_2nd_pulse = 0;
5174  }
5175 #endif
5176  }
5177  }
5178 
5179  if (irmp_start_bit_detected && irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 0) // enough bits received?
5180  {
5181  if (last_irmp_command == irmp_tmp_command && key_repetition_len < AUTO_FRAME_REPETITION_LEN)
5182  {
5183  repetition_frame_number++;
5184  }
5185  else
5186  {
5187  repetition_frame_number = 0;
5188  }
5189 
5190 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
5191  // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
5192  if (irmp_param.protocol == IRMP_SIRCS_PROTOCOL && (repetition_frame_number == 1 || repetition_frame_number == 2))
5193  {
5194 #ifdef ANALYZE
5195  ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5196  repetition_frame_number + 1, (int)key_repetition_len, (int)AUTO_FRAME_REPETITION_LEN);
5197 #endif // ANALYZE
5198  key_repetition_len = 0;
5199  }
5200  else
5201 #endif
5202 
5203 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5204  // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
5205  if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL && repetition_frame_number == 1)
5206  {
5207 #ifdef ANALYZE
5208  ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5209  repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);
5210 #endif // ANALYZE
5211  key_repetition_len = 0;
5212  }
5213  else
5214 #endif
5215 
5216 #if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
5217  // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
5218  if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && repetition_frame_number == 1)
5219  {
5220 #ifdef ANALYZE
5221  ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5222  repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);
5223 #endif // ANALYZE
5224  key_repetition_len = 0;
5225  }
5226  else
5227 #endif
5228 
5229 #if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
5230  // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
5231  if ((irmp_param.protocol == IRMP_SAMSUNG32_PROTOCOL || irmp_param.protocol == IRMP_SAMSUNG48_PROTOCOL) && (repetition_frame_number & 0x01))
5232  {
5233 #ifdef ANALYZE
5234  ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5235  repetition_frame_number + 1, key_repetition_len, AUTO_FRAME_REPETITION_LEN);
5236 #endif // ANALYZE
5237  key_repetition_len = 0;
5238  }
5239  else
5240 #endif
5241 
5242 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
5243  // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
5244  if (irmp_param.protocol == IRMP_NUBERT_PROTOCOL && (repetition_frame_number & 0x01))
5245  {
5246 #ifdef ANALYZE
5247  ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5248  repetition_frame_number + 1, (int)key_repetition_len, (int)AUTO_FRAME_REPETITION_LEN);
5249 #endif // ANALYZE
5250  key_repetition_len = 0;
5251  }
5252  else
5253 #endif
5254 
5255 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
5256  // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
5257  if (irmp_param.protocol == IRMP_SPEAKER_PROTOCOL && (repetition_frame_number & 0x01))
5258  {
5259 #ifdef ANALYZE
5260  ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
5261  repetition_frame_number + 1, (int)key_repetition_len, (int)AUTO_FRAME_REPETITION_LEN);
5262 #endif // ANALYZE
5263  key_repetition_len = 0;
5264  }
5265  else
5266 #endif
5267 
5268  {
5269 #ifdef ANALYZE
5270  ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);
5271 #endif // ANALYZE
5272  irmp_ir_detected = TRUE;
5273 
5274 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
5275  if (irmp_param.protocol == IRMP_DENON_PROTOCOL)
5276  { // check for repetition frame
5277  if ((~irmp_tmp_command & 0x3FF) == last_irmp_denon_command) // command bits must be inverted
5278  {
5279  irmp_tmp_command = last_irmp_denon_command; // use command received before!
5280  last_irmp_denon_command = 0;
5281 
5282  irmp_protocol = irmp_param.protocol; // store protocol
5283  irmp_address = irmp_tmp_address; // store address
5284  irmp_command = irmp_tmp_command; // store command
5285  }
5286  else
5287  {
5288  if ((irmp_tmp_command & 0x01) == 0x00)
5289  {
5290 #ifdef ANALYZE
5291  ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter * 1000) / F_INTERRUPTS);
5292 #endif // ANALYZE
5293  last_irmp_denon_command = irmp_tmp_command;
5294  denon_repetition_len = 0;
5295  irmp_ir_detected = FALSE;
5296  }
5297  else
5298  {
5299 #ifdef ANALYZE
5300  ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter * 1000) / F_INTERRUPTS);
5301 #endif // ANALYZE
5302  last_irmp_denon_command = 0;
5303  irmp_ir_detected = FALSE;
5304  }
5305  }
5306  }
5307  else
5308 #endif // IRMP_SUPPORT_DENON_PROTOCOL
5309 
5310 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
5311  if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && irmp_tmp_command == 0x01ff)
5312  { // Grundig start frame?
5313 #ifdef ANALYZE
5314  ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
5315 #endif // ANALYZE
5316  irmp_ir_detected = FALSE;
5317  }
5318  else
5319 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
5320 
5321 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
5322  if (irmp_param.protocol == IRMP_NOKIA_PROTOCOL && irmp_tmp_address == 0x00ff && irmp_tmp_command == 0x00fe)
5323  { // Nokia start frame?
5324 #ifdef ANALYZE
5325  ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
5326 #endif // ANALYZE
5327  irmp_ir_detected = FALSE;
5328  }
5329  else
5330 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
5331  {
5332 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
5333  if (irmp_param.protocol == IRMP_NEC_PROTOCOL && irmp_bit == 0) // repetition frame
5334  {
5335  if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)
5336  {
5337 #ifdef ANALYZE
5338  ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", (int)key_repetition_len);
5339  ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
5340 #endif // ANALYZE
5341  irmp_tmp_address = last_irmp_address; // address is last address
5342  irmp_tmp_command = last_irmp_command; // command is last command
5343  irmp_flags |= IRMP_FLAG_REPETITION;
5344  key_repetition_len = 0;
5345  }
5346  else
5347  {
5348 #ifdef ANALYZE
5349  ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
5350  (int)key_repetition_len, (int)NEC_FRAME_REPEAT_PAUSE_LEN_MAX);
5351 #endif // ANALYZE
5352  irmp_ir_detected = FALSE;
5353  }
5354  }
5355 #endif // IRMP_SUPPORT_NEC_PROTOCOL
5356 
5357 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
5358  if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)
5359  {
5360  uint_fast8_t xor_value;
5361 
5362  xor_value = (xor_check[0] & 0x0F) ^ ((xor_check[0] & 0xF0) >> 4) ^ (xor_check[1] & 0x0F) ^ ((xor_check[1] & 0xF0) >> 4);
5363 
5364  if (xor_value != (xor_check[2] & 0x0F))
5365  {
5366 #ifdef ANALYZE
5367  ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value, xor_check[2] & 0x0F);
5368 #endif // ANALYZE
5369  irmp_ir_detected = FALSE;
5370  }
5371 
5372  xor_value = xor_check[2] ^ xor_check[3] ^ xor_check[4];
5373 
5374  if (xor_value != xor_check[5])
5375  {
5376 #ifdef ANALYZE
5377  ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value, xor_check[5]);
5378 #endif // ANALYZE
5379  irmp_ir_detected = FALSE;
5380  }
5381 
5382  irmp_flags |= genre2; // write the genre2 bits into MSB of the flag byte
5383  }
5384 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
5385 
5386 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5387  if (irmp_param.protocol == IRMP_ORTEK_PROTOCOL)
5388  {
5389  if (parity == PARITY_CHECK_FAILED)
5390  {
5391 #ifdef ANALYZE
5392  ANALYZE_PRINTF ("error 6: parity check failed\n");
5393 #endif // ANALYZE
5394  irmp_ir_detected = FALSE;
5395  }
5396 
5397  if ((irmp_tmp_address & 0x03) == 0x02)
5398  {
5399 #ifdef ANALYZE
5400  ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
5401 #endif // ANALYZE
5402  irmp_ir_detected = FALSE;
5403  }
5404  irmp_tmp_address >>= 2;
5405  }
5406 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5407 
5408 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
5409  if (irmp_param.protocol == IRMP_MITSU_HEAVY_PROTOCOL)
5410  {
5411  check = irmp_tmp_command >> 8; // inverted upper byte == lower byte?
5412  check = ~ check;
5413  if (check == (irmp_tmp_command & 0xFF)) { //ok:
5414  irmp_tmp_command &= 0xFF;
5415  }
5416  else mitsu_parity = PARITY_CHECK_FAILED;
5417  if (mitsu_parity == PARITY_CHECK_FAILED)
5418  {
5419 #ifdef ANALYZE
5420  ANALYZE_PRINTF ("error 7: parity check failed\n");
5421 #endif // ANALYZE
5422  irmp_ir_detected = FALSE;
5423  }
5424  }
5425 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
5426 
5427 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
5428  if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_param.complete_len == RC6_COMPLETE_DATA_LEN_LONG) // RC6 mode = 6?
5429  {
5430  irmp_protocol = IRMP_RC6A_PROTOCOL;
5431  }
5432  else
5433 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
5434  {
5435  irmp_protocol = irmp_param.protocol;
5436  }
5437 
5438 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
5439  if (irmp_param.protocol == IRMP_FDC_PROTOCOL)
5440  {
5441  if (irmp_tmp_command & 0x000F) // released key?
5442  {
5443  irmp_tmp_command = (irmp_tmp_command >> 4) | 0x80; // yes, set bit 7
5444  }
5445  else
5446  {
5447  irmp_tmp_command >>= 4; // no, it's a pressed key
5448  }
5449  irmp_tmp_command |= (irmp_tmp_address << 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
5450  irmp_tmp_address &= 0x003F;
5451  }
5452 #endif
5453 
5454  irmp_address = irmp_tmp_address; // store address
5455 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
5456  if (irmp_param.protocol == IRMP_NEC_PROTOCOL)
5457  {
5458  last_irmp_address = irmp_tmp_address; // store as last address, too
5459  }
5460 #endif
5461 
5462 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
5463  if (irmp_param.protocol == IRMP_RC5_PROTOCOL)
5464  {
5465  irmp_tmp_command |= rc5_cmd_bit6; // store bit 6
5466  }
5467 #endif
5468 #if IRMP_SUPPORT_S100_PROTOCOL == 1
5469  if (irmp_param.protocol == IRMP_S100_PROTOCOL)
5470  {
5471  irmp_tmp_command |= rc5_cmd_bit6; // store bit 6
5472  }
5473 #endif
5474  irmp_command = irmp_tmp_command; // store command
5475 
5476 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
5477  irmp_id = irmp_tmp_id;
5478 #endif
5479  }
5480  }
5481 
5482  if (irmp_ir_detected)
5483  {
5484  if (last_irmp_command == irmp_tmp_command &&
5485  last_irmp_address == irmp_tmp_address &&
5486  key_repetition_len < IRMP_KEY_REPETITION_LEN)
5487  {
5488  irmp_flags |= IRMP_FLAG_REPETITION;
5489  }
5490 
5491  last_irmp_address = irmp_tmp_address; // store as last address, too
5492  last_irmp_command = irmp_tmp_command; // store as last command, too
5493 
5494  key_repetition_len = 0;
5495  }
5496  else
5497  {
5498 #ifdef ANALYZE
5500 #endif // ANALYZE
5501  }
5502 
5503  irmp_start_bit_detected = 0; // and wait for next start bit
5504  irmp_tmp_command = 0;
5505  irmp_pulse_time = 0;
5506  irmp_pause_time = 0;
5507 
5508 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
5509  if (irmp_protocol == IRMP_JVC_PROTOCOL) // the stop bit of JVC frame is also start bit of next frame
5510  { // set pulse time here!
5511  irmp_pulse_time = ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME));
5512  }
5513 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
5514  }
5515  }
5516  }
5517 
5518 #if defined(STELLARIS_ARM_CORTEX_M4)
5519  // Clear the timer interrupt
5520  TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
5521 #endif
5522 
5523 #if (defined(_CHIBIOS_RT_) || defined(_CHIBIOS_NIL_)) && IRMP_USE_EVENT == 1
5524  if (IRMP_EVENT_THREAD_PTR != NULL && irmp_ir_detected)
5525  chEvtSignalI(IRMP_EVENT_THREAD_PTR,IRMP_EVENT_BIT);
5526 #endif
5527 
5528 #if IRMP_USE_IDLE_CALL == 1
5529  // check if there is no ongoing transmission or repetition
5530  if (!irmp_start_bit_detected && !irmp_pulse_time
5531  && key_repetition_len > IRMP_KEY_REPETITION_LEN)
5532  {
5533  // no ongoing transmission
5534  // enough time passed since last decoded signal that a repetition won't affect our output
5535 
5536  irmp_idle();
5537  }
5538 #endif // IRMP_USE_IDLE_CALL
5539 
5540  return (irmp_ir_detected);
5541 }
5542 
5543 #ifdef ANALYZE
5544 
5545 /*---------------------------------------------------------------------------------------------------------------------------------------------------
5546  * main functions - for Unix/Linux + Windows only!
5547  *
5548  * AVR: see main.c!
5549  *
5550  * Compile it under linux with:
5551  * cc irmp.c -o irmp
5552  *
5553  * usage: ./irmp [-v|-s|-a|-l] < file
5554  *
5555  * options:
5556  * -v verbose
5557  * -s silent
5558  * -a analyze
5559  * -l list pulse/pauses
5560  *---------------------------------------------------------------------------------------------------------------------------------------------------
5561  */
5562 
5563 void print_spectrum (char * text, int * buf, int is_pulse);
5564 void
5565 print_spectrum (char * text, int * buf, int is_pulse)
5566 {
5567  int i;
5568  int j;
5569  int min;
5570  int max;
5571  int max_value = 0;
5572  int value;
5573  int sum = 0;
5574  int counter = 0;
5575  double average = 0;
5576  double tolerance;
5577 
5578  puts ("-----------------------------------------------------------------------------");
5579  printf ("%s:\n", text);
5580 
5581  for (i = 0; i < 256; i++)
5582  {
5583  if (buf[i] > max_value)
5584  {
5585  max_value = buf[i];
5586  }
5587  }
5588 
5589  for (i = 1; i < 200; i++)
5590  {
5591  if (buf[i] > 0)
5592  {
5593  printf ("%3d ", i);
5594  value = (buf[i] * 60) / max_value;
5595 
5596  for (j = 0; j < value; j++)
5597  {
5598  putchar ('o');
5599  }
5600  printf (" %d\n", buf[i]);
5601 
5602  sum += i * buf[i];
5603  counter += buf[i];
5604  }
5605  else
5606  {
5607  max = i - 1;
5608 
5609  if (counter > 0)
5610  {
5611  average = (float) sum / (float) counter;
5612 
5613  if (is_pulse)
5614  {
5615  printf ("pulse ");
5616  }
5617  else
5618  {
5619  printf ("pause ");
5620  }
5621 
5622  printf ("avg: %4.1f=%6.1f us, ", average, (1000000. * average) / (float) F_INTERRUPTS);
5623  printf ("min: %2d=%6.1f us, ", min, (1000000. * min) / (float) F_INTERRUPTS);
5624  printf ("max: %2d=%6.1f us, ", max, (1000000. * max) / (float) F_INTERRUPTS);
5625 
5626  tolerance = (max - average);
5627 
5628  if (average - min > tolerance)
5629  {
5630  tolerance = average - min;
5631  }
5632 
5633  tolerance = tolerance * 100 / average;
5634  printf ("tol: %4.1f%%\n", tolerance);
5635  }
5636 
5637  counter = 0;
5638  sum = 0;
5639  min = i + 1;
5640  }
5641  }
5642 }
5643 
5644 #define STATE_LEFT_SHIFT 0x01
5645 #define STATE_RIGHT_SHIFT 0x02
5646 #define STATE_LEFT_CTRL 0x04
5647 #define STATE_LEFT_ALT 0x08
5648 #define STATE_RIGHT_ALT 0x10
5649 
5650 #define KEY_ESCAPE 0x1B // keycode = 0x006e
5651 #define KEY_MENUE 0x80 // keycode = 0x0070
5652 #define KEY_BACK 0x81 // keycode = 0x0071
5653 #define KEY_FORWARD 0x82 // keycode = 0x0072
5654 #define KEY_ADDRESS 0x83 // keycode = 0x0073
5655 #define KEY_WINDOW 0x84 // keycode = 0x0074
5656 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
5657 #define KEY_STOP 0x86 // keycode = 0x0076
5658 #define KEY_MAIL 0x87 // keycode = 0x0077
5659 #define KEY_FAVORITES 0x88 // keycode = 0x0078
5660 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
5661 #define KEY_SETUP 0x8A // keycode = 0x007a
5662 #define KEY_FONT 0x8B // keycode = 0x007b
5663 #define KEY_PRINT 0x8C // keycode = 0x007c
5664 #define KEY_ON_OFF 0x8E // keycode = 0x007c
5665 
5666 #define KEY_INSERT 0x90 // keycode = 0x004b
5667 #define KEY_DELETE 0x91 // keycode = 0x004c
5668 #define KEY_LEFT 0x92 // keycode = 0x004f
5669 #define KEY_HOME 0x93 // keycode = 0x0050
5670 #define KEY_END 0x94 // keycode = 0x0051
5671 #define KEY_UP 0x95 // keycode = 0x0053
5672 #define KEY_DOWN 0x96 // keycode = 0x0054
5673 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5674 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5675 #define KEY_RIGHT 0x99 // keycode = 0x0059
5676 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5677 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5678 
5679 static uint_fast8_t
5680 get_fdc_key (uint_fast16_t cmd)
5681 {
5682  static uint8_t key_table[128] =
5683  {
5684  // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5685  0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, 0xB4, 0, '\b',
5686  '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',
5687  's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',
5688  'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5689 
5690  0, 0xB0, '!', '"', 0xA7, '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5691  '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',
5692  'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',
5693  'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5694  };
5695  static uint_fast8_t state;
5696 
5697  uint_fast8_t key = 0;
5698 
5699  switch (cmd)
5700  {
5701  case 0x002C: state |= STATE_LEFT_SHIFT; break; // pressed left shift
5702  case 0x00AC: state &= ~STATE_LEFT_SHIFT; break; // released left shift
5703  case 0x0039: state |= STATE_RIGHT_SHIFT; break; // pressed right shift
5704  case 0x00B9: state &= ~STATE_RIGHT_SHIFT; break; // released right shift
5705  case 0x003A: state |= STATE_LEFT_CTRL; break; // pressed left ctrl
5706  case 0x00BA: state &= ~STATE_LEFT_CTRL; break; // released left ctrl
5707  case 0x003C: state |= STATE_LEFT_ALT; break; // pressed left alt
5708  case 0x00BC: state &= ~STATE_LEFT_ALT; break; // released left alt
5709  case 0x003E: state |= STATE_RIGHT_ALT; break; // pressed left alt
5710  case 0x00BE: state &= ~STATE_RIGHT_ALT; break; // released left alt
5711 
5712  case 0x006e: key = KEY_ESCAPE; break;
5713  case 0x004b: key = KEY_INSERT; break;
5714  case 0x004c: key = KEY_DELETE; break;
5715  case 0x004f: key = KEY_LEFT; break;
5716  case 0x0050: key = KEY_HOME; break;
5717  case 0x0051: key = KEY_END; break;
5718  case 0x0053: key = KEY_UP; break;
5719  case 0x0054: key = KEY_DOWN; break;
5720  case 0x0055: key = KEY_PAGE_UP; break;
5721  case 0x0056: key = KEY_PAGE_DOWN; break;
5722  case 0x0059: key = KEY_RIGHT; break;
5723  case 0x0400: key = KEY_MOUSE_1; break;
5724  case 0x0800: key = KEY_MOUSE_2; break;
5725 
5726  default:
5727  {
5728  if (!(cmd & 0x80)) // pressed key
5729  {
5730  if (cmd >= 0x70 && cmd <= 0x7F) // function keys
5731  {
5732  key = cmd + 0x10; // 7x -> 8x
5733  }
5734  else if (cmd < 64) // key listed in key_table
5735  {
5736  if (state & (STATE_LEFT_ALT | STATE_RIGHT_ALT))
5737  {
5738  switch (cmd)
5739  {
5740  case 0x0003: key = 0xB2; break; // upper 2
5741  case 0x0008: key = '{'; break;
5742  case 0x0009: key = '['; break;
5743  case 0x000A: key = ']'; break;
5744  case 0x000B: key = '}'; break;
5745  case 0x000C: key = '\\'; break;
5746  case 0x001C: key = '~'; break;
5747  case 0x002D: key = '|'; break;
5748  case 0x0034: key = 0xB5; break; // Mu
5749  }
5750  }
5751  else if (state & (STATE_LEFT_CTRL))
5752  {
5753  if (key_table[cmd] >= 'a' && key_table[cmd] <= 'z')
5754  {
5755  key = key_table[cmd] - 'a' + 1;
5756  }
5757  else
5758  {
5759  key = key_table[cmd];
5760  }
5761  }
5762  else
5763  {
5764  int idx = cmd + ((state & (STATE_LEFT_SHIFT | STATE_RIGHT_SHIFT)) ? 64 : 0);
5765 
5766  if (key_table[idx])
5767  {
5768  key = key_table[idx];
5769  }
5770  }
5771  }
5772  }
5773  break;
5774  }
5775  }
5776 
5777  return (key);
5778 }
5779 
5780 static int analyze = FALSE;
5781 static int list = FALSE;
5782 static IRMP_DATA irmp_data;
5783 static int expected_protocol;
5784 static int expected_address;
5785 static int expected_command;
5786 static int do_check_expected_values;
5787 
5788 static void
5789 next_tick (void)
5790 {
5791  if (! analyze && ! list)
5792  {
5793  (void) irmp_ISR ();
5794 
5795  if (irmp_get_data (&irmp_data))
5796  {
5797  uint_fast8_t key;
5798 
5800 
5801  if (verbose)
5802  {
5803  printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);
5804  }
5805 
5806  if (irmp_data.protocol == IRMP_ACP24_PROTOCOL)
5807  {
5808  uint16_t temp = (irmp_data.command & 0x000F) + 15;
5809 
5810  printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5811  irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, temp);
5812  }
5813  else if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)
5814  {
5815  if ((key >= 0x20 && key < 0x7F) || key >= 0xA0)
5816  {
5817  printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5818  irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, key);
5819  }
5820  else if (key == '\r' || key == '\t' || key == KEY_ESCAPE || (key >= 0x80 && key <= 0x9F)) // function keys
5821  {
5822  char * p = (char *) NULL;
5823 
5824  switch (key)
5825  {
5826  case '\t' : p = "TAB"; break;
5827  case '\r' : p = "CR"; break;
5828  case KEY_ESCAPE : p = "ESCAPE"; break;
5829  case KEY_MENUE : p = "MENUE"; break;
5830  case KEY_BACK : p = "BACK"; break;
5831  case KEY_FORWARD : p = "FORWARD"; break;
5832  case KEY_ADDRESS : p = "ADDRESS"; break;
5833  case KEY_WINDOW : p = "WINDOW"; break;
5834  case KEY_1ST_PAGE : p = "1ST_PAGE"; break;
5835  case KEY_STOP : p = "STOP"; break;
5836  case KEY_MAIL : p = "MAIL"; break;
5837  case KEY_FAVORITES : p = "FAVORITES"; break;
5838  case KEY_NEW_PAGE : p = "NEW_PAGE"; break;
5839  case KEY_SETUP : p = "SETUP"; break;
5840  case KEY_FONT : p = "FONT"; break;
5841  case KEY_PRINT : p = "PRINT"; break;
5842  case KEY_ON_OFF : p = "ON_OFF"; break;
5843 
5844  case KEY_INSERT : p = "INSERT"; break;
5845  case KEY_DELETE : p = "DELETE"; break;
5846  case KEY_LEFT : p = "LEFT"; break;
5847  case KEY_HOME : p = "HOME"; break;
5848  case KEY_END : p = "END"; break;
5849  case KEY_UP : p = "UP"; break;
5850  case KEY_DOWN : p = "DOWN"; break;
5851  case KEY_PAGE_UP : p = "PAGE_UP"; break;
5852  case KEY_PAGE_DOWN : p = "PAGE_DOWN"; break;
5853  case KEY_RIGHT : p = "RIGHT"; break;
5854  case KEY_MOUSE_1 : p = "KEY_MOUSE_1"; break;
5855  case KEY_MOUSE_2 : p = "KEY_MOUSE_2"; break;
5856  default : p = "<UNKNWON>"; break;
5857  }
5858 
5859  printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5860  irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key, p);
5861  }
5862  else
5863  {
5864  printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5865  irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags, key);
5866  }
5867  }
5868  else
5869  {
5870  printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5871  irmp_data.protocol, irmp_protocol_names[irmp_data.protocol], irmp_data.address, irmp_data.command, irmp_data.flags);
5872  }
5873 
5874  if (do_check_expected_values)
5875  {
5876  if (irmp_data.protocol != expected_protocol ||
5877  irmp_data.address != expected_address ||
5878  (int)irmp_data.command != expected_command)
5879  {
5880  printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5881  expected_protocol, irmp_protocol_names[expected_protocol], expected_address, expected_command);
5882  }
5883  else
5884  {
5885  printf (" checked!\n");
5886  }
5887  do_check_expected_values = FALSE; // only check 1st frame in a line!
5888  }
5889  else
5890  {
5891  putchar ('\n');
5892  }
5893  }
5894  }
5895 }
5896 
5897 int
5898 main (int argc, char ** argv)
5899 {
5900  int i;
5901  int ch;
5902  int last_ch = 0;
5903  int pulse = 0;
5904  int pause = 0;
5905 
5906  int start_pulses[256];
5907  int start_pauses[256];
5908  int pulses[256];
5909  int pauses[256];
5910 
5911  int first_pulse = TRUE;
5912  int first_pause = TRUE;
5913 
5914  if (argc == 2)
5915  {
5916  if (! strcmp (argv[1], "-v"))
5917  {
5918  verbose = TRUE;
5919  }
5920  else if (! strcmp (argv[1], "-l"))
5921  {
5922  list = TRUE;
5923  }
5924  else if (! strcmp (argv[1], "-a"))
5925  {
5926  analyze = TRUE;
5927  }
5928  else if (! strcmp (argv[1], "-s"))
5929  {
5930  silent = TRUE;
5931  }
5932  else if (! strcmp (argv[1], "-r"))
5933  {
5934  radio = TRUE;
5935  }
5936  }
5937 
5938  for (i = 0; i < 256; i++)
5939  {
5940  start_pulses[i] = 0;
5941  start_pauses[i] = 0;
5942  pulses[i] = 0;
5943  pauses[i] = 0;
5944  }
5945 
5946  IRMP_PIN = 0xFF;
5947 
5948  while ((ch = getchar ()) != EOF)
5949  {
5950  if (ch == '_' || ch == '0')
5951  {
5952  if (last_ch != ch)
5953  {
5954  if (pause > 0)
5955  {
5956  if (list)
5957  {
5958  printf ("pause: %d\n", pause);
5959  }
5960 
5961  if (analyze)
5962  {
5963  if (first_pause)
5964  {
5965  if (pause < 256)
5966  {
5967  start_pauses[pause]++;
5968  }
5969  first_pause = FALSE;
5970  }
5971  else
5972  {
5973  if (pause < 256)
5974  {
5975  pauses[pause]++;
5976  }
5977  }
5978  }
5979  }
5980  pause = 0;
5981  }
5982  pulse++;
5983  IRMP_PIN = 0x00;
5984  }
5985  else if (ch == 0xaf || ch == '-' || ch == '1')
5986  {
5987  if (last_ch != ch)
5988  {
5989  if (list)
5990  {
5991  printf ("pulse: %d ", pulse);
5992  }
5993 
5994  if (analyze)
5995  {
5996  if (first_pulse)
5997  {
5998  if (pulse < 256)
5999  {
6000  start_pulses[pulse]++;
6001  }
6002  first_pulse = FALSE;
6003  }
6004  else
6005  {
6006  if (pulse < 256)
6007  {
6008  pulses[pulse]++;
6009  }
6010  }
6011  }
6012  pulse = 0;
6013  }
6014 
6015  pause++;
6016  IRMP_PIN = 0xff;
6017  }
6018  else if (ch == '\n')
6019  {
6020  IRMP_PIN = 0xff;
6021  time_counter = 0;
6022 
6023  if (list && pause > 0)
6024  {
6025  printf ("pause: %d\n", pause);
6026  }
6027  pause = 0;
6028 
6029  if (! analyze)
6030  {
6031  for (i = 0; i < (int) ((10000.0 * F_INTERRUPTS) / 10000); i++) // newline: long pause of 10000 msec
6032  {
6033  next_tick ();
6034  }
6035  }
6036  first_pulse = TRUE;
6037  first_pause = TRUE;
6038  }
6039  else if (ch == '#')
6040  {
6041  time_counter = 0;
6042 
6043  if (analyze)
6044  {
6045  while ((ch = getchar()) != '\n' && ch != EOF)
6046  {
6047  ;
6048  }
6049  }
6050  else
6051  {
6052  char buf[1024];
6053  char * p;
6054  int idx = -1;
6055 
6056  puts ("----------------------------------------------------------------------");
6057  putchar (ch);
6058 
6059 
6060  while ((ch = getchar()) != '\n' && ch != EOF)
6061  {
6062  if (ch != '\r') // ignore CR in DOS/Windows files
6063  {
6064  if (ch == '[' && idx == -1)
6065  {
6066  idx = 0;
6067  }
6068  else if (idx >= 0)
6069  {
6070  if (ch == ']')
6071  {
6072  do_check_expected_values = FALSE;
6073  buf[idx] = '\0';
6074  idx = -1;
6075 
6076  expected_protocol = atoi (buf);
6077 
6078  if (expected_protocol > 0)
6079  {
6080  p = buf;
6081  while (*p)
6082  {
6083  if (*p == 'x')
6084  {
6085  p++;
6086 
6087  if (sscanf (p, "%x", &expected_address) == 1)
6088  {
6089  do_check_expected_values = TRUE;
6090  }
6091  break;
6092  }
6093  p++;
6094  }
6095 
6096  if (do_check_expected_values)
6097  {
6098  do_check_expected_values = FALSE;
6099 
6100  while (*p)
6101  {
6102  if (*p == 'x')
6103  {
6104  p++;
6105 
6106  if (sscanf (p, "%x", &expected_command) == 1)
6107  {
6108  do_check_expected_values = TRUE;
6109  }
6110  break;
6111  }
6112  p++;
6113  }
6114 
6115  if (do_check_expected_values)
6116  {
6117  // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
6118  }
6119  }
6120  }
6121  }
6122  else if (idx < 1024 - 2)
6123  {
6124  buf[idx++] = ch;
6125  }
6126  }
6127  putchar (ch);
6128  }
6129  }
6130  putchar ('\n');
6131  }
6132 
6133  }
6134 
6135  last_ch = ch;
6136 
6137  next_tick ();
6138  }
6139 
6140  if (analyze)
6141  {
6142  print_spectrum ("START PULSES", start_pulses, TRUE);
6143  print_spectrum ("START PAUSES", start_pauses, FALSE);
6144  print_spectrum ("PULSES", pulses, TRUE);
6145  print_spectrum ("PAUSES", pauses, FALSE);
6146  puts ("-----------------------------------------------------------------------------");
6147  }
6148  return 0;
6149 }
6150 
6151 #endif // ANALYZE
#define RECS80EXT_LSB
#define IRMP16_FLAGS
#define RADIO1_1_PAUSE_LEN_MIN
Definition: irmp.c:610
#define DENON_COMMAND_OFFSET
#define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
Definition: irmp.c:337
uint_fast8_t irmp_get_data(IRMP_DATA *irmp_data_p)
Definition: irmp.c:2412
#define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:524
#define SAMSUNGAH_FLAGS
#define SAMSUNGAH_0_PAUSE_LEN_MAX
Definition: irmp.c:151
#define SAMSUNGAH_COMMAND_OFFSET
#define LEGO_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:452
#define MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:176
#define MERLIN_COMMAND_OFFSET
#define FALSE
Definition: irmpsystem.h:194
#define SAMSUNG_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:133
#define MATSUSHITA_ADDRESS_OFFSET
#define IR60_COMMAND_LEN
#define SAMSUNGAH_PULSE_LEN_MIN
Definition: irmp.c:146
#define ORTEK_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:514
#define FAN_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:304
#define NIKON_COMMAND_OFFSET
#define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
Definition: irmp.c:329
#define PENTAX_STOP_BIT
#define TELEFUNKEN_COMMAND_LEN
#define BANG_OLUFSEN_PULSE_LEN_MAX
Definition: irmp.c:346
#define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:115
#define RUWIDO_COMPLETE_DATA_LEN
#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
Definition: irmp.c:361
#define KEY_PRINT
Definition: irmp.c:5663
#define SIRCS_ADDRESS_LEN
#define NIKON_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:415
#define PENTAX_COMMAND_LEN
#define KATHREIN_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:426
#define MITSU_HEAVY_COMMAND_LEN
#define SAMSUNG_0_PAUSE_LEN_MIN
Definition: irmp.c:139
#define METZ_STOP_BIT
#define BOSE_PULSE_LEN_MAX
Definition: irmp.c:488
#define FAN_ADDRESS_LEN
#define DENON_LSB
#define RC5_COMPLETE_DATA_LEN
#define SIRCS_PAUSE_LEN_MAX
Definition: irmp.c:109
#define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
Definition: irmp.c:333
#define FAN_ADDRESS_OFFSET
#define NEC42_COMMAND_OFFSET
#define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
Definition: irmp.c:335
#define RECS80EXT_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:279
#define SAMSUNG48_COMMAND_OFFSET
#define PARITY_CHECK_OK
Definition: irmp.c:643
#define PANASONIC_0_PAUSE_LEN_MIN
Definition: irmp.c:205
#define KEY_DOWN
Definition: irmp.c:5672
#define KATHREIN_FLAGS
#define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
Definition: irmp.c:438
#define RCMM32_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:550
#define RCMM32_STOP_BIT
#define KEY_WINDOW
Definition: irmp.c:5655
#define IRMP16_ADDRESS_OFFSET
#define KATHREIN_COMMAND_LEN
#define IRMP16_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:462
#define KATHREIN_ADDRESS_OFFSET
#define NOKIA_COMPLETE_DATA_LEN
#define BOSE_ADDRESS_LEN
#define RCMM32_BIT_10_PAUSE_LEN_MIN
Definition: irmp.c:560
#define NEC42_COMPLETE_DATA_LEN
#define S100_FLAGS
#define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:402
#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:367
#define RC6_FLAGS
#define RCII_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:232
#define KEY_LEFT
Definition: irmp.c:5668
#define NUBERT_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:293
#define NEC_ADDRESS_OFFSET
#define KEY_ON_OFF
Definition: irmp.c:5664
#define METZ_COMMAND_LEN
#define PENTAX_1_PAUSE_LEN_MAX
Definition: irmp.c:573
#define PENTAX_LSB
#define NETBOX_PAUSE_REST_LEN
Definition: irmp.c:448
#define METZ_1_PAUSE_LEN_MAX
Definition: irmp.c:598
#define NIKON_FLAGS
#define MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:178
#define KASEIKYO_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:167
#define KASEIKYO_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:166
#define KASEIKYO_STOP_BIT
#define NUBERT_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:291
#define TELEFUNKEN_LSB
#define input(x)
Definition: irmp.c:2319
#define A1TVBOX_BIT_PULSE_LEN_MAX
Definition: irmp.c:500
#define NIKON_ADDRESS_OFFSET
#define DENON_AUTO_REPETITION_PAUSE_LEN
Definition: irmp.c:259
#define BANG_OLUFSEN_PULSE_LEN_MIN
Definition: irmp.c:345
#define MERLIN_FLAGS
#define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
Definition: irmp.c:343
#define FDC_ADDRESS_LEN
#define SAMSUNG_COMPLETE_DATA_LEN
#define MITSU_HEAVY_FLAGS
#define TELEFUNKEN_FLAGS
#define RCMM32_BIT_10_PAUSE_LEN_MAX
Definition: irmp.c:561
#define SPEAKER_LSB
#define THOMSON_0_PAUSE_LEN_MAX
Definition: irmp.c:266
#define NEC_COMPLETE_DATA_LEN
#define GRUNDIG_COMMAND_LEN
#define GRUNDIG_NOKIA_IR60_FLAGS
#define KATHREIN_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:428
#define NETBOX_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:442
#define RC6_COMPLETE_DATA_LEN_SHORT
#define RCMM32_COMMAND_OFFSET
#define ROOMBA_0_PULSE_LEN_MAX
Definition: irmp.c:546
#define IRMP_BANG_OLUFSEN_PROTOCOL
Definition: irmpprotocols.h:40
#define RECS80EXT_COMMAND_LEN
#define MITSU_HEAVY_PULSE_LEN_MIN
Definition: irmp.c:179
#define SAMSUNGAH_ADDRESS_LEN
#define THOMSON_COMPLETE_DATA_LEN
#define MATSUSHITA_COMPLETE_DATA_LEN
#define FDC_LSB
#define RCCAR_COMMAND_LEN
#define A1TVBOX_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:496
#define S100_LSB
#define IRMP16_COMPLETE_DATA_LEN
#define IRMP_FAN_PROTOCOL
Definition: irmpprotocols.h:70
#define IRMP16_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:463
#define KEY_PAGE_DOWN
Definition: irmp.c:5674
#define IRMP_JVC_PROTOCOL
Definition: irmpprotocols.h:46
#define MITSU_HEAVY_COMMAND_OFFSET
#define IRMP_PANASONIC_PROTOCOL
Definition: irmpprotocols.h:74
#define RADIO1_1_PAUSE_LEN_MAX
Definition: irmp.c:611
#define RCMM32_COMMAND_LEN
#define A1TVBOX_COMMAND_LEN
#define IRMP_LEGO_PROTOCOL
Definition: irmpprotocols.h:55
#define RCMM32_COMPLETE_DATA_LEN
#define RECS80_0_PAUSE_LEN_MAX
Definition: irmp.c:217
#define ROOMBA_COMMAND_OFFSET
#define PANASONIC_PULSE_LEN_MIN
Definition: irmp.c:201
#define SAMSUNG_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:134
#define RUWIDO_ADDRESS_LEN
#define METZ_PULSE_LEN_MAX
Definition: irmp.c:596
#define IRMP_MITSU_HEAVY_PROTOCOL
Definition: irmpprotocols.h:75
#define LEGO_COMMAND_LEN
#define BOSE_PULSE_LEN_MIN
Definition: irmp.c:487
#define RECS80_ADDRESS_OFFSET
#define STATE_RIGHT_ALT
Definition: irmp.c:5648
#define PENTAX_COMPLETE_DATA_LEN
#define IRMP_RC5_PROTOCOL
Definition: irmpprotocols.h:33
#define KEY_PAGE_UP
Definition: irmp.c:5673
#define IRMP_PARAM_FLAG_IS_SERIAL
#define KASEIKYO_LSB
#define RCCAR_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:389
#define A1TVBOX_ADDRESS_LEN
#define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
Definition: irmp.c:359
#define RC6_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:271
#define RCCAR_1_PAUSE_LEN_MIN
Definition: irmp.c:394
#define MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:177
#define IRMP16_0_PAUSE_LEN_MIN
Definition: irmp.c:469
#define IRMP16_PULSE_LEN_MAX
Definition: irmp.c:466
#define DENON_0_PAUSE_LEN_MIN
Definition: irmp.c:257
#define NIKON_LSB
#define SPEAKER_1_PAUSE_LEN_MIN
Definition: irmp.c:322
#define NEC_STOP_BIT
#define ROOMBA_1_PAUSE_LEN_EXACT
Definition: irmp.c:539
#define RC6_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:268
#define ACP24_FLAGS
#define BOSE_STOP_BIT
#define FDC_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:374
#define RECS80_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:208
#define KEY_1ST_PAGE
Definition: irmp.c:5656
#define SAMSUNG48_COMPLETE_DATA_LEN
#define RADIO1_0_PAUSE_LEN_MIN
Definition: irmp.c:615
#define KEY_RIGHT
Definition: irmp.c:5675
#define IRMP_TIMEOUT_LEN
#define NUBERT_1_PULSE_LEN_MAX
Definition: irmp.c:295
#define THOMSON_PULSE_LEN_MAX
Definition: irmp.c:262
#define ROOMBA_1_PAUSE_LEN_MAX
Definition: irmp.c:543
#define SPEAKER_0_PULSE_LEN_MAX
Definition: irmp.c:325
#define FAN_FLAGS
#define LEGO_ADDRESS_OFFSET
#define IRMP_RECS80_PROTOCOL
Definition: irmpprotocols.h:32
#define LEGO_LSB
#define VINCENT_PULSE_LEN_MAX
Definition: irmp.c:191
#define VINCENT_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:187
#define BANG_OLUFSEN_COMMAND_OFFSET
#define IRMP_LGAIR_PROTOCOL
Definition: irmpprotocols.h:66
#define NEC_COMMAND_OFFSET
#define AUTO_FRAME_REPETITION_LEN
Definition: irmp.c:618
#define RCII_STOP_BIT
#define ACP24_COMMAND_OFFSET
#define SAMSUNGAH_ADDRESS_OFFSET
#define SPEAKER_0_PAUSE_LEN_MAX
Definition: irmp.c:327
#define MATSUSHITA_STOP_BIT
#define RECS80_COMMAND_OFFSET
#define VINCENT_PULSE_LEN_MIN
Definition: irmp.c:190
#define IRMP16_PULSE_LEN_MIN
Definition: irmp.c:465
#define BANG_OLUFSEN_1_PAUSE_LEN_MAX
Definition: irmp.c:348
#define THOMSON_LSB
#define KATHREIN_COMPLETE_DATA_LEN
#define PANASONIC_PULSE_LEN_MAX
Definition: irmp.c:202
#define LGAIR_COMMAND_LEN
#define RADIO1_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:603
#define RCCAR_COMPLETE_DATA_LEN
#define KASEIKYO_0_PAUSE_LEN_MIN
Definition: irmp.c:172
#define MATSUSHITA_LSB
#define STATE_RIGHT_SHIFT
Definition: irmp.c:5645
#define KATHREIN_1_PULSE_LEN_MAX
Definition: irmp.c:431
#define NEC_PULSE_LEN_MIN
Definition: irmp.c:117
#define RADIO1_ADDRESS_LEN
#define NETBOX_FLAGS
#define FDC_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:376
#define PANASONIC_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:197
#define DENON_COMPLETE_DATA_LEN
#define THOMSON_ADDRESS_LEN
#define MITSU_HEAVY_0_PAUSE_LEN_MIN
Definition: irmp.c:183
#define RECS80_LSB
#define IRMP16_ADDRESS_LEN
#define A1TVBOX_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:498
#define IRMP16_1_PAUSE_LEN_MAX
Definition: irmp.c:468
#define SIRCS_0_PULSE_LEN_MIN
Definition: irmp.c:106
#define RECS80EXT_PULSE_LEN_MAX
Definition: irmp.c:284
#define IRMP_FLAG_REPETITION
Definition: irmp.h:288
#define S100_COMMAND_LEN
#define ORTEK_BIT_PAUSE_LEN_MAX
Definition: irmp.c:520
#define NETBOX_ADDRESS_LEN
#define A1TVBOX_COMMAND_OFFSET
#define RECS80_1_PAUSE_LEN_MAX
Definition: irmp.c:215
#define ACP24_PULSE_LEN_MAX
Definition: irmp.c:585
#define NEC_FLAGS
#define RCCAR_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:390
#define ROOMBA_0_PAUSE_LEN_MIN
Definition: irmp.c:547
#define RADIO1_COMPLETE_DATA_LEN
#define IRMP16_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:464
#define KEY_MOUSE_2
Definition: irmp.c:5677
#define MERLIN_ADDRESS_LEN
#define ORTEK_BIT_PULSE_LEN_MIN
Definition: irmp.c:517
#define IRMP_RUWIDO_PROTOCOL
Definition: irmpprotocols.h:49
#define IRMP_ACP24_PROTOCOL
Definition: irmpprotocols.h:72
#define SIEMENS_ADDRESS_OFFSET
#define RCMM32_ADDRESS_LEN
#define GREE_1_PAUSE_LEN_MAX
Definition: irmp.c:479
#define THOMSON_STOP_BIT
#define RECS80EXT_FLAGS
#define RCMM32_FLAGS
#define RUWIDO_COMMAND_OFFSET
#define PENTAX_FLAGS
#define KEY_NEW_PAGE
Definition: irmp.c:5660
#define SAMSUNG_ADDRESS_OFFSET
#define ACP24_COMMAND_LEN
#define PENTAX_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:568
#define NIKON_1_PAUSE_LEN_MIN
Definition: irmp.c:420
#define METZ_PULSE_LEN_MIN
Definition: irmp.c:595
#define ROOMBA_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:537
#define SAMSUNG_1_PAUSE_LEN_MAX
Definition: irmp.c:138
#define NETBOX_ADDRESS_OFFSET
#define SIEMENS_COMPLETE_DATA_LEN
#define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
Definition: irmp.c:357
#define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
Definition: irmp.c:342
#define NEC_0_PAUSE_LEN_MIN
Definition: irmp.c:121
#define FDC_PULSE_LEN_MIN
Definition: irmp.c:377
#define TELEFUNKEN_0_PAUSE_LEN_MIN
Definition: irmp.c:530
uint32_t flags
!< command
#define RECS80EXT_0_PAUSE_LEN_MAX
Definition: irmp.c:288
#define NETBOX_LSB
#define RC5_ADDRESS_LEN
#define FDC_1_PAUSE_LEN_MAX
Definition: irmp.c:380
#define RCII_BIT_LEN_MAX
Definition: irmp.c:239
#define RCII_ADDRESS_LEN
#define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
Definition: irmp.c:339
#define IRMP_SAMSUNG48_PROTOCOL
Definition: irmpprotocols.h:67
#define IRMP_FDC_PROTOCOL
Definition: irmpprotocols.h:44
#define RCCAR_STOP_BIT
#define KASEIKYO_1_PAUSE_LEN_MAX
Definition: irmp.c:171
#define RADIO1_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:604
#define ACP24_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:582
#define VINCENT_STOP_BIT
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
Definition: irmp.c:370
#define ORTEK_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:516
#define GREE_FLAGS
#define GREE_PULSE_LEN_MAX
Definition: irmp.c:477
#define SPEAKER_1_PULSE_LEN_MIN
Definition: irmp.c:320
#define RADIO1_FLAGS
#define LEGO_1_PAUSE_LEN_MIN
Definition: irmp.c:456
#define IRMP_SAMSUNG32_PROTOCOL
Definition: irmpprotocols.h:36
#define LEGO_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:450
#define PENTAX_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:565
#define IRMP_SPEAKER_PROTOCOL
Definition: irmpprotocols.h:65
#define BANG_OLUFSEN_STOP_BIT
#define METZ_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:591
#define RCMM32_BIT_01_PAUSE_LEN_MAX
Definition: irmp.c:559
#define IRMP_RADIO1_PROTOCOL
Definition: irmpprotocols.h:84
#define SPEAKER_0_PAUSE_LEN_MIN
Definition: irmp.c:326
#define SPEAKER_COMPLETE_DATA_LEN
#define NOKIA_ADDRESS_LEN
#define RECS80_ADDRESS_LEN
#define VINCENT_1_PAUSE_LEN_MIN
Definition: irmp.c:192
#define RCMM32_BIT_PULSE_LEN_MIN
Definition: irmp.c:554
#define RADIO1_STOP_BIT
#define KEY_MOUSE_1
Definition: irmp.c:5676
#define KASEIKYO_ADDRESS_LEN
#define LEGO_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:453
#define GRUNDIG_COMPLETE_DATA_LEN
#define SIRCS_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:102
#define KATHREIN_STOP_BIT
#define RC6_COMMAND_OFFSET
#define SIEMENS_COMMAND_OFFSET
#define FAN_0_PULSE_LEN_MAX
Definition: irmp.c:312
#define S100_START_BIT_LEN_MAX
Definition: irmp.c:246
#define DENON_ADDRESS_LEN
#define IRMP_IRMP16_PROTOCOL
Definition: irmpprotocols.h:78
#define NIKON_PULSE_LEN_MIN
Definition: irmp.c:418
#define IRMP_GREE_PROTOCOL
Definition: irmpprotocols.h:79
int main(int argc, char **argv)
Definition: irmp.c:5898
#define KATHREIN_1_PAUSE_LEN_MIN
Definition: irmp.c:432
#define KATHREIN_COMMAND_OFFSET
#define METZ_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:594
#define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
Definition: irmp.c:344
#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
Definition: irmp.c:362
#define BANG_OLUFSEN_FLAGS
#define NUBERT_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:292
#define RECS80_FLAGS
#define SAMSUNG_0_PAUSE_LEN_MAX
Definition: irmp.c:140
#define RECS80_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:211
#define SAMSUNG_1_PAUSE_LEN_MIN
Definition: irmp.c:137
#define GREE_STOP_BIT
#define KASEIKYO_1_PAUSE_LEN_MIN
Definition: irmp.c:170
#define LEGO_0_PAUSE_LEN_MAX
Definition: irmp.c:459
#define BANG_OLUFSEN_0_PAUSE_LEN_MIN
Definition: irmp.c:349
#define NEC_ADDRESS_LEN
#define STATE_LEFT_SHIFT
Definition: irmp.c:5644
#define IRMP_VINCENT_PROTOCOL
Definition: irmpprotocols.h:76
#define FAN_LSB
#define RCMM32_LSB
#define DENON_FLAGS
#define NETBOX_STOP_BIT
#define MATSUSHITA_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:155
#define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
Definition: irmp.c:341
#define TELEFUNKEN_1_PAUSE_LEN_MAX
Definition: irmp.c:529
#define VINCENT_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:188
#define GREE_COMMAND_LEN
#define BANG_OLUFSEN_ADDRESS_OFFSET
#define GREE_ADDRESS_LEN
#define RC6_ADDRESS_OFFSET
#define LEGO_1_PAUSE_LEN_MAX
Definition: irmp.c:457
#define RECS80_PULSE_LEN_MIN
Definition: irmp.c:212
#define IRMP_RCMM24_PROTOCOL
Definition: irmpprotocols.h:63
#define RCCAR_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:388
#define RECS80_COMPLETE_DATA_LEN
#define KATHREIN_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:427
#define RCCAR_1_PAUSE_LEN_MAX
Definition: irmp.c:395
#define TELEFUNKEN_ADDRESS_OFFSET
#define MITSU_HEAVY_ADDRESS_LEN
#define KATHREIN_0_PULSE_LEN_MAX
Definition: irmp.c:435
#define RCII_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:230
#define ORTEK_ADDRESS_LEN
#define RC6_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:270
#define BOSE_COMMAND_OFFSET
#define KEY_UP
Definition: irmp.c:5671
#define RCCAR_0_PAUSE_LEN_MIN
Definition: irmp.c:396
#define NIKON_COMPLETE_DATA_LEN
#define MATSUSHITA_PULSE_LEN_MAX
Definition: irmp.c:158
#define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:116
#define KASEIKYO_COMMAND_LEN
#define KASEIKYO_PULSE_LEN_MAX
Definition: irmp.c:169
#define SPEAKER_0_PULSE_LEN_MIN
Definition: irmp.c:324
#define MERLIN_COMMAND_LEN
#define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:401
#define ROOMBA_FLAGS
#define IRMP16_COMMAND_LEN
#define BANG_OLUFSEN_COMPLETE_DATA_LEN
#define BANG_OLUFSEN_COMMAND_LEN
#define ORTEK_COMMAND_OFFSET
#define KATHREIN_1_PAUSE_LEN_MAX
Definition: irmp.c:433
#define MERLIN_STOP_BIT
#define MERLIN_BIT_PULSE_LEN_MAX
Definition: irmp.c:509
#define KATHREIN_0_PAUSE_LEN_MAX
Definition: irmp.c:437
#define SAMSUNG_LSB
#define KATHREIN_0_PULSE_LEN_MIN
Definition: irmp.c:434
#define RCCAR_0_PAUSE_LEN_MAX
Definition: irmp.c:397
#define KEY_ESCAPE
Definition: irmp.c:5650
#define IRMP_RCMM12_PROTOCOL
Definition: irmpprotocols.h:64
#define ORTEK_LSB
#define RECS80EXT_ADDRESS_LEN
#define IRMP_NOKIA_PROTOCOL
Definition: irmpprotocols.h:42
#define NETBOX_PULSE_LEN
Definition: irmp.c:445
#define PANASONIC_ADDRESS_OFFSET
#define NIKON_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:413
#define RC5_COMMAND_LEN
#define BOSE_0_PAUSE_LEN_MIN
Definition: irmp.c:491
#define IRMP_S100_PROTOCOL
Definition: irmpprotocols.h:71
#define RADIO1_COMMAND_OFFSET
#define NUBERT_0_PULSE_LEN_MAX
Definition: irmp.c:299
#define NUBERT_LSB
#define SIRCS_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:97
#define A1TVBOX_STOP_BIT
#define FAN_COMMAND_LEN
#define RADIO1_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:605
#define IRMP16_0_PAUSE_LEN_MAX
Definition: irmp.c:470
#define FDC_0_PAUSE_LEN_MIN
Definition: irmp.c:384
#define VINCENT_COMMAND_LEN
#define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
Definition: irmp.c:622
#define ROOMBA_0_PULSE_LEN_MIN
Definition: irmp.c:545
#define MATSUSHITA_1_PAUSE_LEN_MIN
Definition: irmp.c:159
#define KEY_STOP
Definition: irmp.c:5657
#define PANASONIC_1_PAUSE_LEN_MAX
Definition: irmp.c:204
#define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:144
#define NUBERT_0_PAUSE_LEN_MIN
Definition: irmp.c:300
#define NEC42_ADDRESS_OFFSET
#define RADIO1_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:606
#define PENTAX_COMMAND_OFFSET
#define RC6_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:269
#define SIRCS_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:96
#define SPEAKER_ADDRESS_LEN
#define IRMP_NIKON_PROTOCOL
Definition: irmpprotocols.h:48
#define SAMSUNG_PULSE_LEN_MIN
Definition: irmp.c:135
#define KATHREIN_LSB
#define THOMSON_FLAGS
#define S100_ADDRESS_LEN
#define KASEIKYO_ADDRESS_OFFSET
#define RCCAR_ADDRESS_OFFSET
#define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
Definition: irmp.c:358
#define RADIO1_COMMAND_LEN
#define NIKON_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:412
#define ACP24_PULSE_LEN_MIN
Definition: irmp.c:584
#define PENTAX_PULSE_LEN_MIN
Definition: irmp.c:575
#define VINCENT_COMPLETE_DATA_LEN
#define RC5_START_BIT_LEN_MAX
Definition: irmp.c:224
#define FAN_COMMAND_OFFSET
#define RCII_ADDRESS_OFFSET
#define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:366
#define FDC_0_PAUSE_LEN_MAX
Definition: irmp.c:386
#define ORTEK_ADDRESS_OFFSET
#define RUWIDO_ADDRESS_OFFSET
#define IRMP_SIEMENS_PROTOCOL
Definition: irmpprotocols.h:43
#define METZ_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:592
#define ORTEK_COMPLETE_DATA_LEN
#define MERLIN_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:505
#define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
Definition: irmp.c:338
#define RC6_LSB
#define ROOMBA_1_PAUSE_LEN_MIN
Definition: irmp.c:542
#define PANASONIC_COMPLETE_DATA_LEN
#define PANASONIC_1_PAUSE_LEN_MIN
Definition: irmp.c:203
#define VINCENT_ADDRESS_OFFSET
#define SIRCS_0_PULSE_LEN_MAX
Definition: irmp.c:107
#define MERLIN_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:506
#define THOMSON_ADDRESS_OFFSET
#define PANASONIC_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:198
#define A1TVBOX_BIT_PULSE_LEN_MIN
Definition: irmp.c:499
#define DENON_PULSE_LEN_MAX
Definition: irmp.c:253
#define IRMP_KEY_REPETITION_LEN
Definition: irmp.c:58
#define SAMSUNG32_COMMAND_OFFSET
#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:365
#define METZ_FLAGS
#define IRMP_N_PROTOCOLS
Definition: irmpprotocols.h:86
#define PANASONIC_LSB
#define SIRCS_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:98
#define GREE_0_PAUSE_LEN_MIN
Definition: irmp.c:480
#define ACP24_0_PAUSE_LEN_MIN
Definition: irmp.c:588
#define RECS80EXT_COMPLETE_DATA_LEN
#define SAMSUNGAH_PULSE_LEN_MAX
Definition: irmp.c:147
#define irmp_log(val)
Definition: irmp.c:1139
#define BANG_OLUFSEN_1_PAUSE_LEN_MIN
Definition: irmp.c:347
#define LEGO_0_PAUSE_LEN_MIN
Definition: irmp.c:458
#define SAMSUNG_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:132
#define RCMM32_BIT_01_PAUSE_LEN_MIN
Definition: irmp.c:558
#define RC6_BIT_PAUSE_LEN_MAX
Definition: irmp.c:277
#define SAMSUNGAH_LSB
#define KEY_END
Definition: irmp.c:5670
#define KEY_BACK
Definition: irmp.c:5652
#define BOSE_COMPLETE_DATA_LEN
#define FAN_0_PAUSE_LEN_MAX
Definition: irmp.c:314
#define FDC_FLAGS
#define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:145
#define A1TVBOX_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:497
#define METZ_0_PAUSE_LEN_MIN
Definition: irmp.c:599
#define FAN_COMPLETE_DATA_LEN
#define LGAIR_ADDRESS_OFFSET
#define RCMM32_ADDRESS_OFFSET
#define PANASONIC_COMMAND_OFFSET
#define NOKIA_ADDRESS_OFFSET
#define RECS80EXT_PULSE_LEN_MIN
Definition: irmp.c:283
#define TELEFUNKEN_STOP_BIT
#define SAMSUNG_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:131
#define MATSUSHITA_PULSE_LEN_MIN
Definition: irmp.c:157
#define VINCENT_ADDRESS_LEN
#define MERLIN_ADDRESS_OFFSET
#define BOSE_0_PAUSE_LEN_MAX
Definition: irmp.c:492
#define RCII_BIT_LEN
Definition: irmp.c:238
#define DENON_PULSE_LEN_MIN
Definition: irmp.c:252
#define RC6_BIT_PULSE_LEN_MAX
Definition: irmp.c:275
#define PENTAX_0_PAUSE_LEN_MIN
Definition: irmp.c:577
#define NEC42_ADDRESS_LEN
#define SIRCS_COMMAND_OFFSET
#define ROOMBA_COMPLETE_DATA_LEN
#define SPEAKER_COMMAND_OFFSET
#define MERLIN_BIT_PAUSE_LEN_MAX
Definition: irmp.c:511
#define GREE_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:474
#define LGAIR_COMPLETE_DATA_LEN
#define RECS80EXT_1_PAUSE_LEN_MIN
Definition: irmp.c:285
#define ACP24_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:580
#define IRMP_ROOMBA_PROTOCOL
Definition: irmpprotocols.h:61
#define BANG_OLUFSEN_LSB
#define NEC42_COMMAND_LEN
#define TELEFUNKEN_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:523
#define LEGO_COMPLETE_DATA_LEN
#define GRUNDIG_ADDRESS_LEN
#define IRMP_PENTAX_PROTOCOL
Definition: irmpprotocols.h:69
#define GREE_ADDRESS_OFFSET
#define ROOMBA_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:538
#define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
Definition: irmp.c:340
#define KASEIKYO_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:165
#define ANALYZE_PUTCHAR(a)
Definition: irmp.c:621
#define PENTAX_0_PAUSE_LEN_MAX
Definition: irmp.c:578
#define RCII_FLAGS
#define KASEIKYO_COMMAND_OFFSET
#define FAN_1_PULSE_LEN_MIN
Definition: irmp.c:307
#define IRMP16_COMMAND_OFFSET
#define FDC_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:373
#define RECS80EXT_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:280
#define KASEIKYO_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:164
void irmp_init(void)
#define A1TVBOX_BIT_PAUSE_LEN_MAX
Definition: irmp.c:502
#define IR60_COMMAND_OFFSET
#define RCCAR_FLAGS
#define RCMM32_BIT_11_PAUSE_LEN_MIN
Definition: irmp.c:562
#define IRMP_RECS80EXT_PROTOCOL
Definition: irmpprotocols.h:38
#define MATSUSHITA_COMMAND_OFFSET
#define NETBOX_COMPLETE_DATA_LEN
#define SAMSUNGAH_STOP_BIT
#define SIEMENS_OR_RUWIDO_STOP_BIT
#define RUWIDO_COMMAND_LEN
#define SAMSUNG_COMMAND_OFFSET
#define SPEAKER_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:318
#define IR60_TIMEOUT_LEN
Definition: irmp.c:356
#define SIEMENS_COMMAND_LEN
#define PANASONIC_0_PAUSE_LEN_MAX
Definition: irmp.c:206
#define FDC_1_PAUSE_LEN_MIN
Definition: irmp.c:379
#define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
Definition: irmp.c:330
#define ACP24_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:583
#define VINCENT_FLAGS
#define PANASONIC_FLAGS
#define PANASONIC_STOP_BIT
#define PENTAX_1_PAUSE_LEN_MIN
Definition: irmp.c:572
#define MERLIN_LSB
#define RC5_STOP_BIT
#define IRMP_NUBERT_PROTOCOL
Definition: irmpprotocols.h:39
#define GREE_COMMAND_OFFSET
#define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
Definition: irmp.c:439
#define IRMP_SUPPORT_SERIAL
Definition: irmp.c:55
#define TRUE
Definition: irmpsystem.h:193
uint_fast8_t irmp_ISR(void)
Definition: irmp.c:2990
#define NIKON_0_PAUSE_LEN_MAX
Definition: irmp.c:423
#define TELEFUNKEN_COMPLETE_DATA_LEN
#define MITSU_HEAVY_ADDRESS_OFFSET
#define NUBERT_ADDRESS_LEN
#define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
Definition: irmp.c:336
#define NUBERT_1_PAUSE_LEN_MAX
Definition: irmp.c:297
#define BOSE_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:486
#define NUBERT_FLAGS
#define NOKIA_COMMAND_OFFSET
#define PENTAX_ADDRESS_OFFSET
#define SAMSUNG_ID_OFFSET
#define RCCAR_PULSE_LEN_MIN
Definition: irmp.c:392
#define NEC_PULSE_LEN_MAX
Definition: irmp.c:118
#define NEC_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:113
#define IRMP_NEC42_PROTOCOL
Definition: irmpprotocols.h:54
#define ORTEK_COMMAND_LEN
#define KEY_FONT
Definition: irmp.c:5662
#define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
Definition: irmp.c:332
#define PANASONIC_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:200
#define TELEFUNKEN_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:522
#define RADIO1_ADDRESS_OFFSET
#define TELEFUNKEN_1_PAUSE_LEN_MIN
Definition: irmp.c:528
#define RCMM32_BIT_11_PAUSE_LEN_MAX
Definition: irmp.c:563
#define RECS80EXT_ADDRESS_OFFSET
#define MITSU_HEAVY_0_PAUSE_LEN_MAX
Definition: irmp.c:184
#define SPEAKER_COMMAND_LEN
#define LEGO_ADDRESS_LEN
#define IR60_ADDRESS_LEN
#define LEGO_PULSE_LEN_MAX
Definition: irmp.c:455
#define KATHREIN_0_PAUSE_LEN_MIN
Definition: irmp.c:436
#define SPEAKER_1_PAUSE_LEN_MAX
Definition: irmp.c:323
#define ACP24_0_PAUSE_LEN_MAX
Definition: irmp.c:589
#define RCCAR_LSB
#define NETBOX_PULSE_REST_LEN
Definition: irmp.c:447
#define IRMP_KASEIKYO_PROTOCOL
Definition: irmpprotocols.h:31
#define METZ_LSB
#define SIEMENS_OR_RUWIDO_LSB
#define MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:175
#define NIKON_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:414
#define NEC_FRAME_REPEAT_PAUSE_LEN_MAX
Definition: irmp.c:128
#define RCII_COMPLETE_DATA_LEN
#define GRUNDIG_NOKIA_IR60_LSB
#define IRMP_RCMM32_PROTOCOL
Definition: irmpprotocols.h:62
#define ACP24_COMPLETE_DATA_LEN
#define IRMP16_1_PAUSE_LEN_MIN
Definition: irmp.c:467
#define VINCENT_1_PAUSE_LEN_MAX
Definition: irmp.c:193
#define KATHREIN_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:429
#define SIRCS_MINIMUM_DATA_LEN
#define ACP24_1_PAUSE_LEN_MIN
Definition: irmp.c:586
#define RC5_LSB
#define NUBERT_STOP_BIT
#define IRMP_RC6_PROTOCOL
Definition: irmpprotocols.h:35
#define SPEAKER_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:316
#define TELEFUNKEN_PULSE_LEN_MAX
Definition: irmp.c:527
#define THOMSON_COMMAND_OFFSET
#define PANASONIC_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:199
#define NIKON_0_PAUSE_LEN_MIN
Definition: irmp.c:422
#define FAN_0_PAUSE_LEN_MIN
Definition: irmp.c:313
#define FAN_1_PULSE_LEN_MAX
Definition: irmp.c:308
#define IRMP_SUPPORT_MANCHESTER
Definition: irmp.c:49
#define A1TVBOX_COMPLETE_DATA_LEN
#define BOSE_COMMAND_LEN
#define PENTAX_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:566
#define NUBERT_1_PULSE_LEN_MIN
Definition: irmp.c:294
#define ROOMBA_1_PULSE_LEN_MIN
Definition: irmp.c:540
#define IRMP_PARAM_FLAG_IS_MANCHESTER
#define ORTEK_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:513
#define RCII_COMMAND_OFFSET
#define KASEIKYO_COMPLETE_DATA_LEN
#define ROOMBA_0_PAUSE_LEN_MAX
Definition: irmp.c:548
#define SIRCS_1_PULSE_LEN_MAX
Definition: irmp.c:105
#define KASEIKYO_PULSE_LEN_MIN
Definition: irmp.c:168
#define NIKON_PULSE_LEN_MAX
Definition: irmp.c:419
#define SAMSUNG32_COMMAND_LEN
#define BOSE_FLAGS
#define RC6_TOGGLE_BIT_LEN_MIN
Definition: irmp.c:272
#define DENON_0_PAUSE_LEN_MAX
Definition: irmp.c:258
#define FDC_COMPLETE_DATA_LEN
#define PANASONIC_COMMAND_LEN
#define RCMM32_BIT_PULSE_LEN_MAX
Definition: irmp.c:555
#define RADIO1_0_PULSE_LEN_MIN
Definition: irmp.c:613
#define METZ_COMPLETE_DATA_LEN
#define SPEAKER_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:317
uint8_t PAUSE_LEN
#define NEC_1_PAUSE_LEN_MIN
Definition: irmp.c:119
#define SIEMENS_ADDRESS_LEN
#define S100_COMMAND_OFFSET
#define BOSE_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:484
#define PARITY_CHECK_FAILED
Definition: irmp.c:644
#define RECS80_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:209
#define NOKIA_COMMAND_LEN
#define LEGO_COMMAND_OFFSET
#define SAMSUNG_PULSE_LEN_MAX
Definition: irmp.c:136
#define SIRCS_LSB
#define MITSU_HEAVY_PULSE_LEN_MAX
Definition: irmp.c:180
#define IRMP_RC6A_PROTOCOL
Definition: irmpprotocols.h:47
#define ACP24_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:581
#define RCII_BIT_LEN_MIN
Definition: irmp.c:237
#define MERLIN_BIT_PULSE_LEN_MIN
Definition: irmp.c:508
#define FAN_0_PULSE_LEN_MIN
Definition: irmp.c:311
#define SAMSUNGAH_1_PAUSE_LEN_MIN
Definition: irmp.c:148
#define SPEAKER_ADDRESS_OFFSET
#define RC5_BIT_LEN_MIN
Definition: irmp.c:227
#define RECS80EXT_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:281
#define THOMSON_COMMAND_LEN
#define IRMP_MATSUSHITA_PROTOCOL
Definition: irmpprotocols.h:30
#define NIKON_STOP_BIT
#define NEC_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:111
#define RADIO1_LSB
#define RC5_COMMAND_OFFSET
#define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:525
#define IRMP16_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:461
#define IRMP_KATHREIN_PROTOCOL
Definition: irmpprotocols.h:51
#define MATSUSHITA_COMMAND_LEN
#define RECS80_STOP_BIT
#define ROOMBA_1_PULSE_LEN_MAX
Definition: irmp.c:541
#define S100_STOP_BIT
#define VINCENT_LSB
#define FDC_PULSE_LEN_MAX
Definition: irmp.c:378
#define VINCENT_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:186
#define RCCAR_COMMAND_OFFSET
#define RADIO1_0_PAUSE_LEN_MAX
Definition: irmp.c:616
#define VINCENT_0_PAUSE_LEN_MAX
Definition: irmp.c:195
#define METZ_COMMAND_OFFSET
#define DENON_COMMAND_LEN
#define JVC_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:399
#define SAMSUNG_STOP_BIT
#define DENON_STOP_BIT
#define BOSE_LSB
#define KEY_FORWARD
Definition: irmp.c:5653
#define SAMSUNG_ADDRESS_LEN
#define SAMSUNGAH_COMPLETE_DATA_LEN
#define A1TVBOX_LSB
#define IRMP_BOSE_PROTOCOL
Definition: irmpprotocols.h:57
#define JVC_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:400
#define IRMP_DENON_PROTOCOL
Definition: irmpprotocols.h:34
#define IRMP_SAMSUNGAH_PROTOCOL
Definition: irmpprotocols.h:77
#define SAMSUNGAH_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:142
#define SIRCS_COMMAND_LEN
#define SAMSUNG48_COMMAND_LEN
#define LEGO_PULSE_LEN_MIN
Definition: irmp.c:454
#define IRMP_APPLE_PROTOCOL
Definition: irmpprotocols.h:37
#define SPEAKER_FLAGS
#define FAN_1_PAUSE_LEN_MAX
Definition: irmp.c:310
#define RCII_COMMAND_LEN
#define SIRCS_1_PULSE_LEN_MIN
Definition: irmp.c:104
#define RC6_TOGGLE_BIT_LEN_MAX
Definition: irmp.c:273
#define TELEFUNKEN_0_PAUSE_LEN_MAX
Definition: irmp.c:531
#define MITSU_HEAVY_1_PAUSE_LEN_MIN
Definition: irmp.c:181
#define METZ_1_PAUSE_LEN_MIN
Definition: irmp.c:597
#define NUBERT_COMMAND_LEN
#define ORTEK_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:515
#define LEGO_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:451
#define RCMM32_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:552
#define MITSU_HEAVY_COMPLETE_DATA_LEN
#define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
Definition: irmp.c:331
#define NIKON_1_PAUSE_LEN_MAX
Definition: irmp.c:421
#define KASEIKYO_FLAGS
#define RC6_COMPLETE_DATA_LEN_LONG
#define S100_ADDRESS_OFFSET
#define ROOMBA_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:535
#define IRMP_TELEFUNKEN_PROTOCOL
Definition: irmpprotocols.h:60
#define IRMP_GRUNDIG_PROTOCOL
Definition: irmpprotocols.h:41
#define KEY_INSERT
Definition: irmp.c:5666
#define ACP24_ADDRESS_LEN
#define KEY_HOME
Definition: irmp.c:5669
#define IRMP_PARAM_FLAG_1ST_PULSE_IS_1
#define TELEFUNKEN_COMMAND_OFFSET
#define BOSE_ADDRESS_OFFSET
#define GREE_1_PAUSE_LEN_MIN
Definition: irmp.c:478
#define IRMP_NETBOX_PROTOCOL
Definition: irmpprotocols.h:52
#define VINCENT_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:189
#define MATSUSHITA_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:153
#define ROOMBA_0_PAUSE_LEN
Definition: irmp.c:544
#define SIRCS_FLAGS
#define FAN_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:303
#define RECS80_1_PAUSE_LEN_MIN
Definition: irmp.c:214
#define RADIO1_1_PULSE_LEN_MAX
Definition: irmp.c:609
#define KEY_DELETE
Definition: irmp.c:5667
#define GREE_PULSE_LEN_MIN
Definition: irmp.c:476
#define NUBERT_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:290
#define VINCENT_0_PAUSE_LEN_MIN
Definition: irmp.c:194
#define ANALYZE_NEWLINE()
Definition: irmp.c:625
#define RCMM32_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:553
#define IRMP_TECHNICS_PROTOCOL
Definition: irmpprotocols.h:73
#define BOSE_1_PAUSE_LEN_MIN
Definition: irmp.c:489
#define FDC_STOP_BIT
#define FAN_1_PAUSE_LEN_MIN
Definition: irmp.c:309
#define RC6_BIT_PULSE_LEN_MIN
Definition: irmp.c:274
#define KATHREIN_1_PULSE_LEN_MIN
Definition: irmp.c:430
#define STATE_LEFT_CTRL
Definition: irmp.c:5646
#define METZ_ADDRESS_LEN
#define METZ_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:593
#define NEC_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:112
#define SPEAKER_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:319
#define NETBOX_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:441
#define IRMP_A1TVBOX_PROTOCOL
Definition: irmpprotocols.h:58
#define RECS80_0_PAUSE_LEN_MIN
Definition: irmp.c:216
#define GREE_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:475
#define NUBERT_0_PAUSE_LEN_MAX
Definition: irmp.c:301
#define GRUNDIG_COMMAND_OFFSET
#define BOSE_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:483
#define FDC_COMMAND_OFFSET
#define GREE_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:472
#define A1TVBOX_BIT_PAUSE_LEN_MIN
Definition: irmp.c:501
#define RC5_FLAGS
#define NIKON_ADDRESS_LEN
#define RC6_ADDRESS_LEN
#define IRMP_RCCAR_PROTOCOL
Definition: irmpprotocols.h:45
#define IRMP_METZ_PROTOCOL
Definition: irmpprotocols.h:81
#define MERLIN_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:507
#define ANALYZE_PRINTF(...)
Definition: irmp.c:623
#define NETBOX_PAUSE_LEN
Definition: irmp.c:446
#define RCCAR_ADDRESS_LEN
#define DENON_1_PAUSE_LEN_MIN
Definition: irmp.c:254
void print_spectrum(char *text, int *buf, int is_pulse)
Definition: irmp.c:5565
#define GREE_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:473
#define SIRCS_STOP_BIT
#define RCII_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:231
#define TELEFUNKEN_PULSE_LEN_MIN
Definition: irmp.c:526
#define STATE_LEFT_ALT
Definition: irmp.c:5647
#define RECS80EXT_0_PAUSE_LEN_MIN
Definition: irmp.c:287
#define NETBOX_COMMAND_LEN
#define S100_BIT_LEN_MIN
Definition: irmp.c:249
#define RCMM32_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:551
#define NUBERT_ADDRESS_OFFSET
#define GREE_COMPLETE_DATA_LEN
#define MATSUSHITA_FLAGS
#define MITSU_HEAVY_LSB
#define MATSUSHITA_0_PAUSE_LEN_MAX
Definition: irmp.c:162
#define BOSE_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:485
#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
Definition: irmp.c:368
#define SAMSUNGAH_0_PAUSE_LEN_MIN
Definition: irmp.c:150
#define SIRCS_COMPLETE_DATA_LEN
#define NIKON_COMMAND_LEN
#define GRUNDIG_ADDRESS_OFFSET
#define GREE_LSB
#define PENTAX_PULSE_LEN_MAX
Definition: irmp.c:576
#define ROOMBA_STOP_BIT
#define ACP24_1_PAUSE_LEN_MAX
Definition: irmp.c:587
#define RC6_STOP_BIT
#define DENON_ADDRESS_OFFSET
#define THOMSON_1_PAUSE_LEN_MIN
Definition: irmp.c:263
#define RECS80EXT_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:282
#define MERLIN_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:504
#define THOMSON_1_PAUSE_LEN_MAX
Definition: irmp.c:264
#define ORTEK_BIT_PAUSE_LEN_MIN
Definition: irmp.c:519
#define NEC_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:114
#define IRMP_SIRCS_PROTOCOL
Definition: irmpprotocols.h:27
#define PENTAX_ADDRESS_LEN
#define NETBOX_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:443
#define ORTEK_BIT_PULSE_LEN_MAX
Definition: irmp.c:518
#define IRMP_THOMSON_PROTOCOL
Definition: irmpprotocols.h:56
#define IRMP16_STOP_BIT
#define A1TVBOX_ADDRESS_OFFSET
#define RECS80_COMMAND_LEN
#define FDC_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:375
#define SIRCS_ADDRESS_OFFSET
#define SAMSUNGAH_COMMAND_LEN
#define LEGO_FLAGS
#define IRMP_IR60_PROTOCOL
Definition: irmpprotocols.h:50
#define ROOMBA_ADDRESS_OFFSET
#define SPEAKER_1_PULSE_LEN_MAX
Definition: irmp.c:321
#define ROOMBA_ADDRESS_LEN
#define KEY_FAVORITES
Definition: irmp.c:5659
#define A1TVBOX_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:495
#define ACP24_LSB
#define FDC_ADDRESS_OFFSET
#define NEC_COMMAND_LEN
#define IRMP_ORTEK_PROTOCOL
Definition: irmpprotocols.h:59
#define NUBERT_COMPLETE_DATA_LEN
#define NUBERT_1_PAUSE_LEN_MIN
Definition: irmp.c:296
#define BANG_OLUFSEN_ADDRESS_LEN
#define MERLIN_BIT_PAUSE_LEN_MIN
Definition: irmp.c:510
#define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
Definition: irmp.c:334
#define MERLIN_COMPLETE_DATA_LEN
#define THOMSON_0_PAUSE_LEN_MIN
Definition: irmp.c:265
#define GRUNDIG_NOKIA_IR60_STOP_BIT
#define IR60_COMPLETE_DATA_LEN
#define SAMSUNG_FLAGS
#define SAMSUNG_COMMAND_LEN
#define MATSUSHITA_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:154
#define SAMSUNGAH_1_PAUSE_LEN_MAX
Definition: irmp.c:149
#define BOSE_1_PAUSE_LEN_MAX
Definition: irmp.c:490
#define SAMSUNG_ID_LEN
#define MATSUSHITA_1_PAUSE_LEN_MAX
Definition: irmp.c:160
#define THOMSON_PULSE_LEN_MIN
Definition: irmp.c:261
#define KATHREIN_ADDRESS_LEN
#define MITSU_HEAVY_1_PAUSE_LEN_MAX
Definition: irmp.c:182
#define ROOMBA_LSB
#define RADIO1_1_PULSE_LEN_MIN
Definition: irmp.c:608
#define KEY_SETUP
Definition: irmp.c:5661
#define RECS80_PULSE_LEN_MAX
Definition: irmp.c:213
#define MATSUSHITA_ADDRESS_LEN
#define RADIO1_0_PULSE_LEN_MAX
Definition: irmp.c:614
#define ROOMBA_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:536
#define RC6_COMMAND_LEN
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
Definition: irmp.c:371
#define MATSUSHITA_0_PAUSE_LEN_MIN
Definition: irmp.c:161
#define A1TVBOX_FLAGS
#define FAN_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:305
#define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
Definition: irmp.c:364
#define MATSUSHITA_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:156
#define SPEAKER_STOP_BIT
#define RC5_ADDRESS_OFFSET
#define IRMP16_LSB
#define VINCENT_COMMAND_OFFSET
#define LEGO_STOP_BIT
#define TELEFUNKEN_ADDRESS_LEN
#define PANASONIC_ADDRESS_LEN
#define ORTEK_STOP_BIT
#define BANG_OLUFSEN_R_PAUSE_LEN_MIN
Definition: irmp.c:351
#define RECS80EXT_STOP_BIT
#define BANG_OLUFSEN_R_PAUSE_LEN_MAX
Definition: irmp.c:352
#define IRMP_NEC_PROTOCOL
Definition: irmpprotocols.h:28
#define IRMP_SAMSUNG_PROTOCOL
Definition: irmpprotocols.h:29
#define RCCAR_PULSE_LEN_MAX
Definition: irmp.c:393
#define MITSU_HEAVY_STOP_BIT
#define RC5_START_BIT_LEN_MIN
Definition: irmp.c:223
#define RECS80EXT_COMMAND_OFFSET
#define RC5_BIT_LEN_MAX
Definition: irmp.c:228
#define S100_COMPLETE_DATA_LEN
#define GREE_0_PAUSE_LEN_MAX
Definition: irmp.c:481
#define KEY_ADDRESS
Definition: irmp.c:5654
#define IRMP_UNKNOWN_PROTOCOL
Definition: irmpprotocols.h:26
#define SAMSUNGAH_START_BIT_PULSE_LEN_MAX
Definition: irmp.c:143
#define S100_START_BIT_LEN_MIN
Definition: irmp.c:245
#define IRMP_RCII_PROTOCOL
Definition: irmpprotocols.h:80
#define ORTEK_FLAGS
#define RECS80_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:210
#define NETBOX_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:444
#define NUBERT_COMMAND_OFFSET
#define RCCAR_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:391
#define RCII_LSB
#define LGAIR_COMMAND_OFFSET
#define NUBERT_0_PULSE_LEN_MIN
Definition: irmp.c:298
#define IR60_ADDRESS_OFFSET
#define ACP24_STOP_BIT
#define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
Definition: irmp.c:360
#define NEC_0_PAUSE_LEN_MAX
Definition: irmp.c:122
#define IRMP_MERLIN_PROTOCOL
Definition: irmpprotocols.h:68
#define RECS80EXT_1_PAUSE_LEN_MAX
Definition: irmp.c:286
#define SIEMENS_OR_RUWIDO_FLAGS
#define DENON_1_PAUSE_LEN_MAX
Definition: irmp.c:255
#define JVC_START_BIT_PULSE_TIME
#define RCII_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:233
#define ANALYZE_ONLY_NORMAL_PRINTF(...)
Definition: irmp.c:624
#define FAN_STOP_BIT
#define PENTAX_START_BIT_PAUSE_LEN_MIN
Definition: irmp.c:567
#define KASEIKYO_0_PAUSE_LEN_MAX
Definition: irmp.c:173
#define NETBOX_COMMAND_OFFSET
#define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
Definition: irmp.c:369
#define METZ_0_PAUSE_LEN_MAX
Definition: irmp.c:600
#define S100_BIT_LEN_MAX
Definition: irmp.c:250
#define KEY_MAIL
Definition: irmp.c:5658
#define FAN_START_BIT_PAUSE_LEN_MAX
Definition: irmp.c:306
#define IRMP_ONKYO_PROTOCOL
Definition: irmpprotocols.h:82
#define FDC_COMMAND_LEN
#define ACP24_ADDRESS_OFFSET
#define NEC_LSB
#define RC6_BIT_PAUSE_LEN_MIN
Definition: irmp.c:276
#define SAMSUNG32_COMPLETE_DATA_LEN
#define LGAIR_ADDRESS_LEN
#define ROOMBA_COMMAND_LEN
#define BANG_OLUFSEN_0_PAUSE_LEN_MAX
Definition: irmp.c:350
#define KEY_MENUE
Definition: irmp.c:5651
#define METZ_ADDRESS_OFFSET
#define NEC_1_PAUSE_LEN_MAX
Definition: irmp.c:120
#define SIRCS_PAUSE_LEN_MIN
Definition: irmp.c:108