1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.192 2017/02/17 09:13:06 fm Exp $
8 * Supported AVR mikrocontrollers:
13 * ATmega8, ATmega16, ATmega32
15 * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P
16 * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *---------------------------------------------------------------------------------------------------------------------------------------------------
27 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRMP_SUPPORT_NOKIA_PROTOCOL == 1 || IRMP_SUPPORT_IR60_PROTOCOL == 1
28 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 1
30 # define IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL 0
33 #if IRMP_SUPPORT_SIEMENS_PROTOCOL == 1 || IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
34 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 1
36 # define IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL 0
39 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || \
40 IRMP_SUPPORT_S100_PROTOCOL == 1 || \
41 IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
42 IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
43 IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
44 IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
45 IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
46 IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
47 IRMP_SUPPORT_ORTEK_PROTOCOL == 1
48 # define IRMP_SUPPORT_MANCHESTER 1
50 # define IRMP_SUPPORT_MANCHESTER 0
53 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
54 # define IRMP_SUPPORT_SERIAL 1
56 # define IRMP_SUPPORT_SERIAL 0
59 #define IRMP_KEY_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * 150.0e-3 + 0.5) // autodetect key repetition within 150 msec
61 #define MIN_TOLERANCE_00 1.0 // -0%
62 #define MAX_TOLERANCE_00 1.0 // +0%
64 #define MIN_TOLERANCE_02 0.98 // -2%
65 #define MAX_TOLERANCE_02 1.02 // +2%
67 #define MIN_TOLERANCE_03 0.97 // -3%
68 #define MAX_TOLERANCE_03 1.03 // +3%
70 #define MIN_TOLERANCE_05 0.95 // -5%
71 #define MAX_TOLERANCE_05 1.05 // +5%
73 #define MIN_TOLERANCE_10 0.9 // -10%
74 #define MAX_TOLERANCE_10 1.1 // +10%
76 #define MIN_TOLERANCE_15 0.85 // -15%
77 #define MAX_TOLERANCE_15 1.15 // +15%
79 #define MIN_TOLERANCE_20 0.8 // -20%
80 #define MAX_TOLERANCE_20 1.2 // +20%
82 #define MIN_TOLERANCE_30 0.7 // -30%
83 #define MAX_TOLERANCE_30 1.3 // +30%
85 #define MIN_TOLERANCE_40 0.6 // -40%
86 #define MAX_TOLERANCE_40 1.4 // +40%
88 #define MIN_TOLERANCE_50 0.5 // -50%
89 #define MAX_TOLERANCE_50 1.5 // +50%
91 #define MIN_TOLERANCE_60 0.4 // -60%
92 #define MAX_TOLERANCE_60 1.6 // +60%
94 #define MIN_TOLERANCE_70 0.3 // -70%
95 #define MAX_TOLERANCE_70 1.7 // +70%
97 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
98 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
99 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
100 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
101 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
102 #else // only 5% + 1 to avoid conflict with RC6:
103 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
105 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
106 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
107 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
108 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
109 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
110 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
112 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
118 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
119 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
120 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
121 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
122 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
123 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
124 // autodetect nec repetition frame within 50 msec:
125 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
127 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
129 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
132 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
133 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
134 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
135 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
136 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
137 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
138 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
139 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
140 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
141 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
143 #define SAMSUNGAH_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
144 #define SAMSUNGAH_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
145 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
146 #define SAMSUNGAH_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
147 #define SAMSUNGAH_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
148 #define SAMSUNGAH_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
149 #define SAMSUNGAH_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
150 #define SAMSUNGAH_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
151 #define SAMSUNGAH_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
152 #define SAMSUNGAH_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNGAH_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
154 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
155 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
156 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
157 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
158 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
159 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
160 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
161 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
162 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
163 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
165 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
166 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
167 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
168 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
169 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
170 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
171 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
172 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
173 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
174 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
176 #define MITSU_HEAVY_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
177 #define MITSU_HEAVY_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
178 #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
179 #define MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
180 #define MITSU_HEAVY_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
181 #define MITSU_HEAVY_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
182 #define MITSU_HEAVY_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
183 #define MITSU_HEAVY_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
184 #define MITSU_HEAVY_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
185 #define MITSU_HEAVY_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MITSU_HEAVY_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
187 #define VINCENT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
188 #define VINCENT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
189 #define VINCENT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
190 #define VINCENT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
191 #define VINCENT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
192 #define VINCENT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
193 #define VINCENT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
194 #define VINCENT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
195 #define VINCENT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
196 #define VINCENT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * VINCENT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
198 #define PANASONIC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define PANASONIC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define PANASONIC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
201 #define PANASONIC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define PANASONIC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
203 #define PANASONIC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
204 #define PANASONIC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
205 #define PANASONIC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
206 #define PANASONIC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
207 #define PANASONIC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PANASONIC_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
209 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
210 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
211 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
214 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
215 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
217 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
221 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
222 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
223 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
225 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
226 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
229 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
230 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
232 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
233 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
234 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
236 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
237 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
240 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
241 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
243 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
244 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
245 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
246 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
247 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
248 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
249 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
250 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
252 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
253 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
254 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
255 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
256 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
257 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
259 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
260 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
261 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
262 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
263 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
264 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
265 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
266 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
267 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
268 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
270 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
271 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
272 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
273 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
274 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
275 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
276 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
277 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
278 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
279 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
281 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
282 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
283 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
284 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
285 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
286 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
287 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
288 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
289 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
290 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
291 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
292 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
294 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
295 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
296 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
297 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
298 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
299 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
300 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
301 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
302 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
303 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
304 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
305 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
307 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
308 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
309 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
310 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
311 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
312 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
313 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
314 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
315 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
316 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
317 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
318 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
320 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
321 #define BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
322 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
323 #define BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
324 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
325 #define BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
326 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
327 #define BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT2_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
328 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
329 #define BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
330 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
331 #define BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX ((PAUSE_LEN)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT3_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1) // value must be below IRMP_TIMEOUT
332 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
333 #define BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
334 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
335 #define BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_START_BIT4_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
336 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
337 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
338 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
339 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
340 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
341 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
342 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
343 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
344 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
345 #define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
347 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
348 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
349 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
350 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
351 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
352 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
353 #define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
355 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
356 #define SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
357 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
358 #define SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
359 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
360 #define SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
361 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
362 #define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
364 #define FDC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
365 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
366 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
367 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
368 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
369 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
370 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
371 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
373 #define FDC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1) // could be negative: 255
375 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
377 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
379 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
380 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
381 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
382 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
383 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
384 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
385 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
386 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
387 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
388 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
390 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
391 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
392 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MIN_TOLERANCE_40 + 0.5) - 1) // HACK!
393 #define JVC_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (JVC_FRAME_REPEAT_PAUSE_TIME - IRMP_TIMEOUT_TIME) * MAX_TOLERANCE_70 + 0.5) - 1) // HACK!
394 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
395 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
396 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
397 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
398 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
399 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
400 // autodetect JVC repetition frame within 50 msec:
401 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
403 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
404 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
405 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
406 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
407 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
408 #define NIKON_REPEAT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_REPEAT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
409 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
410 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
411 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
412 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
413 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
414 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
415 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
417 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
418 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
419 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
420 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
421 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
422 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
423 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
424 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
425 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
426 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
427 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
428 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
429 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
430 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
432 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
433 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
434 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
435 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
436 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
437 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
438 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
439 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
441 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
442 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
443 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
444 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
445 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
446 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
447 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
448 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
449 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
450 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
452 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
453 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
454 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
455 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
456 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
457 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
458 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
459 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
460 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
461 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
462 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
464 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
465 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
466 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
467 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
468 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
469 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
470 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
471 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
473 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
474 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
475 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
476 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
477 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
478 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
479 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
480 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
482 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
483 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
484 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
485 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
486 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
487 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
488 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
489 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
491 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
492 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
493 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
494 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
495 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
496 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
497 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
498 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
499 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
500 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
501 // autodetect TELEFUNKEN repetition frame within 50 msec:
502 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
504 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
505 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
506 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
507 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
508 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
509 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
510 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
511 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
512 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
513 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
514 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
515 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
516 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
517 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
519 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
520 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
521 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
522 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
523 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
524 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
525 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
526 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
527 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
528 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
529 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
530 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
531 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
532 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
534 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
535 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
536 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
537 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
538 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
539 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
540 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
541 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
542 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
543 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
544 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
545 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
546 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
547 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
549 #define ACP24_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
550 #define ACP24_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
551 #define ACP24_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
552 #define ACP24_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_START_BIT_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
553 #define ACP24_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
554 #define ACP24_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_PULSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
555 #define ACP24_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
556 #define ACP24_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_1_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
557 #define ACP24_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MIN_TOLERANCE_15 + 0.5) - 1)
558 #define ACP24_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ACP24_0_PAUSE_TIME * MAX_TOLERANCE_15 + 0.5) + 1)
560 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
561 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
562 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
563 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
564 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
565 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
566 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
567 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
568 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
569 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
570 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
571 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
572 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
573 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
575 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
578 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
579 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
580 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
581 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
582 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
584 static int time_counter
;
587 /******************************* not every PIC compiler knows variadic macros :-(
589 # define ANALYZE_PUTCHAR(a)
590 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
591 # define ANALYZE_PRINTF(...)
592 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
594 # define ANALYZE_NEWLINE()
595 *********************************/
598 #if IRMP_USE_CALLBACK == 1
599 static void (*irmp_callback_ptr
) (uint_fast8_t);
600 #endif // IRMP_USE_CALLBACK == 1
602 #define PARITY_CHECK_OK 1
603 #define PARITY_CHECK_FAILED 0
605 /*---------------------------------------------------------------------------------------------------------------------------------------------------
607 *---------------------------------------------------------------------------------------------------------------------------------------------------
609 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
610 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
611 static const char proto_sircs
[] PROGMEM
= "SIRCS";
612 static const char proto_nec
[] PROGMEM
= "NEC";
613 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
614 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
615 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
616 static const char proto_recs80
[] PROGMEM
= "RECS80";
617 static const char proto_rc5
[] PROGMEM
= "RC5";
618 static const char proto_denon
[] PROGMEM
= "DENON";
619 static const char proto_rc6
[] PROGMEM
= "RC6";
620 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
621 static const char proto_apple
[] PROGMEM
= "APPLE";
622 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
623 static const char proto_nubert
[] PROGMEM
= "NUBERT";
624 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
625 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
626 static const char proto_nokia
[] PROGMEM
= "NOKIA";
627 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
628 static const char proto_fdc
[] PROGMEM
= "FDC";
629 static const char proto_rccar
[] PROGMEM
= "RCCAR";
630 static const char proto_jvc
[] PROGMEM
= "JVC";
631 static const char proto_rc6a
[] PROGMEM
= "RC6A";
632 static const char proto_nikon
[] PROGMEM
= "NIKON";
633 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
634 static const char proto_ir60
[] PROGMEM
= "IR60";
635 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
636 static const char proto_netbox
[] PROGMEM
= "NETBOX";
637 static const char proto_nec16
[] PROGMEM
= "NEC16";
638 static const char proto_nec42
[] PROGMEM
= "NEC42";
639 static const char proto_lego
[] PROGMEM
= "LEGO";
640 static const char proto_thomson
[] PROGMEM
= "THOMSON";
641 static const char proto_bose
[] PROGMEM
= "BOSE";
642 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
643 static const char proto_ortek
[] PROGMEM
= "ORTEK";
644 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
645 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
646 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
647 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
648 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
649 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
650 static const char proto_lgair
[] PROGMEM
= "LGAIR";
651 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
652 static const char proto_merlin
[] PROGMEM
= "MERLIN";
653 static const char proto_pentax
[] PROGMEM
= "PENTAX";
654 static const char proto_fan
[] PROGMEM
= "FAN";
655 static const char proto_s100
[] PROGMEM
= "S100";
656 static const char proto_acp24
[] PROGMEM
= "ACP24";
657 static const char proto_technics
[] PROGMEM
= "TECHNICS";
658 static const char proto_panasonic
[] PROGMEM
= "PANASONIC";
659 static const char proto_mitsu_heavy
[] PROGMEM
= "MITSU_HEAVY";
660 static const char proto_vincent
[] PROGMEM
= "VINCENT";
661 static const char proto_samsungah
[] PROGMEM
= "SAMSUNGAH";
663 static const char proto_radio1
[] PROGMEM
= "RADIO1";
666 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
725 /*---------------------------------------------------------------------------------------------------------------------------------------------------
727 *---------------------------------------------------------------------------------------------------------------------------------------------------
729 #if IRMP_LOGGING == 1 // logging via UART
731 #if defined(ARM_STM32F4XX)
732 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
733 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
734 # define STM32_GPIO_PORT GPIOA
735 # define STM32_GPIO_PIN GPIO_Pin_2
736 # define STM32_GPIO_SOURCE GPIO_PinSource2
737 # define STM32_UART_AF GPIO_AF_USART2
738 # define STM32_UART_COM USART2
739 # define STM32_UART_BAUD 115200 // 115200 Baud
740 # include "stm32f4xx_usart.h"
741 #elif defined(ARM_STM32F10X)
742 # define STM32_UART_COM USART3 // UART3 on PB10
743 #elif defined(ARDUINO) // Arduino Serial implementation
744 # if defined(USB_SERIAL)
745 # include "usb_serial.h"
747 # error USB_SERIAL not defined in ARDUINO Environment
750 # if IRMP_EXT_LOGGING == 1 // use external logging
751 # include "irmpextlog.h"
752 # else // normal UART log (IRMP_EXT_LOGGING == 0)
754 # ifndef UNIX_OR_WINDOWS
755 # include <util/setbaud.h>
760 #define UART0_UBRRH UBRR0H
761 #define UART0_UBRRL UBRR0L
762 #define UART0_UCSRA UCSR0A
763 #define UART0_UCSRB UCSR0B
764 #define UART0_UCSRC UCSR0C
765 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
766 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
767 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
769 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
771 #define UART0_URSEL_BIT_VALUE (0)
773 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
774 #define UART0_UDR UDR0
775 #define UART0_U2X U2X0
779 #define UART0_UBRRH UBRRH
780 #define UART0_UBRRL UBRRL
781 #define UART0_UCSRA UCSRA
782 #define UART0_UCSRB UCSRB
783 #define UART0_UCSRC UCSRC
784 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
785 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
786 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
788 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
790 #define UART0_URSEL_BIT_VALUE (0)
792 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
793 #define UART0_UDR UDR
794 #define UART0_U2X U2X
797 #endif //IRMP_EXT_LOGGING
798 #endif //ARM_STM32F4XX
800 /*---------------------------------------------------------------------------------------------------------------------------------------------------
802 * @details Initializes UART
803 *---------------------------------------------------------------------------------------------------------------------------------------------------
806 irmp_uart_init (void)
808 #ifndef UNIX_OR_WINDOWS
809 #if defined(ARM_STM32F4XX)
810 GPIO_InitTypeDef GPIO_InitStructure
;
811 USART_InitTypeDef USART_InitStructure
;
813 // Clock enable vom TX Pin
814 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
816 // Clock enable der UART
817 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
819 // UART Alternative-Funktion mit dem IO-Pin verbinden
820 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
822 // UART als Alternative-Funktion mit PushPull
823 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
824 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
825 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
826 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
829 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
830 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
833 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
835 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
836 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
837 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
838 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
839 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
840 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
841 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
842 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
845 USART_Cmd(STM32_UART_COM
, ENABLE
);
847 #elif defined(ARM_STM32F10X)
848 GPIO_InitTypeDef GPIO_InitStructure
;
849 USART_InitTypeDef USART_InitStructure
;
851 // Clock enable vom TX Pin
852 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
854 // Clock enable der UART
855 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
857 // UART als Alternative-Funktion mit PushPull
858 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
859 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
862 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
863 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
866 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
868 // init baud rate, 8 data bits, 1 stop bit, no parity, no RTS+CTS
869 USART_InitStructure
.USART_BaudRate
= 115200;
870 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
871 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
872 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
873 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
874 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
875 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
878 USART_Cmd(STM32_UART_COM
, ENABLE
);
880 #elif defined(ARDUINO)
881 // we use the Arduino Serial Imlementation
882 // you have to call Serial.begin(SER_BAUD); in Arduino setup() function
884 #elif defined (__AVR_XMEGA__)
886 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
888 USARTC1
.BAUDCTRLB
= 0;
889 USARTC1
.BAUDCTRLA
= F_CPU
/ 153600 - 1;
890 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // high INT level (receive)
891 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; // activated RX and TX
892 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; // 8 Bit
893 PORTC
.DIR |= (1<<7); // TXD is output
894 PORTC
.DIR &= ~(1<<6);
898 #if (IRMP_EXT_LOGGING == 0) // use UART
899 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
900 UART0_UBRRL
= UBRRL_VALUE
;
903 UART0_UCSRA
|= (1<<UART0_U2X
);
905 UART0_UCSRA
&= ~(1<<UART0_U2X
);
908 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
909 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
910 #else // other log method
912 #endif //IRMP_EXT_LOGGING
913 #endif //ARM_STM32F4XX
914 #endif // UNIX_OR_WINDOWS
917 /*---------------------------------------------------------------------------------------------------------------------------------------------------
919 * @details Sends character
920 * @param ch character to be transmitted
921 *---------------------------------------------------------------------------------------------------------------------------------------------------
924 irmp_uart_putc (unsigned char ch
)
926 #ifndef UNIX_OR_WINDOWS
927 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
928 // warten bis altes Byte gesendet wurde
929 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
934 USART_SendData(STM32_UART_COM
, ch
);
938 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
939 USART_SendData(STM32_UART_COM
, '\r');
942 #elif defined(ARDUINO)
943 // we use the Arduino Serial Imlementation
944 usb_serial_putchar(ch
);
947 #if (IRMP_EXT_LOGGING == 0)
949 # if defined (__AVR_XMEGA__)
950 while (!(USARTC1
.STATUS
& USART_DREIF_bm
))
958 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
965 # endif // __AVR_XMEGA__
969 sendextlog(ch
); // use external log
971 #endif // IRMP_EXT_LOGGING
972 #endif // ARM_STM32F4XX
975 #endif // UNIX_OR_WINDOWS
978 /*---------------------------------------------------------------------------------------------------------------------------------------------------
980 *---------------------------------------------------------------------------------------------------------------------------------------------------
983 #define STARTCYCLES 2 // min count of zeros before start of logging
984 #define ENDBITS 1000 // number of sequenced highbits to detect end
985 #define DATALEN 700 // log buffer size
988 irmp_log (uint_fast8_t val
)
990 static uint8_t buf
[DATALEN
]; // logging buffer
991 static uint_fast16_t buf_idx
; // index
992 static uint_fast8_t startcycles
; // current number of start-zeros
993 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
994 static uint_fast8_t last_val
= 1;
996 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
1004 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
1006 if (last_val
== val
)
1010 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
1011 { // if stop condition is true, output on uart
1015 uint_fast8_t v
= '1';
1018 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
1020 irmp_uart_putc ('0'); // the ignored starting zeros
1023 for (i
= 0; i
< buf_idx
; i
++)
1032 d
|= ((uint_fast16_t) buf
[i
] << 8);
1035 for (j
= 0; j
< d
; j
++)
1040 v
= (v
== '1') ? '0' : '1';
1043 for (i8
= 0; i8
< 20; i8
++)
1045 irmp_uart_putc ('1');
1048 irmp_uart_putc ('\n');
1054 else if (buf_idx
< DATALEN
- 3)
1058 buf
[buf_idx
++] = 0xff;
1059 buf
[buf_idx
++] = (cnt
& 0xff);
1060 buf
[buf_idx
] = (cnt
>> 8);
1076 #define irmp_log(val)
1077 #endif //IRMP_LOGGING
1081 uint_fast8_t protocol
; // ir protocol
1082 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
1083 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
1084 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
1085 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
1086 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
1087 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
1088 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
1089 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
1090 uint_fast8_t address_offset
; // address offset
1091 uint_fast8_t address_end
; // end of address
1092 uint_fast8_t command_offset
; // command offset
1093 uint_fast8_t command_end
; // end of command
1094 uint_fast8_t complete_len
; // complete length of frame
1095 uint_fast8_t stop_bit
; // flag: frame has stop bit
1096 uint_fast8_t lsb_first
; // flag: LSB first
1097 uint_fast8_t flags
; // some flags
1100 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1102 static const PROGMEM IRMP_PARAMETER sircs_param
=
1104 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1105 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1106 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1107 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1108 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1109 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1110 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1111 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1112 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1113 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1114 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1115 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1116 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1117 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1118 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1119 SIRCS_LSB
, // lsb_first: flag: LSB first
1120 SIRCS_FLAGS
// flags: some flags
1125 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1127 static const PROGMEM IRMP_PARAMETER nec_param
=
1129 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1130 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1131 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1132 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1133 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1134 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1135 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1136 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1137 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1138 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1139 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1140 NEC_COMMAND_OFFSET
, // command_offset: command offset
1141 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1142 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1143 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1144 NEC_LSB
, // lsb_first: flag: LSB first
1145 NEC_FLAGS
// flags: some flags
1148 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1150 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1151 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1152 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1153 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1154 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1155 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1156 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1157 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1158 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1159 0, // address_offset: address offset
1160 0, // address_end: end of address
1161 0, // command_offset: command offset
1162 0, // command_end: end of command
1163 0, // complete_len: complete length of frame
1164 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1165 NEC_LSB
, // lsb_first: flag: LSB first
1166 NEC_FLAGS
// flags: some flags
1171 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1173 static const PROGMEM IRMP_PARAMETER nec42_param
=
1175 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1176 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1177 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1178 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1179 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1180 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1181 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1182 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1183 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1184 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1185 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1186 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1187 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1188 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1189 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1190 NEC_LSB
, // lsb_first: flag: LSB first
1191 NEC_FLAGS
// flags: some flags
1196 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1198 static const PROGMEM IRMP_PARAMETER lgair_param
=
1200 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1201 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1202 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1203 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1204 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1205 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1206 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1207 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1208 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1209 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1210 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1211 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1212 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1213 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1214 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1215 NEC_LSB
, // lsb_first: flag: LSB first
1216 NEC_FLAGS
// flags: some flags
1221 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1223 static const PROGMEM IRMP_PARAMETER samsung_param
=
1225 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1226 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1227 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1228 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1229 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1230 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1231 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1232 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1233 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1234 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1235 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1236 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1237 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1238 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1239 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1240 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1241 SAMSUNG_FLAGS
// flags: some flags
1246 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
1248 static const PROGMEM IRMP_PARAMETER samsungah_param
=
1250 IRMP_SAMSUNGAH_PROTOCOL
, // protocol: ir protocol
1251 SAMSUNGAH_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1252 SAMSUNGAH_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1253 SAMSUNGAH_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1254 SAMSUNGAH_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1255 SAMSUNGAH_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1256 SAMSUNGAH_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1257 SAMSUNGAH_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1258 SAMSUNGAH_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1259 SAMSUNGAH_ADDRESS_OFFSET
, // address_offset: address offset
1260 SAMSUNGAH_ADDRESS_OFFSET
+ SAMSUNGAH_ADDRESS_LEN
, // address_end: end of address
1261 SAMSUNGAH_COMMAND_OFFSET
, // command_offset: command offset
1262 SAMSUNGAH_COMMAND_OFFSET
+ SAMSUNGAH_COMMAND_LEN
, // command_end: end of command
1263 SAMSUNGAH_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1264 SAMSUNGAH_STOP_BIT
, // stop_bit: flag: frame has stop bit
1265 SAMSUNGAH_LSB
, // lsb_first: flag: LSB first
1266 SAMSUNGAH_FLAGS
// flags: some flags
1271 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1273 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1275 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1276 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1277 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1278 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1279 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1280 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1281 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1282 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1283 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1284 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1285 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1286 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1287 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1288 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1289 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1290 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1291 TELEFUNKEN_FLAGS
// flags: some flags
1296 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1298 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1300 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1301 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1302 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1303 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1304 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1305 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1306 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1307 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1308 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1309 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1310 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1311 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1312 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1313 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1314 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1315 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1316 MATSUSHITA_FLAGS
// flags: some flags
1321 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1323 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1325 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1326 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1327 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1328 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1329 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1330 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1331 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1332 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1333 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1334 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1335 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1336 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1337 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1338 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1339 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1340 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1341 KASEIKYO_FLAGS
// flags: some flags
1346 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
1348 static const PROGMEM IRMP_PARAMETER panasonic_param
=
1350 IRMP_PANASONIC_PROTOCOL
, // protocol: ir protocol
1351 PANASONIC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1352 PANASONIC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1353 PANASONIC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1354 PANASONIC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1355 PANASONIC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1356 PANASONIC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1357 PANASONIC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1358 PANASONIC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1359 PANASONIC_ADDRESS_OFFSET
, // address_offset: address offset
1360 PANASONIC_ADDRESS_OFFSET
+ PANASONIC_ADDRESS_LEN
, // address_end: end of address
1361 PANASONIC_COMMAND_OFFSET
, // command_offset: command offset
1362 PANASONIC_COMMAND_OFFSET
+ PANASONIC_COMMAND_LEN
, // command_end: end of command
1363 PANASONIC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1364 PANASONIC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1365 PANASONIC_LSB
, // lsb_first: flag: LSB first
1366 PANASONIC_FLAGS
// flags: some flags
1371 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
1373 static const PROGMEM IRMP_PARAMETER mitsu_heavy_param
=
1375 IRMP_MITSU_HEAVY_PROTOCOL
, // protocol: ir protocol
1376 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1377 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1378 MITSU_HEAVY_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1379 MITSU_HEAVY_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1380 MITSU_HEAVY_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1381 MITSU_HEAVY_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1382 MITSU_HEAVY_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1383 MITSU_HEAVY_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1384 MITSU_HEAVY_ADDRESS_OFFSET
, // address_offset: address offset
1385 MITSU_HEAVY_ADDRESS_OFFSET
+ MITSU_HEAVY_ADDRESS_LEN
, // address_end: end of address
1386 MITSU_HEAVY_COMMAND_OFFSET
, // command_offset: command offset
1387 MITSU_HEAVY_COMMAND_OFFSET
+ MITSU_HEAVY_COMMAND_LEN
, // command_end: end of command
1388 MITSU_HEAVY_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1389 MITSU_HEAVY_STOP_BIT
, // stop_bit: flag: frame has stop bit
1390 MITSU_HEAVY_LSB
, // lsb_first: flag: LSB first
1391 MITSU_HEAVY_FLAGS
// flags: some flags
1396 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
1398 static const PROGMEM IRMP_PARAMETER vincent_param
=
1400 IRMP_VINCENT_PROTOCOL
, // protocol: ir protocol
1401 VINCENT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1402 VINCENT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1403 VINCENT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1404 VINCENT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1405 VINCENT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1406 VINCENT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1407 VINCENT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1408 VINCENT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1409 VINCENT_ADDRESS_OFFSET
, // address_offset: address offset
1410 VINCENT_ADDRESS_OFFSET
+ VINCENT_ADDRESS_LEN
, // address_end: end of address
1411 VINCENT_COMMAND_OFFSET
, // command_offset: command offset
1412 VINCENT_COMMAND_OFFSET
+ VINCENT_COMMAND_LEN
, // command_end: end of command
1413 VINCENT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1414 VINCENT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1415 VINCENT_LSB
, // lsb_first: flag: LSB first
1416 VINCENT_FLAGS
// flags: some flags
1421 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1423 static const PROGMEM IRMP_PARAMETER recs80_param
=
1425 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1426 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1427 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1428 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1429 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1430 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1431 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1432 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1433 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1434 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1435 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1436 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1437 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1438 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1439 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1440 RECS80_LSB
, // lsb_first: flag: LSB first
1441 RECS80_FLAGS
// flags: some flags
1446 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1448 static const PROGMEM IRMP_PARAMETER rc5_param
=
1450 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1451 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1452 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1453 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1454 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1455 0, // pulse_0_len_min: here: not used
1456 0, // pulse_0_len_max: here: not used
1457 0, // pause_0_len_min: here: not used
1458 0, // pause_0_len_max: here: not used
1459 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1460 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1461 RC5_COMMAND_OFFSET
, // command_offset: command offset
1462 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1463 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1464 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1465 RC5_LSB
, // lsb_first: flag: LSB first
1466 RC5_FLAGS
// flags: some flags
1471 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1473 static const PROGMEM IRMP_PARAMETER s100_param
=
1475 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1476 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1477 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1478 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1479 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1480 0, // pulse_0_len_min: here: not used
1481 0, // pulse_0_len_max: here: not used
1482 0, // pause_0_len_min: here: not used
1483 0, // pause_0_len_max: here: not used
1484 S100_ADDRESS_OFFSET
, // address_offset: address offset
1485 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1486 S100_COMMAND_OFFSET
, // command_offset: command offset
1487 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1488 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1489 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1490 S100_LSB
, // lsb_first: flag: LSB first
1491 S100_FLAGS
// flags: some flags
1496 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1498 static const PROGMEM IRMP_PARAMETER denon_param
=
1500 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1501 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1502 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1503 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1504 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1505 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1506 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1507 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1508 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1509 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1510 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1511 DENON_COMMAND_OFFSET
, // command_offset: command offset
1512 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1513 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1514 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1515 DENON_LSB
, // lsb_first: flag: LSB first
1516 DENON_FLAGS
// flags: some flags
1521 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1523 static const PROGMEM IRMP_PARAMETER rc6_param
=
1525 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1527 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1528 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1529 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1530 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1531 0, // pulse_0_len_min: here: not used
1532 0, // pulse_0_len_max: here: not used
1533 0, // pause_0_len_min: here: not used
1534 0, // pause_0_len_max: here: not used
1535 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1536 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1537 RC6_COMMAND_OFFSET
, // command_offset: command offset
1538 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1539 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1540 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1541 RC6_LSB
, // lsb_first: flag: LSB first
1542 RC6_FLAGS
// flags: some flags
1547 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1549 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1551 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1552 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1553 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1554 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1555 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1556 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1557 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1558 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1559 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1560 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1561 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1562 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1563 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1564 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1565 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1566 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1567 RECS80EXT_FLAGS
// flags: some flags
1572 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1574 static const PROGMEM IRMP_PARAMETER nubert_param
=
1576 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1577 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1578 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1579 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1580 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1581 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1582 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1583 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1584 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1585 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1586 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1587 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1588 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1589 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1590 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1591 NUBERT_LSB
, // lsb_first: flag: LSB first
1592 NUBERT_FLAGS
// flags: some flags
1597 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1599 static const PROGMEM IRMP_PARAMETER fan_param
=
1601 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1602 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1603 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1604 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1605 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1606 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1607 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1608 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1609 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1610 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1611 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1612 FAN_COMMAND_OFFSET
, // command_offset: command offset
1613 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1614 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1615 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1616 FAN_LSB
, // lsb_first: flag: LSB first
1617 FAN_FLAGS
// flags: some flags
1622 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1624 static const PROGMEM IRMP_PARAMETER speaker_param
=
1626 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1627 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1628 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1629 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1630 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1631 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1632 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1633 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1634 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1635 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1636 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1637 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1638 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1639 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1640 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1641 SPEAKER_LSB
, // lsb_first: flag: LSB first
1642 SPEAKER_FLAGS
// flags: some flags
1647 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1649 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1651 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1652 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1653 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1654 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1655 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1656 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1657 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1658 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1659 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1660 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1661 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1662 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1663 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1664 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1665 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1666 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1667 BANG_OLUFSEN_FLAGS
// flags: some flags
1672 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1674 static uint_fast8_t first_bit
;
1676 static const PROGMEM IRMP_PARAMETER grundig_param
=
1678 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1680 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1681 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1682 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1683 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1684 0, // pulse_0_len_min: here: not used
1685 0, // pulse_0_len_max: here: not used
1686 0, // pause_0_len_min: here: not used
1687 0, // pause_0_len_max: here: not used
1688 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1689 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1690 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1691 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1692 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1693 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1694 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1695 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1700 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1702 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1704 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1705 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1706 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1707 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1708 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1709 0, // pulse_0_len_min: here: not used
1710 0, // pulse_0_len_max: here: not used
1711 0, // pause_0_len_min: here: not used
1712 0, // pause_0_len_max: here: not used
1713 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1714 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1715 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1716 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1717 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1718 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1719 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1720 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1725 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1727 static const PROGMEM IRMP_PARAMETER fdc_param
=
1729 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1730 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1731 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1732 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1733 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1734 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1735 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1736 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1737 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1738 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1739 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1740 FDC_COMMAND_OFFSET
, // command_offset: command offset
1741 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1742 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1743 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1744 FDC_LSB
, // lsb_first: flag: LSB first
1745 FDC_FLAGS
// flags: some flags
1750 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1752 static const PROGMEM IRMP_PARAMETER rccar_param
=
1754 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1755 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1756 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1757 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1758 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1759 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1760 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1761 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1762 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1763 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1764 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1765 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1766 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1767 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1768 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1769 RCCAR_LSB
, // lsb_first: flag: LSB first
1770 RCCAR_FLAGS
// flags: some flags
1775 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1777 static const PROGMEM IRMP_PARAMETER nikon_param
=
1779 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1780 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1781 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1782 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1783 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1784 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1785 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1786 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1787 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1788 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1789 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1790 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1791 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1792 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1793 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1794 NIKON_LSB
, // lsb_first: flag: LSB first
1795 NIKON_FLAGS
// flags: some flags
1800 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1802 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1804 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1805 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1806 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1807 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1808 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1809 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1810 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1811 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1812 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1813 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1814 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1815 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1816 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1817 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1818 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1819 KATHREIN_LSB
, // lsb_first: flag: LSB first
1820 KATHREIN_FLAGS
// flags: some flags
1825 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1827 static const PROGMEM IRMP_PARAMETER netbox_param
=
1829 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1830 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1831 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1832 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1833 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1834 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1835 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1836 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1837 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1838 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1839 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1840 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1841 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1842 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1843 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1844 NETBOX_LSB
, // lsb_first: flag: LSB first
1845 NETBOX_FLAGS
// flags: some flags
1850 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1852 static const PROGMEM IRMP_PARAMETER lego_param
=
1854 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1855 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1856 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1857 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1858 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1859 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1860 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1861 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1862 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1863 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1864 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1865 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1866 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1867 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1868 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1869 LEGO_LSB
, // lsb_first: flag: LSB first
1870 LEGO_FLAGS
// flags: some flags
1875 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1877 static const PROGMEM IRMP_PARAMETER thomson_param
=
1879 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1880 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1881 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1882 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1883 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1884 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1885 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1886 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1887 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1888 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1889 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1890 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1891 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1892 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1893 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1894 THOMSON_LSB
, // lsb_first: flag: LSB first
1895 THOMSON_FLAGS
// flags: some flags
1900 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1902 static const PROGMEM IRMP_PARAMETER bose_param
=
1904 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1905 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1906 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1907 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1908 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1909 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1910 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1911 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1912 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1913 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1914 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1915 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1916 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1917 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1918 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1919 BOSE_LSB
, // lsb_first: flag: LSB first
1920 BOSE_FLAGS
// flags: some flags
1925 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1927 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1929 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1931 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1932 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1933 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1934 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1935 0, // pulse_0_len_min: here: not used
1936 0, // pulse_0_len_max: here: not used
1937 0, // pause_0_len_min: here: not used
1938 0, // pause_0_len_max: here: not used
1939 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1940 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1941 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1942 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1943 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1944 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1945 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1946 A1TVBOX_FLAGS
// flags: some flags
1951 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1953 static const PROGMEM IRMP_PARAMETER merlin_param
=
1955 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1957 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1958 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1959 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1960 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1961 0, // pulse_0_len_min: here: not used
1962 0, // pulse_0_len_max: here: not used
1963 0, // pause_0_len_min: here: not used
1964 0, // pause_0_len_max: here: not used
1965 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1966 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1967 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1968 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
1969 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1970 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1971 MERLIN_LSB
, // lsb_first: flag: LSB first
1972 MERLIN_FLAGS
// flags: some flags
1977 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1979 static const PROGMEM IRMP_PARAMETER ortek_param
=
1981 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1983 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1984 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1985 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1986 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1987 0, // pulse_0_len_min: here: not used
1988 0, // pulse_0_len_max: here: not used
1989 0, // pause_0_len_min: here: not used
1990 0, // pause_0_len_max: here: not used
1991 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1992 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1993 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1994 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1995 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1996 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1997 ORTEK_LSB
, // lsb_first: flag: LSB first
1998 ORTEK_FLAGS
// flags: some flags
2003 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2005 static const PROGMEM IRMP_PARAMETER roomba_param
=
2007 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
2008 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2009 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2010 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2011 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2012 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2013 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2014 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2015 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2016 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
2017 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
2018 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
2019 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
2020 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2021 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
2022 ROOMBA_LSB
, // lsb_first: flag: LSB first
2023 ROOMBA_FLAGS
// flags: some flags
2028 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
2030 static const PROGMEM IRMP_PARAMETER rcmm_param
=
2032 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
2034 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
2035 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
2036 0, // pause_1_len_min: here: minimum length of short pause
2037 0, // pause_1_len_max: here: maximum length of short pause
2038 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
2039 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
2040 0, // pause_0_len_min: here: not used
2041 0, // pause_0_len_max: here: not used
2042 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
2043 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
2044 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
2045 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
2046 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2047 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
2048 RCMM32_LSB
, // lsb_first: flag: LSB first
2049 RCMM32_FLAGS
// flags: some flags
2054 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2056 static const PROGMEM IRMP_PARAMETER pentax_param
=
2058 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
2059 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2060 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2061 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2062 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2063 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2064 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2065 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2066 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2067 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
2068 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
2069 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
2070 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
2071 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2072 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
2073 PENTAX_LSB
, // lsb_first: flag: LSB first
2074 PENTAX_FLAGS
// flags: some flags
2079 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2081 static const PROGMEM IRMP_PARAMETER acp24_param
=
2083 IRMP_ACP24_PROTOCOL
, // protocol: ir protocol
2084 ACP24_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2085 ACP24_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2086 ACP24_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2087 ACP24_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2088 ACP24_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2089 ACP24_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2090 ACP24_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2091 ACP24_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2092 ACP24_ADDRESS_OFFSET
, // address_offset: address offset
2093 ACP24_ADDRESS_OFFSET
+ ACP24_ADDRESS_LEN
, // address_end: end of address
2094 ACP24_COMMAND_OFFSET
, // command_offset: command offset
2095 ACP24_COMMAND_OFFSET
+ ACP24_COMMAND_LEN
, // command_end: end of command
2096 ACP24_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2097 ACP24_STOP_BIT
, // stop_bit: flag: frame has stop bit
2098 ACP24_LSB
, // lsb_first: flag: LSB first
2099 ACP24_FLAGS
// flags: some flags
2104 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2106 static const PROGMEM IRMP_PARAMETER radio1_param
=
2108 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
2110 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
2111 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
2112 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
2113 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
2114 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
2115 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
2116 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
2117 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
2118 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
2119 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
2120 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
2121 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
2122 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
2123 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
2124 RADIO1_LSB
, // lsb_first: flag: LSB first
2125 RADIO1_FLAGS
// flags: some flags
2130 static uint_fast8_t irmp_bit
; // current bit position
2131 static IRMP_PARAMETER irmp_param
;
2133 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2134 static IRMP_PARAMETER irmp_param2
;
2137 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
2138 static volatile uint_fast8_t irmp_protocol
;
2139 static volatile uint_fast16_t irmp_address
;
2140 static volatile uint_fast16_t irmp_command
;
2141 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
2142 static volatile uint_fast8_t irmp_flags
;
2143 // static volatile uint_fast8_t irmp_busy_flag;
2145 #if defined(__MBED__)
2146 // DigitalIn inputPin(IRMP_PIN, PullUp); // this requires mbed.h and source to be compiled as cpp
2147 gpio_t gpioIRin
; // use low level c function instead
2152 #define input(x) (x)
2153 static uint_fast8_t IRMP_PIN
;
2154 static uint_fast8_t radio
;
2157 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2158 * Initialize IRMP decoder
2159 * @details Configures IRMP input pin
2160 *---------------------------------------------------------------------------------------------------------------------------------------------------
2166 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
2167 #elif defined (ARM_STM32) // STM32
2168 GPIO_InitTypeDef GPIO_InitStructure
;
2170 /* GPIOx clock enable */
2171 # if defined (ARM_STM32L1XX)
2172 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2173 # elif defined (ARM_STM32F10X)
2174 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2175 # elif defined (ARM_STM32F4XX)
2176 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
2179 /* GPIO Configuration */
2180 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
2181 # if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
2182 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
2183 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2184 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
2185 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
2186 # elif defined (ARM_STM32F10X)
2187 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
2188 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
2190 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
2192 #elif defined (ARM_OPENCM3) // STM32 with libopencm3
2194 /* GPIOx clock enable */
2195 rcc_periph_clock_enable(IRMP_PORT_RCC
);
2197 /* GPIO Configuration */
2198 gpio_set_mode(IRMP_PORT
, GPIO_MODE_INPUT
,
2199 GPIO_CNF_INPUT_FLOAT
, 1<<IRMP_BIT
);
2201 #elif defined(STELLARIS_ARM_CORTEX_M4)
2202 // Enable the GPIO port
2203 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
2206 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
2207 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_STRENGTH_2MA
, GPIO_PIN_TYPE_STD_WPU
);
2209 #elif defined(__SDCC_stm8) // STM8
2210 IRMP_GPIO_STRUCT
->DDR
&= ~(1<<IRMP_BIT
); // pin is input
2211 IRMP_GPIO_STRUCT
->CR1
|= (1<<IRMP_BIT
); // activate pullup
2213 #elif defined (TEENSY_ARM_CORTEX_M4) // TEENSY
2214 pinMode(IRMP_PIN
, INPUT
);
2216 #elif defined(__xtensa__) // ESP8266
2217 pinMode(IRMP_BIT_NUMBER
, INPUT
);
2218 // select pin function
2219 # if (IRMP_BIT_NUMBER == 12)
2220 PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U
, FUNC_GPIO12
);
2221 // doesn't work for me:
2222 // # elif (IRMP_BIT_NUMBER == 13)
2223 // PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U , FUNC_GPIO13);
2225 # warning Please add PIN_FUNC_SELECT when necessary.
2227 GPIO_DIS_OUTPUT(IRMP_BIT_NUMBER
);
2229 #elif defined(__MBED__)
2230 gpio_init_in_ex(&gpioIRin
, IRMP_PIN
, IRMP_PINMODE
); // initialize input for IR diode
2233 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
2234 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
2237 #if IRMP_LOGGING == 1
2242 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2244 * @details gets decoded IRMP data
2245 * @param pointer in order to store IRMP data
2246 * @return TRUE: successful, FALSE: failed
2247 *---------------------------------------------------------------------------------------------------------------------------------------------------
2250 irmp_get_data (IRMP_DATA
* irmp_data_p
)
2252 uint_fast8_t rtc
= FALSE
;
2254 if (irmp_ir_detected
)
2256 switch (irmp_protocol
)
2258 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2259 case IRMP_SAMSUNG_PROTOCOL
:
2260 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2262 irmp_command
&= 0xff;
2263 irmp_command
|= irmp_id
<< 8;
2268 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2269 case IRMP_SAMSUNG48_PROTOCOL
:
2270 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2276 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2277 case IRMP_NEC_PROTOCOL
:
2278 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2280 irmp_command
&= 0xff;
2283 else if (irmp_address
== 0x87EE)
2286 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2288 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2289 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2290 irmp_command
&= 0x00FF;
2297 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2298 case IRMP_VINCENT_PROTOCOL
:
2299 if ((irmp_command
>> 8) == (irmp_command
& 0x00FF))
2301 irmp_command
&= 0xff;
2307 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2308 case IRMP_BOSE_PROTOCOL
:
2309 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2311 irmp_command
&= 0xff;
2316 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2317 case IRMP_SIEMENS_PROTOCOL
:
2318 case IRMP_RUWIDO_PROTOCOL
:
2319 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2326 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2327 case IRMP_KATHREIN_PROTOCOL
:
2328 if (irmp_command
!= 0x0000)
2334 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2335 case IRMP_RC5_PROTOCOL
:
2336 irmp_address
&= ~0x20; // clear toggle bit
2340 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2341 case IRMP_S100_PROTOCOL
:
2342 irmp_address
&= ~0x20; // clear toggle bit
2346 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2347 case IRMP_IR60_PROTOCOL
:
2348 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2355 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2360 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2361 case IRMP_RCCAR_PROTOCOL
:
2362 // frame in irmp_data:
2363 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2364 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2365 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2366 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2367 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2368 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2369 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2373 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2374 case IRMP_NETBOX_PROTOCOL
:
2375 if (irmp_command
& 0x1000) // last bit set?
2377 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2380 irmp_command
&= 0x7F;
2383 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2386 irmp_command
|= 0x80;
2392 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2399 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2404 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2405 case IRMP_LEGO_PROTOCOL
:
2407 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2409 if ((irmp_command
& 0x000F) == crc
)
2417 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2419 // rtc = TRUE; // don't accept codes with CRC errors
2434 irmp_data_p
->protocol
= irmp_protocol
;
2435 irmp_data_p
->address
= irmp_address
;
2436 irmp_data_p
->command
= irmp_command
;
2437 irmp_data_p
->flags
= irmp_flags
;
2443 irmp_ir_detected
= FALSE
;
2449 #if IRMP_USE_CALLBACK == 1
2451 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2453 irmp_callback_ptr
= cb
;
2455 #endif // IRMP_USE_CALLBACK == 1
2457 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2458 static uint_fast16_t irmp_tmp_address
; // ir address
2459 static uint_fast16_t irmp_tmp_command
; // ir command
2461 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2462 static uint_fast16_t irmp_tmp_address2
; // ir address
2463 static uint_fast16_t irmp_tmp_command2
; // ir command
2466 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2467 static uint_fast16_t irmp_lgair_address
; // ir address
2468 static uint_fast16_t irmp_lgair_command
; // ir command
2471 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2472 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2474 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2475 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2476 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2479 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2480 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2483 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2484 static uint_fast8_t check
; // number of '1' of the first 14 bits, check if even.
2485 static uint_fast8_t mitsu_parity
; // number of '1' of the first 14 bits, check if even.
2488 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2490 * @details store bit in temp address or temp command
2491 * @param value to store: 0 or 1
2492 *---------------------------------------------------------------------------------------------------------------------------------------------------
2494 // verhindert, dass irmp_store_bit() inline compiliert wird:
2495 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2498 irmp_store_bit (uint_fast8_t value
)
2500 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
2501 if (irmp_param
.protocol
== IRMP_ACP24_PROTOCOL
) // squeeze 64 bits into 16 bits:
2507 // 0123456789012345678901234567890123456789012345678901234567890123456789
2508 // N VVMMM ? ??? t vmA x y TTTT
2510 // irmp_data_p->command:
2517 case 0: irmp_tmp_command
|= (1<<15); break; // N
2518 case 2: irmp_tmp_command
|= (1<<13); break; // V
2519 case 3: irmp_tmp_command
|= (1<<12); break; // V
2520 case 4: irmp_tmp_command
|= (1<<10); break; // M
2521 case 5: irmp_tmp_command
|= (1<< 9); break; // M
2522 case 6: irmp_tmp_command
|= (1<< 8); break; // M
2523 case 20: irmp_tmp_command
|= (1<< 6); break; // t
2524 case 22: irmp_tmp_command
|= (1<<11); break; // v
2525 case 23: irmp_tmp_command
|= (1<< 7); break; // m
2526 case 24: irmp_tmp_command
|= (1<<14); break; // A
2527 case 26: irmp_tmp_command
|= (1<< 5); break; // x
2528 case 44: irmp_tmp_command
|= (1<< 4); break; // y
2529 case 66: irmp_tmp_command
|= (1<< 3); break; // T
2530 case 67: irmp_tmp_command
|= (1<< 2); break; // T
2531 case 68: irmp_tmp_command
|= (1<< 1); break; // T
2532 case 69: irmp_tmp_command
|= (1<< 0); break; // T
2537 #endif // IRMP_SUPPORT_ACP24_PROTOCOL
2539 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2540 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2549 else if (irmp_bit
== 14)
2551 if (value
) // value == 1: even parity
2555 parity
= PARITY_CHECK_FAILED
;
2559 parity
= PARITY_CHECK_OK
;
2564 if (parity
& 0x01) // value == 0: odd parity
2566 parity
= PARITY_CHECK_OK
;
2570 parity
= PARITY_CHECK_FAILED
;
2581 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2582 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2589 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2591 if (irmp_param
.lsb_first
)
2593 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2597 irmp_tmp_address
<<= 1;
2598 irmp_tmp_address
|= value
;
2601 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2603 if (irmp_param
.lsb_first
)
2605 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2606 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2608 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2613 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2618 irmp_tmp_command
<<= 1;
2619 irmp_tmp_command
|= value
;
2623 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2624 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2628 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2629 irmp_lgair_address
|= value
;
2631 else if (irmp_bit
< 24)
2633 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2634 irmp_lgair_command
|= value
;
2640 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2641 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2643 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2648 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2649 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2651 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2656 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2657 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2659 if (irmp_bit
>= 20 && irmp_bit
< 24)
2661 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2663 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2665 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2668 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2672 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2676 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2683 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
2684 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
) // squeeze 64 bits into 16 bits:
2686 if (irmp_bit
== 72 )
2687 { // irmp_tmp_address, irmp_tmp_command received: check parity & compress
2688 mitsu_parity
= PARITY_CHECK_OK
;
2690 check
= irmp_tmp_address
>> 8; // inverted upper byte == lower byte?
2693 if (check
== (irmp_tmp_address
& 0xFF))
2695 irmp_tmp_address
<<= 8; // throw away upper byte
2699 mitsu_parity
= PARITY_CHECK_FAILED
;
2702 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
2704 if (check
== (irmp_tmp_command
& 0xFF))
2705 { // ok: pack together
2706 irmp_tmp_address
|= irmp_tmp_command
& 0xFF; // byte 1, byte2 in irmp_tmp_address, irmp_tmp_command can be used for byte 3
2710 mitsu_parity
= PARITY_CHECK_FAILED
;
2712 irmp_tmp_command
= 0;
2715 if (irmp_bit
>= 72 )
2716 { // receive 3. word in irmp_tmp_command
2717 irmp_tmp_command
<<= 1;
2718 irmp_tmp_command
|= value
;
2722 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
2730 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2732 * @details store bit in temp address or temp command
2733 * @param value to store: 0 or 1
2734 *---------------------------------------------------------------------------------------------------------------------------------------------------
2736 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2738 irmp_store_bit2 (uint_fast8_t value
)
2740 uint_fast8_t irmp_bit2
;
2742 if (irmp_param
.protocol
)
2744 irmp_bit2
= irmp_bit
- 2;
2748 irmp_bit2
= irmp_bit
- 1;
2751 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2753 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2755 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2757 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2760 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2762 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2764 * @details ISR routine, called 10000 times per second
2765 *---------------------------------------------------------------------------------------------------------------------------------------------------
2770 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2771 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2772 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2773 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2774 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2775 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2776 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2777 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2778 static uint_fast8_t repetition_frame_number
;
2779 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2780 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2781 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2783 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2784 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2786 #if IRMP_SUPPORT_MANCHESTER == 1
2787 static PAUSE_LEN last_pause
; // last pause value
2789 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2790 static uint_fast8_t last_value
; // last bit value
2792 uint_fast8_t irmp_input
; // input value
2798 #if defined(__SDCC_stm8)
2799 irmp_input
= input(IRMP_GPIO_STRUCT
->IDR
)
2800 #elif defined(__MBED__)
2801 //irmp_input = inputPin;
2802 irmp_input
= gpio_read (&gpioIRin
);
2804 irmp_input
= input(IRMP_PIN
);
2807 #if IRMP_USE_CALLBACK == 1
2808 if (irmp_callback_ptr
)
2810 static uint_fast8_t last_inverted_input
;
2812 if (last_inverted_input
!= !irmp_input
)
2814 (*irmp_callback_ptr
) (! irmp_input
);
2815 last_inverted_input
= !irmp_input
;
2818 #endif // IRMP_USE_CALLBACK == 1
2820 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2822 if (! irmp_ir_detected
) // ir code already detected?
2824 if (! irmp_start_bit_detected
) // start bit detected?
2826 if (! irmp_input
) // receiving burst?
2828 // irmp_busy_flag = TRUE;
2830 if (! irmp_pulse_time
)
2832 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2835 irmp_pulse_time
++; // increment counter
2839 if (irmp_pulse_time
) // it's dark....
2840 { // set flags for counting the time of darkness...
2841 irmp_start_bit_detected
= 1;
2842 wait_for_start_space
= 1;
2844 irmp_tmp_command
= 0;
2845 irmp_tmp_address
= 0;
2846 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2849 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2853 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2854 irmp_tmp_command2
= 0;
2855 irmp_tmp_address2
= 0;
2857 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2858 irmp_lgair_command
= 0;
2859 irmp_lgair_address
= 0;
2862 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2863 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2864 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2869 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2871 key_repetition_len
++;
2873 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2874 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2876 denon_repetition_len
++;
2878 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2881 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2882 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2884 last_irmp_denon_command
= 0;
2885 denon_repetition_len
= 0xFFFF;
2888 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2895 if (wait_for_start_space
) // we have received start bit...
2896 { // ...and are counting the time of darkness
2897 if (irmp_input
) // still dark?
2899 irmp_pause_time
++; // increment counter
2901 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2902 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
) ||
2903 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2905 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2908 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2909 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2914 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2917 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
);
2918 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2922 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2923 irmp_pulse_time
= 0;
2924 irmp_pause_time
= 0;
2928 { // receiving first data pulse!
2929 IRMP_PARAMETER
* irmp_param_p
;
2930 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2932 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2933 irmp_param2
.protocol
= 0;
2937 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2940 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2941 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2942 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2945 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2946 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2947 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2949 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2952 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2954 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2955 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2956 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2957 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2960 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2961 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2962 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2964 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2967 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2969 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2970 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2971 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2973 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2975 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2976 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2977 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2979 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2982 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2983 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2984 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2986 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2989 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2990 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2992 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2993 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2994 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2996 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2997 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2998 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
3000 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
3003 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3006 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3007 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3008 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
3011 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
3016 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3017 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
3018 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
3019 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
3020 { // it's JVC repetition type 3
3022 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3023 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
3024 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
3026 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
3029 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3031 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3033 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3034 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
3035 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
3038 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3039 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
3040 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
3042 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
3045 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
3047 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3048 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
3049 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
3052 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3053 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
3054 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
3056 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
3059 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3061 #if IRMP_SUPPORT_ACP24_PROTOCOL == 1
3062 if (irmp_pulse_time
>= ACP24_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ACP24_START_BIT_PULSE_LEN_MAX
&&
3063 irmp_pause_time
>= ACP24_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ACP24_START_BIT_PAUSE_LEN_MAX
)
3066 ANALYZE_PRINTF ("protocol = ACP24, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3067 ACP24_START_BIT_PULSE_LEN_MIN
, ACP24_START_BIT_PULSE_LEN_MAX
,
3068 ACP24_START_BIT_PAUSE_LEN_MIN
, ACP24_START_BIT_PAUSE_LEN_MAX
);
3070 irmp_param_p
= (IRMP_PARAMETER
*) &acp24_param
;
3073 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3075 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3076 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
3077 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
3080 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3081 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
3082 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
3084 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
3087 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
3089 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
3090 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
3091 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
3094 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3095 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
3096 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
3098 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
3101 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
3103 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3104 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
3105 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
3108 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3109 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
3110 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
3112 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
3115 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3117 #if IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3118 if (irmp_pulse_time
>= SAMSUNGAH_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNGAH_START_BIT_PULSE_LEN_MAX
&&
3119 irmp_pause_time
>= SAMSUNGAH_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNGAH_START_BIT_PAUSE_LEN_MAX
)
3122 ANALYZE_PRINTF ("protocol = SAMSUNGAH, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3123 SAMSUNGAH_START_BIT_PULSE_LEN_MIN
, SAMSUNGAH_START_BIT_PULSE_LEN_MAX
,
3124 SAMSUNGAH_START_BIT_PAUSE_LEN_MIN
, SAMSUNGAH_START_BIT_PAUSE_LEN_MAX
);
3126 irmp_param_p
= (IRMP_PARAMETER
*) &samsungah_param
;
3129 #endif // IRMP_SUPPORT_SAMSUNGAH_PROTOCOL == 1
3131 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3132 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
3133 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
3134 { // it's MATSUSHITA
3136 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3137 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
3138 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
3140 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
3143 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
3145 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3146 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
3147 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
3150 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3151 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
3152 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
3154 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
3157 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
3159 #if IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3160 if (irmp_pulse_time
>= PANASONIC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PANASONIC_START_BIT_PULSE_LEN_MAX
&&
3161 irmp_pause_time
>= PANASONIC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PANASONIC_START_BIT_PAUSE_LEN_MAX
)
3164 ANALYZE_PRINTF ("protocol = PANASONIC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3165 PANASONIC_START_BIT_PULSE_LEN_MIN
, PANASONIC_START_BIT_PULSE_LEN_MAX
,
3166 PANASONIC_START_BIT_PAUSE_LEN_MIN
, PANASONIC_START_BIT_PAUSE_LEN_MAX
);
3168 irmp_param_p
= (IRMP_PARAMETER
*) &panasonic_param
;
3171 #endif // IRMP_SUPPORT_PANASONIC_PROTOCOL == 1
3173 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3174 if (irmp_pulse_time
>= MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
&&
3175 irmp_pause_time
>= MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
)
3176 { // it's MITSU_HEAVY
3178 ANALYZE_PRINTF ("protocol = MITSU_HEAVY, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3179 MITSU_HEAVY_START_BIT_PULSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PULSE_LEN_MAX
,
3180 MITSU_HEAVY_START_BIT_PAUSE_LEN_MIN
, MITSU_HEAVY_START_BIT_PAUSE_LEN_MAX
);
3182 irmp_param_p
= (IRMP_PARAMETER
*) &mitsu_heavy_param
;
3185 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
3187 #if IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3188 if (irmp_pulse_time
>= VINCENT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= VINCENT_START_BIT_PULSE_LEN_MAX
&&
3189 irmp_pause_time
>= VINCENT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= VINCENT_START_BIT_PAUSE_LEN_MAX
)
3192 ANALYZE_PRINTF ("protocol = VINCENT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3193 VINCENT_START_BIT_PULSE_LEN_MIN
, VINCENT_START_BIT_PULSE_LEN_MAX
,
3194 VINCENT_START_BIT_PAUSE_LEN_MIN
, VINCENT_START_BIT_PAUSE_LEN_MAX
);
3196 irmp_param_p
= (IRMP_PARAMETER
*) &vincent_param
;
3199 #endif // IRMP_SUPPORT_VINCENT_PROTOCOL == 1
3201 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
3202 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
3203 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
3206 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3207 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
3208 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
3210 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
3213 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
3215 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
3216 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
3217 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
3220 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3221 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
3222 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
3224 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
3227 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
3229 #if IRMP_SUPPORT_S100_PROTOCOL == 1
3230 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
3231 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
3232 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
3233 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
3236 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3237 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3238 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
3239 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
3240 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
3243 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
3244 last_pause
= irmp_pause_time
;
3246 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
3247 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
3250 rc5_cmd_bit6
= 1<<6;
3258 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
3260 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
3261 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
3262 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
3263 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
3264 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
3266 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3267 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3268 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3271 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
3272 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3273 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3274 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3275 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3276 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3277 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3279 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
3282 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3284 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3285 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3286 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3289 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
3290 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3291 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3292 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3293 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3294 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3295 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
3297 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
3300 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3303 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
3304 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3305 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
3306 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
3307 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
3311 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
3312 last_pause
= irmp_pause_time
;
3314 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
3315 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
3318 rc5_cmd_bit6
= 1<<6;
3326 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
3328 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3329 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
3330 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
3331 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
3334 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3335 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
3336 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
3337 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
3339 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
3342 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3344 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3345 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
3346 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
3347 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
3350 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3351 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
3352 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
3353 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
3355 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
3358 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3360 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
3361 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
3362 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
3365 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3366 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
3367 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
3369 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
3372 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
3374 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3375 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
3376 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
3379 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3380 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
3381 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
3383 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
3388 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3390 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3391 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
3392 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
3395 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3396 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
3397 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
3399 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
3402 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
3404 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3405 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
3406 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
3409 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3410 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
3411 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
3413 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
3416 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
3418 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3419 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
3420 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
3423 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3424 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
3425 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
3427 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
3430 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
3432 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3433 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3434 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3437 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3438 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3439 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3441 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3444 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3446 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3447 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3448 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3449 { // it's BANG_OLUFSEN
3451 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3452 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3453 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3454 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3455 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3456 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3457 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3458 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3459 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3460 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3461 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3462 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3463 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3465 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3469 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3471 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3472 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3473 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3476 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3477 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3478 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3480 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3481 last_pause
= irmp_pause_time
;
3485 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3487 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3488 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3489 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3492 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3493 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3494 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3496 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3501 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3503 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3504 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3505 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3506 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3507 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3508 { // it's RUWIDO or SIEMENS
3510 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3511 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3512 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3513 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3514 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3516 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3517 last_pause
= irmp_pause_time
;
3521 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3523 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3524 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3525 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3528 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3529 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3530 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3532 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3535 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3537 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3538 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3539 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3542 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3543 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3544 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3546 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3549 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3551 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3552 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3553 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3556 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3557 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3558 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3560 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3563 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3565 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3566 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3567 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3570 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3571 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3572 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3574 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3577 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3579 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3580 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3581 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3584 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3585 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3586 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3588 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3591 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3593 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3594 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3595 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3598 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3599 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3600 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3602 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3607 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3609 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3610 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3611 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3612 { // it's ORTEK (Hama)
3614 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3615 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3616 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3618 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3624 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3626 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3627 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3628 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3631 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3632 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3633 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3635 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3638 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3641 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3643 irmp_start_bit_detected
= 0; // wait for another start bit...
3646 if (irmp_start_bit_detected
)
3648 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3650 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3653 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3654 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3660 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3661 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3662 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3663 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3667 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3668 if (irmp_param2
.protocol
)
3671 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3672 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3673 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3674 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3680 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3681 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3684 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3689 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3692 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3693 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3699 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3700 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3701 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3702 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3707 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3708 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3710 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3711 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3715 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3716 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3717 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3718 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3724 #if IRMP_SUPPORT_MANCHESTER == 1
3725 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3726 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3727 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3729 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3732 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3733 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3736 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3738 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3741 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3742 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3745 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3749 #endif // IRMP_SUPPORT_MANCHESTER == 1
3751 #if IRMP_SUPPORT_SERIAL == 1
3752 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3757 #endif // IRMP_SUPPORT_SERIAL == 1
3760 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3761 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3764 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3767 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3768 { // pause timings correct for "1"?
3770 ANALYZE_PUTCHAR ('1'); // yes, store 1
3775 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3776 { // pause timings correct for "0"?
3778 ANALYZE_PUTCHAR ('0'); // yes, store 0
3785 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3786 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3787 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3790 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3793 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3794 { // pause timings correct for "1"?
3796 ANALYZE_PUTCHAR ('1'); // yes, store 1
3801 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3802 { // pause timings correct for "0"?
3804 ANALYZE_PUTCHAR ('0'); // yes, store 0
3811 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3813 ; // else do nothing
3816 irmp_pulse_time
= 1; // set counter to 1, not 0
3817 irmp_pause_time
= 0;
3818 wait_for_start_space
= 0;
3821 else if (wait_for_space
) // the data section....
3822 { // counting the time of darkness....
3823 uint_fast8_t got_light
= FALSE
;
3825 if (irmp_input
) // still dark?
3827 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3830 #if IRMP_SUPPORT_MANCHESTER == 1
3831 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3833 #if IRMP_SUPPORT_SERIAL == 1
3834 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3836 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3839 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3841 ANALYZE_PRINTF ("stop bit detected\n");
3844 irmp_param
.stop_bit
= 0;
3849 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",
3850 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3852 irmp_start_bit_detected
= 0; // wait for another start bit...
3853 irmp_pulse_time
= 0;
3854 irmp_pause_time
= 0;
3859 irmp_pause_time
++; // increment counter
3861 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3862 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3863 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3864 irmp_bit
>= 12 - 1) // pause too long?
3865 { // yes, break and close this frame
3866 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3867 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3868 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3869 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3870 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3874 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3875 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3876 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3877 { // yes, break and close this frame
3878 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3881 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3883 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3885 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3888 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3890 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3895 #if IRMP_SUPPORT_SERIAL == 1
3896 // NETBOX generates no stop bit, here is the timeout condition:
3897 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3898 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3900 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3904 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3905 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3907 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3910 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3912 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3913 irmp_param
.stop_bit
= TRUE
; // set flag
3915 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3916 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3917 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3918 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3919 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3920 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3922 irmp_tmp_command
<<= 1;
3923 irmp_tmp_command
|= first_bit
;
3925 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3926 { // special manchester decoder
3927 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3928 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3929 irmp_param
.stop_bit
= TRUE
; // set flag
3931 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3934 ANALYZE_PRINTF ("Switching to NOKIA protocol, irmp_bit = %d\n", irmp_bit
);
3936 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3937 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3938 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3939 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3940 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3942 if (irmp_tmp_command
& 0x300)
3944 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3945 irmp_tmp_command
&= 0xFF;
3951 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3952 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3954 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3955 { // special manchester decoder
3956 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3957 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3958 irmp_param
.stop_bit
= TRUE
; // set flag
3960 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3963 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3965 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3966 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3967 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3968 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3969 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3972 // RUWIDO: AAAAAAAAACCCCCCCp
3973 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3974 irmp_tmp_address
<<= 2;
3975 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3976 irmp_tmp_command
&= 0x003F;
3977 // irmp_tmp_command <<= 4;
3978 irmp_tmp_command
|= last_value
;
3983 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3984 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3985 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3986 { // break and close this frame
3987 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3989 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3991 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3993 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3996 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
4000 #if IRMP_SUPPORT_MANCHESTER == 1
4001 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
4002 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
4003 { // special manchester decoder
4004 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
4005 irmp_param
.stop_bit
= TRUE
; // set flag
4008 #endif // IRMP_SUPPORT_MANCHESTER == 1
4009 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
4011 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
4015 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4016 else if ((irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
) && irmp_bit
== 0)
4017 { // it was a non-standard repetition frame
4018 #ifdef ANALYZE // with 4500µs pause instead of 2250µs
4019 ANALYZE_PRINTF ("Detected non-standard repetition frame, switching to NEC repetition\n");
4021 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4023 irmp_param
.stop_bit
= TRUE
; // set flag
4024 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
4025 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4026 irmp_tmp_address
= last_irmp_address
; // address is last address
4027 irmp_tmp_command
= last_irmp_command
; // command is last command
4028 irmp_flags
|= IRMP_FLAG_REPETITION
;
4029 key_repetition_len
= 0;
4034 ANALYZE_PRINTF ("ignoring NEC repetition frame: timeout occured, key_repetition_len = %d > %d\n",
4035 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4037 irmp_ir_detected
= FALSE
;
4040 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4041 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4042 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
4045 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
4047 irmp_param
.stop_bit
= TRUE
; // set flag
4048 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
4049 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4050 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
4051 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
4052 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
4054 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4055 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4056 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
4059 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
4061 irmp_param
.stop_bit
= TRUE
; // set flag
4062 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
4063 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4064 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
4065 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
4066 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
4068 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4070 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4071 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4072 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
4075 ANALYZE_PRINTF ("Switching to NEC protocol\n");
4077 irmp_param
.stop_bit
= TRUE
; // set flag
4078 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
4079 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4081 // 0123456789ABC0123456789ABC0123456701234567
4082 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4083 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
4084 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
4085 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
4087 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
4088 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4089 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
4092 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
4094 irmp_param
.stop_bit
= TRUE
; // set flag
4095 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
4096 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4097 irmp_tmp_address
= irmp_lgair_address
;
4098 irmp_tmp_command
= irmp_lgair_command
;
4100 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
4101 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4102 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
4105 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
4107 irmp_param
.stop_bit
= TRUE
; // set flag
4108 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
4109 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
4111 // 0123456789ABC0123456789ABC0123456701234567
4112 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
4113 // JVC: AAAACCCCCCCCCCCC
4114 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
4115 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
4117 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4118 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4120 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4121 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
4124 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
4126 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4127 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4128 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4129 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4131 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4133 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4134 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
4138 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
4139 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
4142 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
4144 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
4146 else // if ((irmp_bit == 24)
4149 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
4151 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
4153 irmp_param
.stop_bit
= TRUE
; // set flag
4154 irmp_param
.complete_len
= irmp_bit
; // patch length
4156 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
4158 #if IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4159 else if (irmp_param
.protocol
== IRMP_MATSUSHITA_PROTOCOL
&& irmp_bit
== 22) // it was a TECHNICS stop bit
4162 ANALYZE_PRINTF ("Switching to TECHNICS protocol, irmp_bit = %d\n", irmp_bit
);
4165 // The first 12 bits have been stored in irmp_tmp_command (LSB first)
4166 // The following 10 bits have been stored in irmp_tmp_address (LSB first)
4167 // The code of TECHNICS is:
4168 // cccccccccccCCCCCCCCCCC (11 times c and 11 times C)
4169 // ccccccccccccaaaaaaaaaa
4170 // where C is inverted value of c
4172 irmp_tmp_address
<<= 1;
4173 if (irmp_tmp_command
& (1<<11))
4175 irmp_tmp_address
|= 1;
4176 irmp_tmp_command
&= ~(1<<11);
4179 if (irmp_tmp_command
== ((~irmp_tmp_address
) & 0x07FF))
4181 irmp_tmp_address
= 0;
4183 irmp_param
.protocol
= IRMP_TECHNICS_PROTOCOL
; // switch protocol
4184 irmp_param
.complete_len
= irmp_bit
; // patch length
4189 ANALYZE_PRINTF ("error 8: TECHNICS frame error\n");
4190 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4192 irmp_start_bit_detected
= 0; // wait for another start bit...
4193 irmp_pulse_time
= 0;
4194 irmp_pause_time
= 0;
4197 #endif // IRMP_SUPPORT_TECHNICS_PROTOCOL == 1
4201 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
4202 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4204 irmp_start_bit_detected
= 0; // wait for another start bit...
4205 irmp_pulse_time
= 0;
4206 irmp_pause_time
= 0;
4219 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4222 #if IRMP_SUPPORT_MANCHESTER == 1
4223 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
4226 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
4227 #else // better, but some IR-RCs use asymmetric timings :-/
4228 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
4229 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
4232 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4233 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4236 ANALYZE_PUTCHAR ('T');
4238 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
4253 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4256 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
4258 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
4260 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4261 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
4264 ANALYZE_PUTCHAR ('T');
4268 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
4281 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4284 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
4286 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
4287 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4288 if (! irmp_param2
.protocol
)
4295 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
4299 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
4300 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
4302 uint_fast8_t manchester_value
;
4304 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
4306 manchester_value
= last_value
? 0 : 1;
4307 last_value
= manchester_value
;
4311 manchester_value
= last_value
;
4315 ANALYZE_PUTCHAR (manchester_value
+ '0');
4318 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
4319 if (! irmp_param2
.protocol
)
4327 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4328 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
4331 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
4333 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
4334 irmp_param
.address_offset
= 5;
4335 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
4336 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
4337 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
4338 irmp_tmp_address
= 0;
4340 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4342 irmp_store_bit (manchester_value
);
4346 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4347 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
4348 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
4349 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
4350 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
4353 ANALYZE_PUTCHAR ('?');
4355 irmp_param
.protocol
= 0; // switch to FDC, see below
4358 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4359 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4360 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
4361 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
4362 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
4363 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
4366 ANALYZE_PUTCHAR ('?');
4368 irmp_param
.protocol
= 0; // switch to RCCAR, see below
4371 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4374 ANALYZE_PUTCHAR ('?');
4376 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4377 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4379 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4380 irmp_pause_time
= 0;
4384 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
4385 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
4387 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
4390 ANALYZE_PRINTF (" 1 (FDC)\n");
4392 irmp_store_bit2 (1);
4394 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
4397 ANALYZE_PRINTF (" 0 (FDC)\n");
4399 irmp_store_bit2 (0);
4402 if (! irmp_param
.protocol
)
4405 ANALYZE_PRINTF ("Switching to FDC protocol\n");
4407 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4408 irmp_param2
.protocol
= 0;
4409 irmp_tmp_address
= irmp_tmp_address2
;
4410 irmp_tmp_command
= irmp_tmp_command2
;
4413 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
4414 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4415 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
4417 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
4420 ANALYZE_PRINTF (" 1 (RCCAR)\n");
4422 irmp_store_bit2 (1);
4424 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
4427 ANALYZE_PRINTF (" 0 (RCCAR)\n");
4429 irmp_store_bit2 (0);
4432 if (! irmp_param
.protocol
)
4435 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
4437 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
4438 irmp_param2
.protocol
= 0;
4439 irmp_tmp_address
= irmp_tmp_address2
;
4440 irmp_tmp_command
= irmp_tmp_command2
;
4443 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
4445 last_pause
= irmp_pause_time
;
4449 #endif // IRMP_SUPPORT_MANCHESTER == 1
4451 #if IRMP_SUPPORT_SERIAL == 1
4452 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
4454 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
4457 ANALYZE_PUTCHAR ('1');
4461 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
4463 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
4467 irmp_pulse_time
= 0;
4471 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
4474 ANALYZE_PUTCHAR ('0');
4478 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
4480 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
4484 irmp_pause_time
= 0;
4493 #endif // IRMP_SUPPORT_SERIAL == 1
4495 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4496 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
4498 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
4499 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4502 ANALYZE_PRINTF ("SYNC\n");
4507 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4509 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4511 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4513 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4514 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4515 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4516 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4519 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4521 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4522 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4523 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4524 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4526 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4529 ANALYZE_PUTCHAR ('1');
4538 ANALYZE_PUTCHAR ('0');
4546 { // timing incorrect!
4548 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4549 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4551 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4552 irmp_pause_time
= 0;
4556 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4558 #if IRMP_SUPPORT_NEC16_PROTOCOL
4559 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4560 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4561 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4562 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4563 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4564 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4567 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4569 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4570 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4571 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4572 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4573 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4574 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4578 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4580 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4581 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4583 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4585 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4587 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4590 ANALYZE_PRINTF ("3rd start bit\n");
4596 { // timing incorrect!
4598 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
);
4599 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4601 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4602 irmp_pause_time
= 0;
4605 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4607 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4610 ANALYZE_PRINTF ("trailer bit\n");
4616 { // timing incorrect!
4618 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
);
4619 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4621 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4622 irmp_pause_time
= 0;
4627 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4628 { // pulse & pause timings correct for "1"?
4630 ANALYZE_PUTCHAR ('1');
4637 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4638 { // pulse & pause timings correct for "0"?
4640 ANALYZE_PUTCHAR ('0');
4647 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4650 ANALYZE_PUTCHAR (last_value
+ '0');
4653 irmp_store_bit (last_value
);
4657 { // timing incorrect!
4659 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
);
4660 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4662 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4663 irmp_pause_time
= 0;
4668 { // timing incorrect!
4670 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
);
4671 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4673 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4674 irmp_pause_time
= 0;
4678 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4680 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4681 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4683 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4686 ANALYZE_PUTCHAR ('0');
4687 ANALYZE_PUTCHAR ('0');
4692 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4695 ANALYZE_PUTCHAR ('0');
4696 ANALYZE_PUTCHAR ('1');
4701 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4704 ANALYZE_PUTCHAR ('1');
4705 ANALYZE_PUTCHAR ('0');
4710 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4713 ANALYZE_PUTCHAR ('1');
4714 ANALYZE_PUTCHAR ('1');
4720 ANALYZE_PRINTF ("\n");
4727 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4728 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4729 { // pulse & pause timings correct for "1"?
4731 ANALYZE_PUTCHAR ('1');
4737 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4738 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4739 { // pulse & pause timings correct for "0"?
4741 ANALYZE_PUTCHAR ('0');
4748 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4750 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4751 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4752 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4753 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4755 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4762 ANALYZE_PUTCHAR ('S');
4765 irmp_tmp_command
<<= 1;
4770 ANALYZE_PUTCHAR ('S');
4778 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4779 { // timing incorrect!
4781 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4782 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4784 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4785 irmp_pause_time
= 0;
4788 irmp_pulse_time
= 1; // set counter to 1, not 0
4792 { // counting the pulse length ...
4793 if (! irmp_input
) // still light?
4795 irmp_pulse_time
++; // increment counter
4799 wait_for_space
= 1; // let's count the time (see above)
4800 irmp_pause_time
= 1; // set pause counter to 1, not 0
4804 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4806 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4808 repetition_frame_number
++;
4812 repetition_frame_number
= 0;
4815 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4816 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4817 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4820 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4821 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4823 key_repetition_len
= 0;
4828 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4829 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4830 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4833 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4834 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4836 key_repetition_len
= 0;
4841 #if 0 && IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4842 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4843 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4846 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4847 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4849 key_repetition_len
= 0;
4854 #if 0 && IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1 // fm 2015-12-02: don't ignore every 2nd frame
4855 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4856 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4859 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4860 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4862 key_repetition_len
= 0;
4867 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4868 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4869 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4872 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4873 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4875 key_repetition_len
= 0;
4880 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4881 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4882 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4885 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4886 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4888 key_repetition_len
= 0;
4895 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4897 irmp_ir_detected
= TRUE
;
4899 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4900 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4901 { // check for repetition frame
4902 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4904 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4905 last_irmp_denon_command
= 0;
4907 irmp_protocol
= irmp_param
.protocol
; // store protocol
4908 irmp_address
= irmp_tmp_address
; // store address
4909 irmp_command
= irmp_tmp_command
; // store command
4913 if ((irmp_tmp_command
& 0x01) == 0x00)
4916 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4918 last_irmp_denon_command
= irmp_tmp_command
;
4919 denon_repetition_len
= 0;
4920 irmp_ir_detected
= FALSE
;
4925 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4927 last_irmp_denon_command
= 0;
4928 irmp_ir_detected
= FALSE
;
4933 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4935 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4936 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4937 { // Grundig start frame?
4939 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4941 irmp_ir_detected
= FALSE
;
4944 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4946 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4947 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4948 { // Nokia start frame?
4950 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4952 irmp_ir_detected
= FALSE
;
4955 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4957 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4958 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4960 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4963 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4964 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4966 irmp_tmp_address
= last_irmp_address
; // address is last address
4967 irmp_tmp_command
= last_irmp_command
; // command is last command
4968 irmp_flags
|= IRMP_FLAG_REPETITION
;
4969 key_repetition_len
= 0;
4974 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4975 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4977 irmp_ir_detected
= FALSE
;
4980 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4982 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4983 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4985 uint_fast8_t xor_value
;
4987 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4989 if (xor_value
!= (xor_check
[2] & 0x0F))
4992 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4994 irmp_ir_detected
= FALSE
;
4997 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4999 if (xor_value
!= xor_check
[5])
5002 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
5004 irmp_ir_detected
= FALSE
;
5007 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
5009 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
5011 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5012 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
5014 if (parity
== PARITY_CHECK_FAILED
)
5017 ANALYZE_PRINTF ("error 6: parity check failed\n");
5019 irmp_ir_detected
= FALSE
;
5022 if ((irmp_tmp_address
& 0x03) == 0x02)
5025 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
5027 irmp_ir_detected
= FALSE
;
5029 irmp_tmp_address
>>= 2;
5031 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
5033 #if IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL == 1
5034 if (irmp_param
.protocol
== IRMP_MITSU_HEAVY_PROTOCOL
)
5036 check
= irmp_tmp_command
>> 8; // inverted upper byte == lower byte?
5038 if (check
== (irmp_tmp_command
& 0xFF)) { //ok:
5039 irmp_tmp_command
&= 0xFF;
5041 else mitsu_parity
= PARITY_CHECK_FAILED
;
5042 if (mitsu_parity
== PARITY_CHECK_FAILED
)
5045 ANALYZE_PRINTF ("error 7: parity check failed\n");
5047 irmp_ir_detected
= FALSE
;
5050 #endif // IRMP_SUPPORT_MITSU_HEAVY_PROTOCOL
5052 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
5053 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
5055 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
5058 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
5060 irmp_protocol
= irmp_param
.protocol
;
5063 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
5064 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
5066 if (irmp_tmp_command
& 0x000F) // released key?
5068 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
5072 irmp_tmp_command
>>= 4; // no, it's a pressed key
5074 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
5075 irmp_tmp_address
&= 0x003F;
5079 irmp_address
= irmp_tmp_address
; // store address
5080 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
5081 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
5083 last_irmp_address
= irmp_tmp_address
; // store as last address, too
5087 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
5088 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
5090 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
5093 #if IRMP_SUPPORT_S100_PROTOCOL == 1
5094 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
5096 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
5099 irmp_command
= irmp_tmp_command
; // store command
5101 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
5102 irmp_id
= irmp_tmp_id
;
5107 if (irmp_ir_detected
)
5109 if (last_irmp_command
== irmp_tmp_command
&&
5110 last_irmp_address
== irmp_tmp_address
&&
5111 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
5113 irmp_flags
|= IRMP_FLAG_REPETITION
;
5116 last_irmp_address
= irmp_tmp_address
; // store as last address, too
5117 last_irmp_command
= irmp_tmp_command
; // store as last command, too
5119 key_repetition_len
= 0;
5124 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
5128 irmp_start_bit_detected
= 0; // and wait for next start bit
5129 irmp_tmp_command
= 0;
5130 irmp_pulse_time
= 0;
5131 irmp_pause_time
= 0;
5133 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
5134 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
5135 { // set pulse time here!
5136 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
5138 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
5143 #if defined(STELLARIS_ARM_CORTEX_M4)
5144 // Clear the timer interrupt
5145 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
5148 return (irmp_ir_detected
);
5153 /*---------------------------------------------------------------------------------------------------------------------------------------------------
5154 * main functions - for Unix/Linux + Windows only!
5158 * Compile it under linux with:
5161 * usage: ./irmp [-v|-s|-a|-l] < file
5167 * -l list pulse/pauses
5168 *---------------------------------------------------------------------------------------------------------------------------------------------------
5172 print_spectrum (char * text
, int * buf
, int is_pulse
)
5185 puts ("-----------------------------------------------------------------------------");
5186 printf ("%s:\n", text
);
5188 for (i
= 0; i
< 256; i
++)
5190 if (buf
[i
] > max_value
)
5196 for (i
= 1; i
< 200; i
++)
5201 value
= (buf
[i
] * 60) / max_value
;
5203 for (j
= 0; j
< value
; j
++)
5207 printf (" %d\n", buf
[i
]);
5218 average
= (float) sum
/ (float) counter
;
5229 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
5230 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
5231 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
5233 tolerance
= (max
- average
);
5235 if (average
- min
> tolerance
)
5237 tolerance
= average
- min
;
5240 tolerance
= tolerance
* 100 / average
;
5241 printf ("tol: %4.1f%%\n", tolerance
);
5251 #define STATE_LEFT_SHIFT 0x01
5252 #define STATE_RIGHT_SHIFT 0x02
5253 #define STATE_LEFT_CTRL 0x04
5254 #define STATE_LEFT_ALT 0x08
5255 #define STATE_RIGHT_ALT 0x10
5257 #define KEY_ESCAPE 0x1B // keycode = 0x006e
5258 #define KEY_MENUE 0x80 // keycode = 0x0070
5259 #define KEY_BACK 0x81 // keycode = 0x0071
5260 #define KEY_FORWARD 0x82 // keycode = 0x0072
5261 #define KEY_ADDRESS 0x83 // keycode = 0x0073
5262 #define KEY_WINDOW 0x84 // keycode = 0x0074
5263 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
5264 #define KEY_STOP 0x86 // keycode = 0x0076
5265 #define KEY_MAIL 0x87 // keycode = 0x0077
5266 #define KEY_FAVORITES 0x88 // keycode = 0x0078
5267 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
5268 #define KEY_SETUP 0x8A // keycode = 0x007a
5269 #define KEY_FONT 0x8B // keycode = 0x007b
5270 #define KEY_PRINT 0x8C // keycode = 0x007c
5271 #define KEY_ON_OFF 0x8E // keycode = 0x007c
5273 #define KEY_INSERT 0x90 // keycode = 0x004b
5274 #define KEY_DELETE 0x91 // keycode = 0x004c
5275 #define KEY_LEFT 0x92 // keycode = 0x004f
5276 #define KEY_HOME 0x93 // keycode = 0x0050
5277 #define KEY_END 0x94 // keycode = 0x0051
5278 #define KEY_UP 0x95 // keycode = 0x0053
5279 #define KEY_DOWN 0x96 // keycode = 0x0054
5280 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
5281 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
5282 #define KEY_RIGHT 0x99 // keycode = 0x0059
5283 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
5284 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
5287 get_fdc_key (uint_fast16_t cmd
)
5289 static uint8_t key_table
[128] =
5291 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
5292 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 0xDF, '´', 0, '\b',
5293 '\t', 'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 0xFC, '+', 0, 0, 'a',
5294 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 0xF6, 0xE4, '#', '\r', 0, '<', 'y', 'x',
5295 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
5297 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
5298 '\t', 'Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 0xDC, '*', 0, 0, 'A',
5299 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 0xD6, 0xC4, '\'', '\r', 0, '>', 'Y', 'X',
5300 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
5302 static uint_fast8_t state
;
5304 uint_fast8_t key
= 0;
5308 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
5309 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
5310 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
5311 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
5312 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
5313 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
5314 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
5315 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
5316 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
5317 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
5319 case 0x006e: key
= KEY_ESCAPE
; break;
5320 case 0x004b: key
= KEY_INSERT
; break;
5321 case 0x004c: key
= KEY_DELETE
; break;
5322 case 0x004f: key
= KEY_LEFT
; break;
5323 case 0x0050: key
= KEY_HOME
; break;
5324 case 0x0051: key
= KEY_END
; break;
5325 case 0x0053: key
= KEY_UP
; break;
5326 case 0x0054: key
= KEY_DOWN
; break;
5327 case 0x0055: key
= KEY_PAGE_UP
; break;
5328 case 0x0056: key
= KEY_PAGE_DOWN
; break;
5329 case 0x0059: key
= KEY_RIGHT
; break;
5330 case 0x0400: key
= KEY_MOUSE_1
; break;
5331 case 0x0800: key
= KEY_MOUSE_2
; break;
5335 if (!(cmd
& 0x80)) // pressed key
5337 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
5339 key
= cmd
+ 0x10; // 7x -> 8x
5341 else if (cmd
< 64) // key listed in key_table
5343 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
5347 case 0x0003: key
= 0xB2; break; // upper 2
5348 case 0x0008: key
= '{'; break;
5349 case 0x0009: key
= '['; break;
5350 case 0x000A: key
= ']'; break;
5351 case 0x000B: key
= '}'; break;
5352 case 0x000C: key
= '\\'; break;
5353 case 0x001C: key
= '~'; break;
5354 case 0x002D: key
= '|'; break;
5355 case 0x0034: key
= 0xB5; break; // Mu
5358 else if (state
& (STATE_LEFT_CTRL
))
5360 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
5362 key
= key_table
[cmd
] - 'a' + 1;
5366 key
= key_table
[cmd
];
5371 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5375 key
= key_table
[idx
];
5387 static int analyze
= FALSE
;
5388 static int list
= FALSE
;
5389 static IRMP_DATA irmp_data
;
5390 static int expected_protocol
;
5391 static int expected_address
;
5392 static int expected_command
;
5393 static int do_check_expected_values
;
5398 if (! analyze
&& ! list
)
5402 if (irmp_get_data (&irmp_data
))
5406 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5410 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5413 if (irmp_data
.protocol
== IRMP_ACP24_PROTOCOL
)
5415 uint16_t temp
= (irmp_data
.command
& 0x000F) + 15;
5417 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, temp=%d",
5418 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, temp
);
5420 else if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5422 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5424 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5425 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5427 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5429 char * p
= (char *) NULL
;
5433 case '\t' : p
= "TAB"; break;
5434 case '\r' : p
= "CR"; break;
5435 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5436 case KEY_MENUE
: p
= "MENUE"; break;
5437 case KEY_BACK
: p
= "BACK"; break;
5438 case KEY_FORWARD
: p
= "FORWARD"; break;
5439 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5440 case KEY_WINDOW
: p
= "WINDOW"; break;
5441 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5442 case KEY_STOP
: p
= "STOP"; break;
5443 case KEY_MAIL
: p
= "MAIL"; break;
5444 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5445 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5446 case KEY_SETUP
: p
= "SETUP"; break;
5447 case KEY_FONT
: p
= "FONT"; break;
5448 case KEY_PRINT
: p
= "PRINT"; break;
5449 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5451 case KEY_INSERT
: p
= "INSERT"; break;
5452 case KEY_DELETE
: p
= "DELETE"; break;
5453 case KEY_LEFT
: p
= "LEFT"; break;
5454 case KEY_HOME
: p
= "HOME"; break;
5455 case KEY_END
: p
= "END"; break;
5456 case KEY_UP
: p
= "UP"; break;
5457 case KEY_DOWN
: p
= "DOWN"; break;
5458 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5459 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5460 case KEY_RIGHT
: p
= "RIGHT"; break;
5461 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5462 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5463 default : p
= "<UNKNWON>"; break;
5466 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5467 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5471 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5472 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5477 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5478 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5481 if (do_check_expected_values
)
5483 if (irmp_data
.protocol
!= expected_protocol
||
5484 irmp_data
.address
!= expected_address
||
5485 irmp_data
.command
!= expected_command
)
5487 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5488 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5492 printf (" checked!\n");
5494 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5505 main (int argc
, char ** argv
)
5513 int start_pulses
[256];
5514 int start_pauses
[256];
5518 int first_pulse
= TRUE
;
5519 int first_pause
= TRUE
;
5523 if (! strcmp (argv
[1], "-v"))
5527 else if (! strcmp (argv
[1], "-l"))
5531 else if (! strcmp (argv
[1], "-a"))
5535 else if (! strcmp (argv
[1], "-s"))
5539 else if (! strcmp (argv
[1], "-r"))
5545 for (i
= 0; i
< 256; i
++)
5547 start_pulses
[i
] = 0;
5548 start_pauses
[i
] = 0;
5555 while ((ch
= getchar ()) != EOF
)
5557 if (ch
== '_' || ch
== '0')
5565 printf ("pause: %d\n", pause
);
5574 start_pauses
[pause
]++;
5576 first_pause
= FALSE
;
5592 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5598 printf ("pulse: %d ", pulse
);
5607 start_pulses
[pulse
]++;
5609 first_pulse
= FALSE
;
5625 else if (ch
== '\n')
5630 if (list
&& pause
> 0)
5632 printf ("pause: %d\n", pause
);
5638 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5652 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5663 puts ("----------------------------------------------------------------------");
5667 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5669 if (ch
!= '\r') // ignore CR in DOS/Windows files
5671 if (ch
== '[' && idx
== -1)
5679 do_check_expected_values
= FALSE
;
5683 expected_protocol
= atoi (buf
);
5685 if (expected_protocol
> 0)
5694 if (sscanf (p
, "%x", &expected_address
) == 1)
5696 do_check_expected_values
= TRUE
;
5703 if (do_check_expected_values
)
5705 do_check_expected_values
= FALSE
;
5713 if (sscanf (p
, "%x", &expected_command
) == 1)
5715 do_check_expected_values
= TRUE
;
5722 if (do_check_expected_values
)
5724 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5729 else if (idx
< 1024 - 2)
5749 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5750 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5751 print_spectrum ("PULSES", pulses
, TRUE
);
5752 print_spectrum ("PAUSES", pauses
, FALSE
);
5753 puts ("-----------------------------------------------------------------------------");