1 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2 * irmp.c - infrared multi-protocol decoder, supports several remote control protocols
4 * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de
6 * $Id: irmp.c,v 1.175 2015/05/29 08:23:56 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_05 0.95 // -5%
65 #define MAX_TOLERANCE_05 1.05 // +5%
67 #define MIN_TOLERANCE_10 0.9 // -10%
68 #define MAX_TOLERANCE_10 1.1 // +10%
70 #define MIN_TOLERANCE_15 0.85 // -15%
71 #define MAX_TOLERANCE_15 1.15 // +15%
73 #define MIN_TOLERANCE_20 0.8 // -20%
74 #define MAX_TOLERANCE_20 1.2 // +20%
76 #define MIN_TOLERANCE_30 0.7 // -30%
77 #define MAX_TOLERANCE_30 1.3 // +30%
79 #define MIN_TOLERANCE_40 0.6 // -40%
80 #define MAX_TOLERANCE_40 1.4 // +40%
82 #define MIN_TOLERANCE_50 0.5 // -50%
83 #define MAX_TOLERANCE_50 1.5 // +50%
85 #define MIN_TOLERANCE_60 0.4 // -60%
86 #define MAX_TOLERANCE_60 1.6 // +60%
88 #define MIN_TOLERANCE_70 0.3 // -70%
89 #define MAX_TOLERANCE_70 1.7 // +70%
91 #define SIRCS_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
92 #define SIRCS_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
93 #define SIRCS_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
94 #if IRMP_SUPPORT_NETBOX_PROTOCOL // only 5% to avoid conflict with NETBOX:
95 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
96 #else // only 5% + 1 to avoid conflict with RC6:
97 # define SIRCS_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
99 #define SIRCS_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
100 #define SIRCS_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
101 #define SIRCS_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
102 #define SIRCS_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
103 #define SIRCS_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
104 #define SIRCS_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
106 #define NEC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
107 #define NEC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
108 #define NEC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
109 #define NEC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
110 #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)
111 #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)
112 #define NEC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
113 #define NEC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
114 #define NEC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
115 #define NEC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
116 #define NEC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
117 #define NEC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NEC_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
118 // autodetect nec repetition frame within 50 msec:
119 // NEC seems to send the first repetition frame after 40ms, further repetition frames after 100 ms
121 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NEC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
123 #define NEC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
126 #define SAMSUNG_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
127 #define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
128 #define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
129 #define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
130 #define SAMSUNG_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
131 #define SAMSUNG_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
132 #define SAMSUNG_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
133 #define SAMSUNG_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
134 #define SAMSUNG_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
135 #define SAMSUNG_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
137 #define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
138 #define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
139 #define MATSUSHITA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
140 #define MATSUSHITA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
141 #define MATSUSHITA_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
142 #define MATSUSHITA_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
143 #define MATSUSHITA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
144 #define MATSUSHITA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
145 #define MATSUSHITA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
146 #define MATSUSHITA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MATSUSHITA_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
148 #define KASEIKYO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
149 #define KASEIKYO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
150 #define KASEIKYO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
151 #define KASEIKYO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
152 #define KASEIKYO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
153 #define KASEIKYO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
154 #define KASEIKYO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
155 #define KASEIKYO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
156 #define KASEIKYO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
157 #define KASEIKYO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KASEIKYO_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
159 #define RECS80_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
160 #define RECS80_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
161 #define RECS80_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
162 #define RECS80_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
163 #define RECS80_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
164 #define RECS80_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
165 #define RECS80_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
166 #define RECS80_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
167 #define RECS80_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
168 #define RECS80_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
171 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with RC5, so keep tolerance for RC5 minimal here:
172 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
173 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
175 #define RC5_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
176 #define RC5_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
179 #define RC5_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
180 #define RC5_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
182 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1 // BOSE conflicts with S100, so keep tolerance for S100 minimal here:
183 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
184 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
186 #define S100_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
187 #define S100_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
190 #define S100_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
191 #define S100_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * S100_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
193 #define DENON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
194 #define DENON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
195 #define DENON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
196 #define DENON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
197 // RUWIDO (see t-home-mediareceiver-15kHz.txt) conflicts here with DENON
198 #define DENON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
199 #define DENON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * DENON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
200 #define DENON_AUTO_REPETITION_PAUSE_LEN ((uint_fast16_t)(F_INTERRUPTS * DENON_AUTO_REPETITION_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
202 #define THOMSON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
203 #define THOMSON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
204 #define THOMSON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
205 #define THOMSON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
206 #define THOMSON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
207 #define THOMSON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * THOMSON_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
209 #define RC6_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
210 #define RC6_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
211 #define RC6_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
212 #define RC6_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
213 #define RC6_TOGGLE_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
214 #define RC6_TOGGLE_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_TOGGLE_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
215 #define RC6_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
216 #define RC6_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_60 + 0.5) + 1) // pulses: 300 - 800
217 #define RC6_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
218 #define RC6_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1) // pauses: 300 - 600
220 #define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
221 #define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
222 #define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
223 #define RECS80EXT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
224 #define RECS80EXT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
225 #define RECS80EXT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
226 #define RECS80EXT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
227 #define RECS80EXT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
228 #define RECS80EXT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
229 #define RECS80EXT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RECS80EXT_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
231 #define NUBERT_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
232 #define NUBERT_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
233 #define NUBERT_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
234 #define NUBERT_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
235 #define NUBERT_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
236 #define NUBERT_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
237 #define NUBERT_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
238 #define NUBERT_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
239 #define NUBERT_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
240 #define NUBERT_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
241 #define NUBERT_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
242 #define NUBERT_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NUBERT_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
244 #define FAN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
245 #define FAN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
246 #define FAN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
247 #define FAN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
248 #define FAN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
249 #define FAN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
250 #define FAN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
251 #define FAN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
252 #define FAN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
253 #define FAN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
254 #define FAN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
255 #define FAN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FAN_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
257 #define SPEAKER_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
258 #define SPEAKER_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
259 #define SPEAKER_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
260 #define SPEAKER_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
261 #define SPEAKER_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
262 #define SPEAKER_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
263 #define SPEAKER_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
264 #define SPEAKER_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
265 #define SPEAKER_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
266 #define SPEAKER_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
267 #define SPEAKER_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
268 #define SPEAKER_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * SPEAKER_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
270 #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)
271 #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)
272 #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)
273 #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)
274 #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)
275 #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)
276 #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)
277 #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)
278 #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)
279 #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)
280 #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)
281 #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
282 #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)
283 #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)
284 #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)
285 #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)
286 #define BANG_OLUFSEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
287 #define BANG_OLUFSEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
288 #define BANG_OLUFSEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
289 #define BANG_OLUFSEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
290 #define BANG_OLUFSEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
291 #define BANG_OLUFSEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
292 #define BANG_OLUFSEN_R_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
293 #define BANG_OLUFSEN_R_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
294 #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)
295 #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)
297 #define IR60_TIMEOUT_LEN ((uint_fast8_t)(F_INTERRUPTS * IR60_TIMEOUT_TIME * 0.5))
298 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
299 #define GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
300 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
301 #define GRUNDIG_NOKIA_IR60_BIT_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
302 #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)
303 #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)
305 #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)
306 #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)
307 #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)
308 #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)
309 #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)
310 #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)
311 #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)
312 #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)
314 #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
315 #define FDC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
316 #define FDC_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
317 #define FDC_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5))
318 #define FDC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
319 #define FDC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
320 #define FDC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
321 #define FDC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
323 #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
325 #define FDC_0_PAUSE_LEN_MIN (1) // simply use 1
327 #define FDC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * FDC_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
329 #define RCCAR_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
330 #define RCCAR_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
331 #define RCCAR_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
332 #define RCCAR_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
333 #define RCCAR_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
334 #define RCCAR_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
335 #define RCCAR_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
336 #define RCCAR_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
337 #define RCCAR_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
338 #define RCCAR_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCCAR_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
340 #define JVC_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
341 #define JVC_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
342 #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!
343 #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!
344 #define JVC_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
345 #define JVC_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
346 #define JVC_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
347 #define JVC_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
348 #define JVC_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
349 #define JVC_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * JVC_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
350 // autodetect JVC repetition frame within 50 msec:
351 #define JVC_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * JVC_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
353 #define NIKON_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
354 #define NIKON_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
355 #define NIKON_START_BIT_PAUSE_LEN_MIN ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
356 #define NIKON_START_BIT_PAUSE_LEN_MAX ((uint_fast16_t)(F_INTERRUPTS * NIKON_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
357 #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)
358 #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)
359 #define NIKON_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
360 #define NIKON_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
361 #define NIKON_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
362 #define NIKON_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
363 #define NIKON_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
364 #define NIKON_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
365 #define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
367 #define KATHREIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
368 #define KATHREIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
369 #define KATHREIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
370 #define KATHREIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
371 #define KATHREIN_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
372 #define KATHREIN_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
373 #define KATHREIN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
374 #define KATHREIN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_1_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
375 #define KATHREIN_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
376 #define KATHREIN_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
377 #define KATHREIN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
378 #define KATHREIN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_0_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
379 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
380 #define KATHREIN_SYNC_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * KATHREIN_SYNC_BIT_PAUSE_LEN_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
382 #define NETBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
383 #define NETBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
384 #define NETBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
385 #define NETBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * NETBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
386 #define NETBOX_PULSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME))
387 #define NETBOX_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME))
388 #define NETBOX_PULSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PULSE_TIME / 4))
389 #define NETBOX_PAUSE_REST_LEN ((uint_fast8_t)(F_INTERRUPTS * NETBOX_PAUSE_TIME / 4))
391 #define LEGO_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
392 #define LEGO_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
393 #define LEGO_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
394 #define LEGO_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
395 #define LEGO_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
396 #define LEGO_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_PULSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
397 #define LEGO_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
398 #define LEGO_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_1_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
399 #define LEGO_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MIN_TOLERANCE_40 + 0.5) - 1)
400 #define LEGO_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * LEGO_0_PAUSE_TIME * MAX_TOLERANCE_40 + 0.5) + 1)
402 #define BOSE_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
403 #define BOSE_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
404 #define BOSE_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
405 #define BOSE_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_START_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
406 #define BOSE_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
407 #define BOSE_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
408 #define BOSE_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
409 #define BOSE_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
410 #define BOSE_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
411 #define BOSE_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
412 #define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
414 #define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
415 #define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
416 #define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
417 #define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
418 #define A1TVBOX_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
419 #define A1TVBOX_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
420 #define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
421 #define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
423 #define MERLIN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
424 #define MERLIN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
425 #define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
426 #define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
427 #define MERLIN_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
428 #define MERLIN_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
429 #define MERLIN_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
430 #define MERLIN_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
432 #define ORTEK_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
433 #define ORTEK_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
434 #define ORTEK_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
435 #define ORTEK_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
436 #define ORTEK_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
437 #define ORTEK_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
438 #define ORTEK_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
439 #define ORTEK_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ORTEK_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
441 #define TELEFUNKEN_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
442 #define TELEFUNKEN_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
443 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MIN_TOLERANCE_10 + 0.5) - 1)
444 #define TELEFUNKEN_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * (TELEFUNKEN_START_BIT_PAUSE_TIME) * MAX_TOLERANCE_10 + 0.5) - 1)
445 #define TELEFUNKEN_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
446 #define TELEFUNKEN_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
447 #define TELEFUNKEN_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
448 #define TELEFUNKEN_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
449 #define TELEFUNKEN_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
450 #define TELEFUNKEN_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * TELEFUNKEN_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
451 // autodetect TELEFUNKEN repetition frame within 50 msec:
452 // #define TELEFUNKEN_FRAME_REPEAT_PAUSE_LEN_MAX (uint_fast16_t)(F_INTERRUPTS * TELEFUNKEN_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
454 #define ROOMBA_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
455 #define ROOMBA_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
456 #define ROOMBA_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
457 #define ROOMBA_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
458 #define ROOMBA_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME + 0.5))
459 #define ROOMBA_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
460 #define ROOMBA_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
461 #define ROOMBA_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
462 #define ROOMBA_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
463 #define ROOMBA_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME))
464 #define ROOMBA_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
465 #define ROOMBA_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
466 #define ROOMBA_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
467 #define ROOMBA_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * ROOMBA_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
469 #define RCMM32_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
470 #define RCMM32_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
471 #define RCMM32_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
472 #define RCMM32_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
473 #define RCMM32_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
474 #define RCMM32_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
475 #define RCMM32_BIT_00_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
476 #define RCMM32_BIT_00_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_00_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
477 #define RCMM32_BIT_01_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
478 #define RCMM32_BIT_01_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_01_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
479 #define RCMM32_BIT_10_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
480 #define RCMM32_BIT_10_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_10_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
481 #define RCMM32_BIT_11_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
482 #define RCMM32_BIT_11_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RCMM32_11_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
484 #define PENTAX_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
485 #define PENTAX_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
486 #define PENTAX_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
487 #define PENTAX_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
488 #define PENTAX_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME + 0.5))
489 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
490 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
491 #define PENTAX_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
492 #define PENTAX_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
493 #define PENTAX_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME))
494 #define PENTAX_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
495 #define PENTAX_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
496 #define PENTAX_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
497 #define PENTAX_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * PENTAX_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
499 #define RADIO1_START_BIT_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
500 #define RADIO1_START_BIT_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
501 #define RADIO1_START_BIT_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
502 #define RADIO1_START_BIT_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
503 #define RADIO1_1_PAUSE_LEN_EXACT ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME + 0.5))
504 #define RADIO1_1_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
505 #define RADIO1_1_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
506 #define RADIO1_1_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
507 #define RADIO1_1_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_1_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
508 #define RADIO1_0_PAUSE_LEN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME))
509 #define RADIO1_0_PULSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
510 #define RADIO1_0_PULSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
511 #define RADIO1_0_PAUSE_LEN_MIN ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
512 #define RADIO1_0_PAUSE_LEN_MAX ((uint_fast8_t)(F_INTERRUPTS * RADIO1_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
514 #define AUTO_FRAME_REPETITION_LEN (uint_fast16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint_fast16_t!
517 # define ANALYZE_PUTCHAR(a) { if (! silent) { putchar (a); } }
518 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a) { if (! silent && !verbose) { putchar (a); } }
519 # define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
520 # define ANALYZE_ONLY_NORMAL_PRINTF(...) { if (! silent && !verbose) { printf (__VA_ARGS__); } }
521 # define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
523 static int time_counter
;
526 /******************************* not every PIC compiler knows variadic macros :-(
528 # define ANALYZE_PUTCHAR(a)
529 # define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
530 # define ANALYZE_PRINTF(...)
531 # define ANALYZE_ONLY_NORMAL_PRINTF(...)
533 # define ANALYZE_NEWLINE()
534 *********************************/
537 #if IRMP_USE_CALLBACK == 1
538 static void (*irmp_callback_ptr
) (uint_fast8_t);
539 #endif // IRMP_USE_CALLBACK == 1
541 #define PARITY_CHECK_OK 1
542 #define PARITY_CHECK_FAILED 0
544 /*---------------------------------------------------------------------------------------------------------------------------------------------------
546 *---------------------------------------------------------------------------------------------------------------------------------------------------
548 #if defined(UNIX_OR_WINDOWS) || IRMP_PROTOCOL_NAMES == 1
549 static const char proto_unknown
[] PROGMEM
= "UNKNOWN";
550 static const char proto_sircs
[] PROGMEM
= "SIRCS";
551 static const char proto_nec
[] PROGMEM
= "NEC";
552 static const char proto_samsung
[] PROGMEM
= "SAMSUNG";
553 static const char proto_matsushita
[] PROGMEM
= "MATSUSH";
554 static const char proto_kaseikyo
[] PROGMEM
= "KASEIKYO";
555 static const char proto_recs80
[] PROGMEM
= "RECS80";
556 static const char proto_rc5
[] PROGMEM
= "RC5";
557 static const char proto_denon
[] PROGMEM
= "DENON";
558 static const char proto_rc6
[] PROGMEM
= "RC6";
559 static const char proto_samsung32
[] PROGMEM
= "SAMSG32";
560 static const char proto_apple
[] PROGMEM
= "APPLE";
561 static const char proto_recs80ext
[] PROGMEM
= "RECS80EX";
562 static const char proto_nubert
[] PROGMEM
= "NUBERT";
563 static const char proto_bang_olufsen
[] PROGMEM
= "BANG OLU";
564 static const char proto_grundig
[] PROGMEM
= "GRUNDIG";
565 static const char proto_nokia
[] PROGMEM
= "NOKIA";
566 static const char proto_siemens
[] PROGMEM
= "SIEMENS";
567 static const char proto_fdc
[] PROGMEM
= "FDC";
568 static const char proto_rccar
[] PROGMEM
= "RCCAR";
569 static const char proto_jvc
[] PROGMEM
= "JVC";
570 static const char proto_rc6a
[] PROGMEM
= "RC6A";
571 static const char proto_nikon
[] PROGMEM
= "NIKON";
572 static const char proto_ruwido
[] PROGMEM
= "RUWIDO";
573 static const char proto_ir60
[] PROGMEM
= "IR60";
574 static const char proto_kathrein
[] PROGMEM
= "KATHREIN";
575 static const char proto_netbox
[] PROGMEM
= "NETBOX";
576 static const char proto_nec16
[] PROGMEM
= "NEC16";
577 static const char proto_nec42
[] PROGMEM
= "NEC42";
578 static const char proto_lego
[] PROGMEM
= "LEGO";
579 static const char proto_thomson
[] PROGMEM
= "THOMSON";
580 static const char proto_bose
[] PROGMEM
= "BOSE";
581 static const char proto_a1tvbox
[] PROGMEM
= "A1TVBOX";
582 static const char proto_ortek
[] PROGMEM
= "ORTEK";
583 static const char proto_telefunken
[] PROGMEM
= "TELEFUNKEN";
584 static const char proto_roomba
[] PROGMEM
= "ROOMBA";
585 static const char proto_rcmm32
[] PROGMEM
= "RCMM32";
586 static const char proto_rcmm24
[] PROGMEM
= "RCMM24";
587 static const char proto_rcmm12
[] PROGMEM
= "RCMM12";
588 static const char proto_speaker
[] PROGMEM
= "SPEAKER";
589 static const char proto_lgair
[] PROGMEM
= "LGAIR";
590 static const char proto_samsung48
[] PROGMEM
= "SAMSG48";
591 static const char proto_merlin
[] PROGMEM
= "MERLIN";
592 static const char proto_pentax
[] PROGMEM
= "PENTAX";
593 static const char proto_fan
[] PROGMEM
= "FAN";
594 static const char proto_s100
[] PROGMEM
= "S100";
596 static const char proto_radio1
[] PROGMEM
= "RADIO1";
599 irmp_protocol_names
[IRMP_N_PROTOCOLS
+ 1] PROGMEM
=
652 /*---------------------------------------------------------------------------------------------------------------------------------------------------
654 *---------------------------------------------------------------------------------------------------------------------------------------------------
656 #if IRMP_LOGGING == 1 // logging via UART
658 #if defined(ARM_STM32F4XX)
659 # define STM32_GPIO_CLOCK RCC_AHB1Periph_GPIOA // UART2 on PA2
660 # define STM32_UART_CLOCK RCC_APB1Periph_USART2
661 # define STM32_GPIO_PORT GPIOA
662 # define STM32_GPIO_PIN GPIO_Pin_2
663 # define STM32_GPIO_SOURCE GPIO_PinSource2
664 # define STM32_UART_AF GPIO_AF_USART2
665 # define STM32_UART_COM USART2
666 # define STM32_UART_BAUD 115200 // 115200 Baud
667 # include "stm32f4xx_usart.h"
668 #elif defined(ARM_STM32F10X)
669 # define STM32_UART_COM USART3 // UART3 on PB10
671 # if IRMP_EXT_LOGGING == 1 // use external logging
672 # include "irmpextlog.h"
673 # else // normal UART log (IRMP_EXT_LOGGING == 0)
675 # ifndef UNIX_OR_WINDOWS
676 # include <util/setbaud.h>
681 #define UART0_UBRRH UBRR0H
682 #define UART0_UBRRL UBRR0L
683 #define UART0_UCSRA UCSR0A
684 #define UART0_UCSRB UCSR0B
685 #define UART0_UCSRC UCSR0C
686 #define UART0_UDRE_BIT_VALUE (1<<UDRE0)
687 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ01)
688 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ00)
690 #define UART0_URSEL_BIT_VALUE (1<<URSEL0)
692 #define UART0_URSEL_BIT_VALUE (0)
694 #define UART0_TXEN_BIT_VALUE (1<<TXEN0)
695 #define UART0_UDR UDR0
696 #define UART0_U2X U2X0
700 #define UART0_UBRRH UBRRH
701 #define UART0_UBRRL UBRRL
702 #define UART0_UCSRA UCSRA
703 #define UART0_UCSRB UCSRB
704 #define UART0_UCSRC UCSRC
705 #define UART0_UDRE_BIT_VALUE (1<<UDRE)
706 #define UART0_UCSZ1_BIT_VALUE (1<<UCSZ1)
707 #define UART0_UCSZ0_BIT_VALUE (1<<UCSZ0)
709 #define UART0_URSEL_BIT_VALUE (1<<URSEL)
711 #define UART0_URSEL_BIT_VALUE (0)
713 #define UART0_TXEN_BIT_VALUE (1<<TXEN)
714 #define UART0_UDR UDR
715 #define UART0_U2X U2X
718 #endif //IRMP_EXT_LOGGING
719 #endif //ARM_STM32F4XX
721 /*---------------------------------------------------------------------------------------------------------------------------------------------------
723 * @details Initializes UART
724 *---------------------------------------------------------------------------------------------------------------------------------------------------
727 irmp_uart_init (void)
729 #ifndef UNIX_OR_WINDOWS
730 #if defined(ARM_STM32F4XX)
731 GPIO_InitTypeDef GPIO_InitStructure
;
732 USART_InitTypeDef USART_InitStructure
;
734 // Clock enable vom TX Pin
735 RCC_AHB1PeriphClockCmd(STM32_GPIO_CLOCK
, ENABLE
);
737 // Clock enable der UART
738 RCC_APB1PeriphClockCmd(STM32_UART_CLOCK
, ENABLE
);
740 // UART Alternative-Funktion mit dem IO-Pin verbinden
741 GPIO_PinAFConfig(STM32_GPIO_PORT
,STM32_GPIO_SOURCE
,STM32_UART_AF
);
743 // UART als Alternative-Funktion mit PushPull
744 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF
;
745 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_100MHz
;
746 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
747 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_UP
;
750 GPIO_InitStructure
.GPIO_Pin
= STM32_GPIO_PIN
;
751 GPIO_Init(STM32_GPIO_PORT
, &GPIO_InitStructure
);
754 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
756 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
757 USART_InitStructure
.USART_BaudRate
= STM32_UART_BAUD
;
758 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
759 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
760 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
761 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
762 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
763 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
766 USART_Cmd(STM32_UART_COM
, ENABLE
);
768 #elif defined(ARM_STM32F10X)
769 GPIO_InitTypeDef GPIO_InitStructure
;
770 USART_InitTypeDef USART_InitStructure
;
772 // Clock enable vom TX Pin
773 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB
, ENABLE
); // UART3 an PB10
775 // Clock enable der UART
776 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3
, ENABLE
);
778 // UART als Alternative-Funktion mit PushPull
779 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_AF_PP
;
780 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_50MHz
;
783 GPIO_InitStructure
.GPIO_Pin
= GPIO_Pin_10
;
784 GPIO_Init(GPIOB
, &GPIO_InitStructure
);
787 USART_OverSampling8Cmd(STM32_UART_COM
, ENABLE
);
789 // init mit Baudrate, 8Databits, 1Stopbit, keine Parität, kein RTS+CTS
790 USART_InitStructure
.USART_BaudRate
= 115200;
791 USART_InitStructure
.USART_WordLength
= USART_WordLength_8b
;
792 USART_InitStructure
.USART_StopBits
= USART_StopBits_1
;
793 USART_InitStructure
.USART_Parity
= USART_Parity_No
;
794 USART_InitStructure
.USART_HardwareFlowControl
= USART_HardwareFlowControl_None
;
795 USART_InitStructure
.USART_Mode
= USART_Mode_Tx
;
796 USART_Init(STM32_UART_COM
, &USART_InitStructure
);
799 USART_Cmd(STM32_UART_COM
, ENABLE
);
801 #elif defined (__AVR_XMEGA__)
803 PMIC
.CTRL
|= PMIC_HILVLEN_bm
;
805 USARTC1
.BAUDCTRLB
= 0;
806 USARTC1
.BAUDCTRLA
= F_CPU
/153600-1;
807 USARTC1
.CTRLA
= USART_RXCINTLVL_HI_gc
; // High Level (Empfangen)
808 USARTC1
.CTRLB
= USART_TXEN_bm
| USART_RXEN_bm
; //Aktiviert Senden und Empfangen
809 USARTC1
.CTRLC
= USART_CHSIZE_8BIT_gc
; //Größe der Zeichen: 8 Bit
810 PORTC
.DIR |= (1<<7); //TXD als Ausgang setzen
811 PORTC
.DIR &= ~(1<<6);
815 #if (IRMP_EXT_LOGGING == 0) // use UART
816 UART0_UBRRH
= UBRRH_VALUE
; // set baud rate
817 UART0_UBRRL
= UBRRL_VALUE
;
820 UART0_UCSRA
|= (1<<UART0_U2X
);
822 UART0_UCSRA
&= ~(1<<UART0_U2X
);
825 UART0_UCSRC
= UART0_UCSZ1_BIT_VALUE
| UART0_UCSZ0_BIT_VALUE
| UART0_URSEL_BIT_VALUE
;
826 UART0_UCSRB
|= UART0_TXEN_BIT_VALUE
; // enable UART TX
827 #else // other log method
829 #endif //IRMP_EXT_LOGGING
830 #endif //ARM_STM32F4XX
831 #endif // UNIX_OR_WINDOWS
834 /*---------------------------------------------------------------------------------------------------------------------------------------------------
836 * @details Sends character
837 * @param ch character to be transmitted
838 *---------------------------------------------------------------------------------------------------------------------------------------------------
841 irmp_uart_putc (unsigned char ch
)
843 #ifndef UNIX_OR_WINDOWS
844 #if defined(ARM_STM32F4XX) || defined(ARM_STM32F10X)
845 // warten bis altes Byte gesendet wurde
846 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
)
851 USART_SendData(STM32_UART_COM
, ch
);
855 while (USART_GetFlagStatus(STM32_UART_COM
, USART_FLAG_TXE
) == RESET
);
856 USART_SendData(STM32_UART_COM
, '\r');
860 #if (IRMP_EXT_LOGGING == 0)
862 # if defined (__AVR_XMEGA__)
863 while (!(USARTC1
.STATUS
& USART_DREIF_bm
));
867 while (!(UART0_UCSRA
& UART0_UDRE_BIT_VALUE
))
873 #endif //__AVR_XMEGA__
876 sendextlog(ch
); // use external log
878 #endif //IRMP_EXT_LOGGING
879 #endif //ARM_STM32F4XX
882 #endif // UNIX_OR_WINDOWS
885 /*---------------------------------------------------------------------------------------------------------------------------------------------------
887 *---------------------------------------------------------------------------------------------------------------------------------------------------
890 #define STARTCYCLES 2 // min count of zeros before start of logging
891 #define ENDBITS 1000 // number of sequenced highbits to detect end
892 #define DATALEN 700 // log buffer size
895 irmp_log (uint_fast8_t val
)
897 static uint8_t buf
[DATALEN
]; // logging buffer
898 static uint_fast16_t buf_idx
; // index
899 static uint_fast8_t startcycles
; // current number of start-zeros
900 static uint_fast16_t cnt
; // counts sequenced highbits - to detect end
901 static uint_fast8_t last_val
= 1;
903 if (! val
&& (startcycles
< STARTCYCLES
) && !buf_idx
) // prevent that single random zeros init logging
911 if (! val
|| buf_idx
!= 0) // start or continue logging on "0", "1" cannot init logging
917 if (val
&& cnt
> ENDBITS
) // if high received then look at log-stop condition
918 { // if stop condition is true, output on uart
922 uint_fast8_t v
= '1';
925 for (i8
= 0; i8
< STARTCYCLES
; i8
++)
927 irmp_uart_putc ('0'); // the ignored starting zeros
930 for (i
= 0; i
< buf_idx
; i
++)
939 d
|= ((uint_fast16_t) buf
[i
] << 8);
942 for (j
= 0; j
< d
; j
++)
947 v
= (v
== '1') ? '0' : '1';
950 for (i8
= 0; i8
< 20; i8
++)
952 irmp_uart_putc ('1');
955 irmp_uart_putc ('\n');
961 else if (buf_idx
< DATALEN
- 3)
965 buf
[buf_idx
++] = 0xff;
966 buf
[buf_idx
++] = (cnt
& 0xff);
967 buf
[buf_idx
] = (cnt
>> 8);
983 #define irmp_log(val)
984 #endif //IRMP_LOGGING
988 uint_fast8_t protocol
; // ir protocol
989 uint_fast8_t pulse_1_len_min
; // minimum length of pulse with bit value 1
990 uint_fast8_t pulse_1_len_max
; // maximum length of pulse with bit value 1
991 uint_fast8_t pause_1_len_min
; // minimum length of pause with bit value 1
992 uint_fast8_t pause_1_len_max
; // maximum length of pause with bit value 1
993 uint_fast8_t pulse_0_len_min
; // minimum length of pulse with bit value 0
994 uint_fast8_t pulse_0_len_max
; // maximum length of pulse with bit value 0
995 uint_fast8_t pause_0_len_min
; // minimum length of pause with bit value 0
996 uint_fast8_t pause_0_len_max
; // maximum length of pause with bit value 0
997 uint_fast8_t address_offset
; // address offset
998 uint_fast8_t address_end
; // end of address
999 uint_fast8_t command_offset
; // command offset
1000 uint_fast8_t command_end
; // end of command
1001 uint_fast8_t complete_len
; // complete length of frame
1002 uint_fast8_t stop_bit
; // flag: frame has stop bit
1003 uint_fast8_t lsb_first
; // flag: LSB first
1004 uint_fast8_t flags
; // some flags
1007 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
1009 static const PROGMEM IRMP_PARAMETER sircs_param
=
1011 IRMP_SIRCS_PROTOCOL
, // protocol: ir protocol
1012 SIRCS_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1013 SIRCS_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1014 SIRCS_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1015 SIRCS_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1016 SIRCS_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1017 SIRCS_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1018 SIRCS_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1019 SIRCS_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1020 SIRCS_ADDRESS_OFFSET
, // address_offset: address offset
1021 SIRCS_ADDRESS_OFFSET
+ SIRCS_ADDRESS_LEN
, // address_end: end of address
1022 SIRCS_COMMAND_OFFSET
, // command_offset: command offset
1023 SIRCS_COMMAND_OFFSET
+ SIRCS_COMMAND_LEN
, // command_end: end of command
1024 SIRCS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1025 SIRCS_STOP_BIT
, // stop_bit: flag: frame has stop bit
1026 SIRCS_LSB
, // lsb_first: flag: LSB first
1027 SIRCS_FLAGS
// flags: some flags
1032 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
1034 static const PROGMEM IRMP_PARAMETER nec_param
=
1036 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1037 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1038 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1039 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1040 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1041 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1042 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1043 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1044 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1045 NEC_ADDRESS_OFFSET
, // address_offset: address offset
1046 NEC_ADDRESS_OFFSET
+ NEC_ADDRESS_LEN
, // address_end: end of address
1047 NEC_COMMAND_OFFSET
, // command_offset: command offset
1048 NEC_COMMAND_OFFSET
+ NEC_COMMAND_LEN
, // command_end: end of command
1049 NEC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1050 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1051 NEC_LSB
, // lsb_first: flag: LSB first
1052 NEC_FLAGS
// flags: some flags
1055 static const PROGMEM IRMP_PARAMETER nec_rep_param
=
1057 IRMP_NEC_PROTOCOL
, // protocol: ir protocol
1058 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1059 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1060 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1061 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1062 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1063 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1064 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1065 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1066 0, // address_offset: address offset
1067 0, // address_end: end of address
1068 0, // command_offset: command offset
1069 0, // command_end: end of command
1070 0, // complete_len: complete length of frame
1071 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1072 NEC_LSB
, // lsb_first: flag: LSB first
1073 NEC_FLAGS
// flags: some flags
1078 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
1080 static const PROGMEM IRMP_PARAMETER nec42_param
=
1082 IRMP_NEC42_PROTOCOL
, // protocol: ir protocol
1083 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1084 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1085 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1086 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1087 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1088 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1089 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1090 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1091 NEC42_ADDRESS_OFFSET
, // address_offset: address offset
1092 NEC42_ADDRESS_OFFSET
+ NEC42_ADDRESS_LEN
, // address_end: end of address
1093 NEC42_COMMAND_OFFSET
, // command_offset: command offset
1094 NEC42_COMMAND_OFFSET
+ NEC42_COMMAND_LEN
, // command_end: end of command
1095 NEC42_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1096 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1097 NEC_LSB
, // lsb_first: flag: LSB first
1098 NEC_FLAGS
// flags: some flags
1103 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
1105 static const PROGMEM IRMP_PARAMETER lgair_param
=
1107 IRMP_LGAIR_PROTOCOL
, // protocol: ir protocol
1108 NEC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1109 NEC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1110 NEC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1111 NEC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1112 NEC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1113 NEC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1114 NEC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1115 NEC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1116 LGAIR_ADDRESS_OFFSET
, // address_offset: address offset
1117 LGAIR_ADDRESS_OFFSET
+ LGAIR_ADDRESS_LEN
, // address_end: end of address
1118 LGAIR_COMMAND_OFFSET
, // command_offset: command offset
1119 LGAIR_COMMAND_OFFSET
+ LGAIR_COMMAND_LEN
, // command_end: end of command
1120 LGAIR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1121 NEC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1122 NEC_LSB
, // lsb_first: flag: LSB first
1123 NEC_FLAGS
// flags: some flags
1128 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
1130 static const PROGMEM IRMP_PARAMETER samsung_param
=
1132 IRMP_SAMSUNG_PROTOCOL
, // protocol: ir protocol
1133 SAMSUNG_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1134 SAMSUNG_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1135 SAMSUNG_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1136 SAMSUNG_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1137 SAMSUNG_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1138 SAMSUNG_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1139 SAMSUNG_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1140 SAMSUNG_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1141 SAMSUNG_ADDRESS_OFFSET
, // address_offset: address offset
1142 SAMSUNG_ADDRESS_OFFSET
+ SAMSUNG_ADDRESS_LEN
, // address_end: end of address
1143 SAMSUNG_COMMAND_OFFSET
, // command_offset: command offset
1144 SAMSUNG_COMMAND_OFFSET
+ SAMSUNG_COMMAND_LEN
, // command_end: end of command
1145 SAMSUNG_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1146 SAMSUNG_STOP_BIT
, // stop_bit: flag: frame has stop bit
1147 SAMSUNG_LSB
, // lsb_first: flag: LSB first
1148 SAMSUNG_FLAGS
// flags: some flags
1153 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
1155 static const PROGMEM IRMP_PARAMETER telefunken_param
=
1157 IRMP_TELEFUNKEN_PROTOCOL
, // protocol: ir protocol
1158 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1159 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1160 TELEFUNKEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1161 TELEFUNKEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1162 TELEFUNKEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1163 TELEFUNKEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1164 TELEFUNKEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1165 TELEFUNKEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1166 TELEFUNKEN_ADDRESS_OFFSET
, // address_offset: address offset
1167 TELEFUNKEN_ADDRESS_OFFSET
+ TELEFUNKEN_ADDRESS_LEN
, // address_end: end of address
1168 TELEFUNKEN_COMMAND_OFFSET
, // command_offset: command offset
1169 TELEFUNKEN_COMMAND_OFFSET
+ TELEFUNKEN_COMMAND_LEN
, // command_end: end of command
1170 TELEFUNKEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1171 TELEFUNKEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1172 TELEFUNKEN_LSB
, // lsb_first: flag: LSB first
1173 TELEFUNKEN_FLAGS
// flags: some flags
1178 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
1180 static const PROGMEM IRMP_PARAMETER matsushita_param
=
1182 IRMP_MATSUSHITA_PROTOCOL
, // protocol: ir protocol
1183 MATSUSHITA_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1184 MATSUSHITA_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1185 MATSUSHITA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1186 MATSUSHITA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1187 MATSUSHITA_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1188 MATSUSHITA_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1189 MATSUSHITA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1190 MATSUSHITA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1191 MATSUSHITA_ADDRESS_OFFSET
, // address_offset: address offset
1192 MATSUSHITA_ADDRESS_OFFSET
+ MATSUSHITA_ADDRESS_LEN
, // address_end: end of address
1193 MATSUSHITA_COMMAND_OFFSET
, // command_offset: command offset
1194 MATSUSHITA_COMMAND_OFFSET
+ MATSUSHITA_COMMAND_LEN
, // command_end: end of command
1195 MATSUSHITA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1196 MATSUSHITA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1197 MATSUSHITA_LSB
, // lsb_first: flag: LSB first
1198 MATSUSHITA_FLAGS
// flags: some flags
1203 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
1205 static const PROGMEM IRMP_PARAMETER kaseikyo_param
=
1207 IRMP_KASEIKYO_PROTOCOL
, // protocol: ir protocol
1208 KASEIKYO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1209 KASEIKYO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1210 KASEIKYO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1211 KASEIKYO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1212 KASEIKYO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1213 KASEIKYO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1214 KASEIKYO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1215 KASEIKYO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1216 KASEIKYO_ADDRESS_OFFSET
, // address_offset: address offset
1217 KASEIKYO_ADDRESS_OFFSET
+ KASEIKYO_ADDRESS_LEN
, // address_end: end of address
1218 KASEIKYO_COMMAND_OFFSET
, // command_offset: command offset
1219 KASEIKYO_COMMAND_OFFSET
+ KASEIKYO_COMMAND_LEN
, // command_end: end of command
1220 KASEIKYO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1221 KASEIKYO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1222 KASEIKYO_LSB
, // lsb_first: flag: LSB first
1223 KASEIKYO_FLAGS
// flags: some flags
1228 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
1230 static const PROGMEM IRMP_PARAMETER recs80_param
=
1232 IRMP_RECS80_PROTOCOL
, // protocol: ir protocol
1233 RECS80_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1234 RECS80_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1235 RECS80_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1236 RECS80_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1237 RECS80_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1238 RECS80_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1239 RECS80_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1240 RECS80_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1241 RECS80_ADDRESS_OFFSET
, // address_offset: address offset
1242 RECS80_ADDRESS_OFFSET
+ RECS80_ADDRESS_LEN
, // address_end: end of address
1243 RECS80_COMMAND_OFFSET
, // command_offset: command offset
1244 RECS80_COMMAND_OFFSET
+ RECS80_COMMAND_LEN
, // command_end: end of command
1245 RECS80_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1246 RECS80_STOP_BIT
, // stop_bit: flag: frame has stop bit
1247 RECS80_LSB
, // lsb_first: flag: LSB first
1248 RECS80_FLAGS
// flags: some flags
1253 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
1255 static const PROGMEM IRMP_PARAMETER rc5_param
=
1257 IRMP_RC5_PROTOCOL
, // protocol: ir protocol
1258 RC5_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1259 RC5_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1260 RC5_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1261 RC5_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1262 0, // pulse_0_len_min: here: not used
1263 0, // pulse_0_len_max: here: not used
1264 0, // pause_0_len_min: here: not used
1265 0, // pause_0_len_max: here: not used
1266 RC5_ADDRESS_OFFSET
, // address_offset: address offset
1267 RC5_ADDRESS_OFFSET
+ RC5_ADDRESS_LEN
, // address_end: end of address
1268 RC5_COMMAND_OFFSET
, // command_offset: command offset
1269 RC5_COMMAND_OFFSET
+ RC5_COMMAND_LEN
, // command_end: end of command
1270 RC5_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1271 RC5_STOP_BIT
, // stop_bit: flag: frame has stop bit
1272 RC5_LSB
, // lsb_first: flag: LSB first
1273 RC5_FLAGS
// flags: some flags
1278 #if IRMP_SUPPORT_S100_PROTOCOL == 1
1280 static const PROGMEM IRMP_PARAMETER s100_param
=
1282 IRMP_S100_PROTOCOL
, // protocol: ir protocol
1283 S100_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1284 S100_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1285 S100_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1286 S100_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1287 0, // pulse_0_len_min: here: not used
1288 0, // pulse_0_len_max: here: not used
1289 0, // pause_0_len_min: here: not used
1290 0, // pause_0_len_max: here: not used
1291 S100_ADDRESS_OFFSET
, // address_offset: address offset
1292 S100_ADDRESS_OFFSET
+ S100_ADDRESS_LEN
, // address_end: end of address
1293 S100_COMMAND_OFFSET
, // command_offset: command offset
1294 S100_COMMAND_OFFSET
+ S100_COMMAND_LEN
, // command_end: end of command
1295 S100_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1296 S100_STOP_BIT
, // stop_bit: flag: frame has stop bit
1297 S100_LSB
, // lsb_first: flag: LSB first
1298 S100_FLAGS
// flags: some flags
1303 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
1305 static const PROGMEM IRMP_PARAMETER denon_param
=
1307 IRMP_DENON_PROTOCOL
, // protocol: ir protocol
1308 DENON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1309 DENON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1310 DENON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1311 DENON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1312 DENON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1313 DENON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1314 DENON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1315 DENON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1316 DENON_ADDRESS_OFFSET
, // address_offset: address offset
1317 DENON_ADDRESS_OFFSET
+ DENON_ADDRESS_LEN
, // address_end: end of address
1318 DENON_COMMAND_OFFSET
, // command_offset: command offset
1319 DENON_COMMAND_OFFSET
+ DENON_COMMAND_LEN
, // command_end: end of command
1320 DENON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1321 DENON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1322 DENON_LSB
, // lsb_first: flag: LSB first
1323 DENON_FLAGS
// flags: some flags
1328 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
1330 static const PROGMEM IRMP_PARAMETER rc6_param
=
1332 IRMP_RC6_PROTOCOL
, // protocol: ir protocol
1334 RC6_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1335 RC6_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1336 RC6_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1337 RC6_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1338 0, // pulse_0_len_min: here: not used
1339 0, // pulse_0_len_max: here: not used
1340 0, // pause_0_len_min: here: not used
1341 0, // pause_0_len_max: here: not used
1342 RC6_ADDRESS_OFFSET
, // address_offset: address offset
1343 RC6_ADDRESS_OFFSET
+ RC6_ADDRESS_LEN
, // address_end: end of address
1344 RC6_COMMAND_OFFSET
, // command_offset: command offset
1345 RC6_COMMAND_OFFSET
+ RC6_COMMAND_LEN
, // command_end: end of command
1346 RC6_COMPLETE_DATA_LEN_SHORT
, // complete_len: complete length of frame
1347 RC6_STOP_BIT
, // stop_bit: flag: frame has stop bit
1348 RC6_LSB
, // lsb_first: flag: LSB first
1349 RC6_FLAGS
// flags: some flags
1354 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
1356 static const PROGMEM IRMP_PARAMETER recs80ext_param
=
1358 IRMP_RECS80EXT_PROTOCOL
, // protocol: ir protocol
1359 RECS80EXT_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1360 RECS80EXT_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1361 RECS80EXT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1362 RECS80EXT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1363 RECS80EXT_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1364 RECS80EXT_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1365 RECS80EXT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1366 RECS80EXT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1367 RECS80EXT_ADDRESS_OFFSET
, // address_offset: address offset
1368 RECS80EXT_ADDRESS_OFFSET
+ RECS80EXT_ADDRESS_LEN
, // address_end: end of address
1369 RECS80EXT_COMMAND_OFFSET
, // command_offset: command offset
1370 RECS80EXT_COMMAND_OFFSET
+ RECS80EXT_COMMAND_LEN
, // command_end: end of command
1371 RECS80EXT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1372 RECS80EXT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1373 RECS80EXT_LSB
, // lsb_first: flag: LSB first
1374 RECS80EXT_FLAGS
// flags: some flags
1379 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
1381 static const PROGMEM IRMP_PARAMETER nubert_param
=
1383 IRMP_NUBERT_PROTOCOL
, // protocol: ir protocol
1384 NUBERT_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1385 NUBERT_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1386 NUBERT_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1387 NUBERT_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1388 NUBERT_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1389 NUBERT_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1390 NUBERT_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1391 NUBERT_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1392 NUBERT_ADDRESS_OFFSET
, // address_offset: address offset
1393 NUBERT_ADDRESS_OFFSET
+ NUBERT_ADDRESS_LEN
, // address_end: end of address
1394 NUBERT_COMMAND_OFFSET
, // command_offset: command offset
1395 NUBERT_COMMAND_OFFSET
+ NUBERT_COMMAND_LEN
, // command_end: end of command
1396 NUBERT_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1397 NUBERT_STOP_BIT
, // stop_bit: flag: frame has stop bit
1398 NUBERT_LSB
, // lsb_first: flag: LSB first
1399 NUBERT_FLAGS
// flags: some flags
1404 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
1406 static const PROGMEM IRMP_PARAMETER fan_param
=
1408 IRMP_FAN_PROTOCOL
, // protocol: ir protocol
1409 FAN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1410 FAN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1411 FAN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1412 FAN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1413 FAN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1414 FAN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1415 FAN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1416 FAN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1417 FAN_ADDRESS_OFFSET
, // address_offset: address offset
1418 FAN_ADDRESS_OFFSET
+ FAN_ADDRESS_LEN
, // address_end: end of address
1419 FAN_COMMAND_OFFSET
, // command_offset: command offset
1420 FAN_COMMAND_OFFSET
+ FAN_COMMAND_LEN
, // command_end: end of command
1421 FAN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1422 FAN_STOP_BIT
, // stop_bit: flag: frame has NO stop bit
1423 FAN_LSB
, // lsb_first: flag: LSB first
1424 FAN_FLAGS
// flags: some flags
1429 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
1431 static const PROGMEM IRMP_PARAMETER speaker_param
=
1433 IRMP_SPEAKER_PROTOCOL
, // protocol: ir protocol
1434 SPEAKER_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1435 SPEAKER_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1436 SPEAKER_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1437 SPEAKER_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1438 SPEAKER_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1439 SPEAKER_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1440 SPEAKER_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1441 SPEAKER_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1442 SPEAKER_ADDRESS_OFFSET
, // address_offset: address offset
1443 SPEAKER_ADDRESS_OFFSET
+ SPEAKER_ADDRESS_LEN
, // address_end: end of address
1444 SPEAKER_COMMAND_OFFSET
, // command_offset: command offset
1445 SPEAKER_COMMAND_OFFSET
+ SPEAKER_COMMAND_LEN
, // command_end: end of command
1446 SPEAKER_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1447 SPEAKER_STOP_BIT
, // stop_bit: flag: frame has stop bit
1448 SPEAKER_LSB
, // lsb_first: flag: LSB first
1449 SPEAKER_FLAGS
// flags: some flags
1454 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
1456 static const PROGMEM IRMP_PARAMETER bang_olufsen_param
=
1458 IRMP_BANG_OLUFSEN_PROTOCOL
, // protocol: ir protocol
1459 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1460 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1461 BANG_OLUFSEN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1462 BANG_OLUFSEN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1463 BANG_OLUFSEN_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1464 BANG_OLUFSEN_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1465 BANG_OLUFSEN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1466 BANG_OLUFSEN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1467 BANG_OLUFSEN_ADDRESS_OFFSET
, // address_offset: address offset
1468 BANG_OLUFSEN_ADDRESS_OFFSET
+ BANG_OLUFSEN_ADDRESS_LEN
, // address_end: end of address
1469 BANG_OLUFSEN_COMMAND_OFFSET
, // command_offset: command offset
1470 BANG_OLUFSEN_COMMAND_OFFSET
+ BANG_OLUFSEN_COMMAND_LEN
, // command_end: end of command
1471 BANG_OLUFSEN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1472 BANG_OLUFSEN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1473 BANG_OLUFSEN_LSB
, // lsb_first: flag: LSB first
1474 BANG_OLUFSEN_FLAGS
// flags: some flags
1479 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
1481 static uint_fast8_t first_bit
;
1483 static const PROGMEM IRMP_PARAMETER grundig_param
=
1485 IRMP_GRUNDIG_PROTOCOL
, // protocol: ir protocol
1487 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1488 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1489 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1490 GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1491 0, // pulse_0_len_min: here: not used
1492 0, // pulse_0_len_max: here: not used
1493 0, // pause_0_len_min: here: not used
1494 0, // pause_0_len_max: here: not used
1495 GRUNDIG_ADDRESS_OFFSET
, // address_offset: address offset
1496 GRUNDIG_ADDRESS_OFFSET
+ GRUNDIG_ADDRESS_LEN
, // address_end: end of address
1497 GRUNDIG_COMMAND_OFFSET
, // command_offset: command offset
1498 GRUNDIG_COMMAND_OFFSET
+ GRUNDIG_COMMAND_LEN
+ 1, // command_end: end of command (USE 1 bit MORE to STORE NOKIA DATA!)
1499 NOKIA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: NOKIA instead of GRUNDIG!
1500 GRUNDIG_NOKIA_IR60_STOP_BIT
, // stop_bit: flag: frame has stop bit
1501 GRUNDIG_NOKIA_IR60_LSB
, // lsb_first: flag: LSB first
1502 GRUNDIG_NOKIA_IR60_FLAGS
// flags: some flags
1507 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
1509 static const PROGMEM IRMP_PARAMETER ruwido_param
=
1511 IRMP_RUWIDO_PROTOCOL
, // protocol: ir protocol
1512 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1513 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1514 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1515 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1516 0, // pulse_0_len_min: here: not used
1517 0, // pulse_0_len_max: here: not used
1518 0, // pause_0_len_min: here: not used
1519 0, // pause_0_len_max: here: not used
1520 RUWIDO_ADDRESS_OFFSET
, // address_offset: address offset
1521 RUWIDO_ADDRESS_OFFSET
+ RUWIDO_ADDRESS_LEN
, // address_end: end of address
1522 RUWIDO_COMMAND_OFFSET
, // command_offset: command offset
1523 RUWIDO_COMMAND_OFFSET
+ RUWIDO_COMMAND_LEN
, // command_end: end of command
1524 SIEMENS_COMPLETE_DATA_LEN
, // complete_len: complete length of frame, here: SIEMENS instead of RUWIDO!
1525 SIEMENS_OR_RUWIDO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1526 SIEMENS_OR_RUWIDO_LSB
, // lsb_first: flag: LSB first
1527 SIEMENS_OR_RUWIDO_FLAGS
// flags: some flags
1532 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
1534 static const PROGMEM IRMP_PARAMETER fdc_param
=
1536 IRMP_FDC_PROTOCOL
, // protocol: ir protocol
1537 FDC_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1538 FDC_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1539 FDC_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1540 FDC_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1541 FDC_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1542 FDC_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1543 FDC_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1544 FDC_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1545 FDC_ADDRESS_OFFSET
, // address_offset: address offset
1546 FDC_ADDRESS_OFFSET
+ FDC_ADDRESS_LEN
, // address_end: end of address
1547 FDC_COMMAND_OFFSET
, // command_offset: command offset
1548 FDC_COMMAND_OFFSET
+ FDC_COMMAND_LEN
, // command_end: end of command
1549 FDC_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1550 FDC_STOP_BIT
, // stop_bit: flag: frame has stop bit
1551 FDC_LSB
, // lsb_first: flag: LSB first
1552 FDC_FLAGS
// flags: some flags
1557 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
1559 static const PROGMEM IRMP_PARAMETER rccar_param
=
1561 IRMP_RCCAR_PROTOCOL
, // protocol: ir protocol
1562 RCCAR_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1563 RCCAR_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1564 RCCAR_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1565 RCCAR_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1566 RCCAR_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1567 RCCAR_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1568 RCCAR_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1569 RCCAR_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1570 RCCAR_ADDRESS_OFFSET
, // address_offset: address offset
1571 RCCAR_ADDRESS_OFFSET
+ RCCAR_ADDRESS_LEN
, // address_end: end of address
1572 RCCAR_COMMAND_OFFSET
, // command_offset: command offset
1573 RCCAR_COMMAND_OFFSET
+ RCCAR_COMMAND_LEN
, // command_end: end of command
1574 RCCAR_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1575 RCCAR_STOP_BIT
, // stop_bit: flag: frame has stop bit
1576 RCCAR_LSB
, // lsb_first: flag: LSB first
1577 RCCAR_FLAGS
// flags: some flags
1582 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
1584 static const PROGMEM IRMP_PARAMETER nikon_param
=
1586 IRMP_NIKON_PROTOCOL
, // protocol: ir protocol
1587 NIKON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1588 NIKON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1589 NIKON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1590 NIKON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1591 NIKON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1592 NIKON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1593 NIKON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1594 NIKON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1595 NIKON_ADDRESS_OFFSET
, // address_offset: address offset
1596 NIKON_ADDRESS_OFFSET
+ NIKON_ADDRESS_LEN
, // address_end: end of address
1597 NIKON_COMMAND_OFFSET
, // command_offset: command offset
1598 NIKON_COMMAND_OFFSET
+ NIKON_COMMAND_LEN
, // command_end: end of command
1599 NIKON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1600 NIKON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1601 NIKON_LSB
, // lsb_first: flag: LSB first
1602 NIKON_FLAGS
// flags: some flags
1607 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
1609 static const PROGMEM IRMP_PARAMETER kathrein_param
=
1611 IRMP_KATHREIN_PROTOCOL
, // protocol: ir protocol
1612 KATHREIN_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1613 KATHREIN_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1614 KATHREIN_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1615 KATHREIN_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1616 KATHREIN_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1617 KATHREIN_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1618 KATHREIN_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1619 KATHREIN_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1620 KATHREIN_ADDRESS_OFFSET
, // address_offset: address offset
1621 KATHREIN_ADDRESS_OFFSET
+ KATHREIN_ADDRESS_LEN
, // address_end: end of address
1622 KATHREIN_COMMAND_OFFSET
, // command_offset: command offset
1623 KATHREIN_COMMAND_OFFSET
+ KATHREIN_COMMAND_LEN
, // command_end: end of command
1624 KATHREIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1625 KATHREIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1626 KATHREIN_LSB
, // lsb_first: flag: LSB first
1627 KATHREIN_FLAGS
// flags: some flags
1632 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
1634 static const PROGMEM IRMP_PARAMETER netbox_param
=
1636 IRMP_NETBOX_PROTOCOL
, // protocol: ir protocol
1637 NETBOX_PULSE_LEN
, // pulse_1_len_min: minimum length of pulse with bit value 1, here: exact value
1638 NETBOX_PULSE_REST_LEN
, // pulse_1_len_max: maximum length of pulse with bit value 1, here: rest value
1639 NETBOX_PAUSE_LEN
, // pause_1_len_min: minimum length of pause with bit value 1, here: exact value
1640 NETBOX_PAUSE_REST_LEN
, // pause_1_len_max: maximum length of pause with bit value 1, here: rest value
1641 NETBOX_PULSE_LEN
, // pulse_0_len_min: minimum length of pulse with bit value 0, here: exact value
1642 NETBOX_PULSE_REST_LEN
, // pulse_0_len_max: maximum length of pulse with bit value 0, here: rest value
1643 NETBOX_PAUSE_LEN
, // pause_0_len_min: minimum length of pause with bit value 0, here: exact value
1644 NETBOX_PAUSE_REST_LEN
, // pause_0_len_max: maximum length of pause with bit value 0, here: rest value
1645 NETBOX_ADDRESS_OFFSET
, // address_offset: address offset
1646 NETBOX_ADDRESS_OFFSET
+ NETBOX_ADDRESS_LEN
, // address_end: end of address
1647 NETBOX_COMMAND_OFFSET
, // command_offset: command offset
1648 NETBOX_COMMAND_OFFSET
+ NETBOX_COMMAND_LEN
, // command_end: end of command
1649 NETBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1650 NETBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1651 NETBOX_LSB
, // lsb_first: flag: LSB first
1652 NETBOX_FLAGS
// flags: some flags
1657 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
1659 static const PROGMEM IRMP_PARAMETER lego_param
=
1661 IRMP_LEGO_PROTOCOL
, // protocol: ir protocol
1662 LEGO_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1663 LEGO_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1664 LEGO_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1665 LEGO_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1666 LEGO_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1667 LEGO_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1668 LEGO_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1669 LEGO_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1670 LEGO_ADDRESS_OFFSET
, // address_offset: address offset
1671 LEGO_ADDRESS_OFFSET
+ LEGO_ADDRESS_LEN
, // address_end: end of address
1672 LEGO_COMMAND_OFFSET
, // command_offset: command offset
1673 LEGO_COMMAND_OFFSET
+ LEGO_COMMAND_LEN
, // command_end: end of command
1674 LEGO_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1675 LEGO_STOP_BIT
, // stop_bit: flag: frame has stop bit
1676 LEGO_LSB
, // lsb_first: flag: LSB first
1677 LEGO_FLAGS
// flags: some flags
1682 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
1684 static const PROGMEM IRMP_PARAMETER thomson_param
=
1686 IRMP_THOMSON_PROTOCOL
, // protocol: ir protocol
1687 THOMSON_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1688 THOMSON_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1689 THOMSON_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1690 THOMSON_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1691 THOMSON_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1692 THOMSON_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1693 THOMSON_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1694 THOMSON_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1695 THOMSON_ADDRESS_OFFSET
, // address_offset: address offset
1696 THOMSON_ADDRESS_OFFSET
+ THOMSON_ADDRESS_LEN
, // address_end: end of address
1697 THOMSON_COMMAND_OFFSET
, // command_offset: command offset
1698 THOMSON_COMMAND_OFFSET
+ THOMSON_COMMAND_LEN
, // command_end: end of command
1699 THOMSON_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1700 THOMSON_STOP_BIT
, // stop_bit: flag: frame has stop bit
1701 THOMSON_LSB
, // lsb_first: flag: LSB first
1702 THOMSON_FLAGS
// flags: some flags
1707 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
1709 static const PROGMEM IRMP_PARAMETER bose_param
=
1711 IRMP_BOSE_PROTOCOL
, // protocol: ir protocol
1712 BOSE_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1713 BOSE_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1714 BOSE_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1715 BOSE_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1716 BOSE_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1717 BOSE_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1718 BOSE_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1719 BOSE_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1720 BOSE_ADDRESS_OFFSET
, // address_offset: address offset
1721 BOSE_ADDRESS_OFFSET
+ BOSE_ADDRESS_LEN
, // address_end: end of address
1722 BOSE_COMMAND_OFFSET
, // command_offset: command offset
1723 BOSE_COMMAND_OFFSET
+ BOSE_COMMAND_LEN
, // command_end: end of command
1724 BOSE_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1725 BOSE_STOP_BIT
, // stop_bit: flag: frame has stop bit
1726 BOSE_LSB
, // lsb_first: flag: LSB first
1727 BOSE_FLAGS
// flags: some flags
1732 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
1734 static const PROGMEM IRMP_PARAMETER a1tvbox_param
=
1736 IRMP_A1TVBOX_PROTOCOL
, // protocol: ir protocol
1738 A1TVBOX_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1739 A1TVBOX_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1740 A1TVBOX_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1741 A1TVBOX_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1742 0, // pulse_0_len_min: here: not used
1743 0, // pulse_0_len_max: here: not used
1744 0, // pause_0_len_min: here: not used
1745 0, // pause_0_len_max: here: not used
1746 A1TVBOX_ADDRESS_OFFSET
, // address_offset: address offset
1747 A1TVBOX_ADDRESS_OFFSET
+ A1TVBOX_ADDRESS_LEN
, // address_end: end of address
1748 A1TVBOX_COMMAND_OFFSET
, // command_offset: command offset
1749 A1TVBOX_COMMAND_OFFSET
+ A1TVBOX_COMMAND_LEN
, // command_end: end of command
1750 A1TVBOX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1751 A1TVBOX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1752 A1TVBOX_LSB
, // lsb_first: flag: LSB first
1753 A1TVBOX_FLAGS
// flags: some flags
1758 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
1760 static const PROGMEM IRMP_PARAMETER merlin_param
=
1762 IRMP_MERLIN_PROTOCOL
, // protocol: ir protocol
1764 MERLIN_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1765 MERLIN_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1766 MERLIN_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1767 MERLIN_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1768 0, // pulse_0_len_min: here: not used
1769 0, // pulse_0_len_max: here: not used
1770 0, // pause_0_len_min: here: not used
1771 0, // pause_0_len_max: here: not used
1772 MERLIN_ADDRESS_OFFSET
, // address_offset: address offset
1773 MERLIN_ADDRESS_OFFSET
+ MERLIN_ADDRESS_LEN
, // address_end: end of address
1774 MERLIN_COMMAND_OFFSET
, // command_offset: command offset
1775 MERLIN_COMMAND_OFFSET
+ MERLIN_COMMAND_LEN
, // command_end: end of command
1776 MERLIN_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1777 MERLIN_STOP_BIT
, // stop_bit: flag: frame has stop bit
1778 MERLIN_LSB
, // lsb_first: flag: LSB first
1779 MERLIN_FLAGS
// flags: some flags
1784 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
1786 static const PROGMEM IRMP_PARAMETER ortek_param
=
1788 IRMP_ORTEK_PROTOCOL
, // protocol: ir protocol
1790 ORTEK_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1791 ORTEK_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1792 ORTEK_BIT_PAUSE_LEN_MIN
, // pause_1_len_min: here: minimum length of short pause
1793 ORTEK_BIT_PAUSE_LEN_MAX
, // pause_1_len_max: here: maximum length of short pause
1794 0, // pulse_0_len_min: here: not used
1795 0, // pulse_0_len_max: here: not used
1796 0, // pause_0_len_min: here: not used
1797 0, // pause_0_len_max: here: not used
1798 ORTEK_ADDRESS_OFFSET
, // address_offset: address offset
1799 ORTEK_ADDRESS_OFFSET
+ ORTEK_ADDRESS_LEN
, // address_end: end of address
1800 ORTEK_COMMAND_OFFSET
, // command_offset: command offset
1801 ORTEK_COMMAND_OFFSET
+ ORTEK_COMMAND_LEN
, // command_end: end of command
1802 ORTEK_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1803 ORTEK_STOP_BIT
, // stop_bit: flag: frame has stop bit
1804 ORTEK_LSB
, // lsb_first: flag: LSB first
1805 ORTEK_FLAGS
// flags: some flags
1810 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
1812 static const PROGMEM IRMP_PARAMETER roomba_param
=
1814 IRMP_ROOMBA_PROTOCOL
, // protocol: ir protocol
1815 ROOMBA_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1816 ROOMBA_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1817 ROOMBA_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1818 ROOMBA_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1819 ROOMBA_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1820 ROOMBA_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1821 ROOMBA_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1822 ROOMBA_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1823 ROOMBA_ADDRESS_OFFSET
, // address_offset: address offset
1824 ROOMBA_ADDRESS_OFFSET
+ ROOMBA_ADDRESS_LEN
, // address_end: end of address
1825 ROOMBA_COMMAND_OFFSET
, // command_offset: command offset
1826 ROOMBA_COMMAND_OFFSET
+ ROOMBA_COMMAND_LEN
, // command_end: end of command
1827 ROOMBA_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1828 ROOMBA_STOP_BIT
, // stop_bit: flag: frame has stop bit
1829 ROOMBA_LSB
, // lsb_first: flag: LSB first
1830 ROOMBA_FLAGS
// flags: some flags
1835 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
1837 static const PROGMEM IRMP_PARAMETER rcmm_param
=
1839 IRMP_RCMM32_PROTOCOL
, // protocol: ir protocol
1841 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_1_len_min: here: minimum length of short pulse
1842 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_1_len_max: here: maximum length of short pulse
1843 0, // pause_1_len_min: here: minimum length of short pause
1844 0, // pause_1_len_max: here: maximum length of short pause
1845 RCMM32_BIT_PULSE_LEN_MIN
, // pulse_0_len_min: here: not used
1846 RCMM32_BIT_PULSE_LEN_MAX
, // pulse_0_len_max: here: not used
1847 0, // pause_0_len_min: here: not used
1848 0, // pause_0_len_max: here: not used
1849 RCMM32_ADDRESS_OFFSET
, // address_offset: address offset
1850 RCMM32_ADDRESS_OFFSET
+ RCMM32_ADDRESS_LEN
, // address_end: end of address
1851 RCMM32_COMMAND_OFFSET
, // command_offset: command offset
1852 RCMM32_COMMAND_OFFSET
+ RCMM32_COMMAND_LEN
, // command_end: end of command
1853 RCMM32_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1854 RCMM32_STOP_BIT
, // stop_bit: flag: frame has stop bit
1855 RCMM32_LSB
, // lsb_first: flag: LSB first
1856 RCMM32_FLAGS
// flags: some flags
1861 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
1863 static const PROGMEM IRMP_PARAMETER pentax_param
=
1865 IRMP_PENTAX_PROTOCOL
, // protocol: ir protocol
1866 PENTAX_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1867 PENTAX_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1868 PENTAX_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1869 PENTAX_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1870 PENTAX_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1871 PENTAX_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1872 PENTAX_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1873 PENTAX_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1874 PENTAX_ADDRESS_OFFSET
, // address_offset: address offset
1875 PENTAX_ADDRESS_OFFSET
+ PENTAX_ADDRESS_LEN
, // address_end: end of address
1876 PENTAX_COMMAND_OFFSET
, // command_offset: command offset
1877 PENTAX_COMMAND_OFFSET
+ PENTAX_COMMAND_LEN
, // command_end: end of command
1878 PENTAX_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1879 PENTAX_STOP_BIT
, // stop_bit: flag: frame has stop bit
1880 PENTAX_LSB
, // lsb_first: flag: LSB first
1881 PENTAX_FLAGS
// flags: some flags
1886 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
1888 static const PROGMEM IRMP_PARAMETER radio1_param
=
1890 IRMP_RADIO1_PROTOCOL
, // protocol: ir protocol
1892 RADIO1_1_PULSE_LEN_MIN
, // pulse_1_len_min: minimum length of pulse with bit value 1
1893 RADIO1_1_PULSE_LEN_MAX
, // pulse_1_len_max: maximum length of pulse with bit value 1
1894 RADIO1_1_PAUSE_LEN_MIN
, // pause_1_len_min: minimum length of pause with bit value 1
1895 RADIO1_1_PAUSE_LEN_MAX
, // pause_1_len_max: maximum length of pause with bit value 1
1896 RADIO1_0_PULSE_LEN_MIN
, // pulse_0_len_min: minimum length of pulse with bit value 0
1897 RADIO1_0_PULSE_LEN_MAX
, // pulse_0_len_max: maximum length of pulse with bit value 0
1898 RADIO1_0_PAUSE_LEN_MIN
, // pause_0_len_min: minimum length of pause with bit value 0
1899 RADIO1_0_PAUSE_LEN_MAX
, // pause_0_len_max: maximum length of pause with bit value 0
1900 RADIO1_ADDRESS_OFFSET
, // address_offset: address offset
1901 RADIO1_ADDRESS_OFFSET
+ RADIO1_ADDRESS_LEN
, // address_end: end of address
1902 RADIO1_COMMAND_OFFSET
, // command_offset: command offset
1903 RADIO1_COMMAND_OFFSET
+ RADIO1_COMMAND_LEN
, // command_end: end of command
1904 RADIO1_COMPLETE_DATA_LEN
, // complete_len: complete length of frame
1905 RADIO1_STOP_BIT
, // stop_bit: flag: frame has stop bit
1906 RADIO1_LSB
, // lsb_first: flag: LSB first
1907 RADIO1_FLAGS
// flags: some flags
1912 static uint_fast8_t irmp_bit
; // current bit position
1913 static IRMP_PARAMETER irmp_param
;
1915 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
1916 static IRMP_PARAMETER irmp_param2
;
1919 static volatile uint_fast8_t irmp_ir_detected
= FALSE
;
1920 static volatile uint_fast8_t irmp_protocol
;
1921 static volatile uint_fast16_t irmp_address
;
1922 static volatile uint_fast16_t irmp_command
;
1923 static volatile uint_fast16_t irmp_id
; // only used for SAMSUNG protocol
1924 static volatile uint_fast8_t irmp_flags
;
1925 // static volatile uint_fast8_t irmp_busy_flag;
1928 #define input(x) (x)
1929 static uint_fast8_t IRMP_PIN
;
1930 static uint_fast8_t radio
;
1933 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1934 * Initialize IRMP decoder
1935 * @details Configures IRMP input pin
1936 *---------------------------------------------------------------------------------------------------------------------------------------------------
1942 #if defined(PIC_CCS) || defined(PIC_C18) // PIC: do nothing
1943 #elif defined (ARM_STM32) // STM32
1944 GPIO_InitTypeDef GPIO_InitStructure
;
1946 /* GPIOx clock enable */
1947 #if defined (ARM_STM32L1XX)
1948 RCC_AHBPeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1949 #elif defined (ARM_STM32F10X)
1950 RCC_APB2PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1951 #elif defined (ARM_STM32F4XX)
1952 RCC_AHB1PeriphClockCmd(IRMP_PORT_RCC
, ENABLE
);
1955 /* GPIO Configuration */
1956 GPIO_InitStructure
.GPIO_Pin
= IRMP_BIT
;
1957 #if defined (ARM_STM32L1XX) || defined (ARM_STM32F4XX)
1958 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN
;
1959 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1960 GPIO_InitStructure
.GPIO_OType
= GPIO_OType_PP
;
1961 GPIO_InitStructure
.GPIO_PuPd
= GPIO_PuPd_NOPULL
;
1962 #elif defined (ARM_STM32F10X)
1963 GPIO_InitStructure
.GPIO_Speed
= GPIO_Speed_2MHz
;
1964 GPIO_InitStructure
.GPIO_Mode
= GPIO_Mode_IN_FLOATING
;
1966 GPIO_Init(IRMP_PORT
, &GPIO_InitStructure
);
1967 #elif defined(STELLARIS_ARM_CORTEX_M4)
1968 // Enable the GPIO port
1969 ROM_SysCtlPeripheralEnable(IRMP_PORT_PERIPH
);
1972 ROM_GPIODirModeSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
, GPIO_DIR_MODE_IN
);
1973 ROM_GPIOPadConfigSet(IRMP_PORT_BASE
, IRMP_PORT_PIN
,
1975 GPIO_PIN_TYPE_STD_WPU
);
1977 IRMP_PORT
&= ~(1<<IRMP_BIT
); // deactivate pullup
1978 IRMP_DDR
&= ~(1<<IRMP_BIT
); // set pin to input
1981 #if IRMP_LOGGING == 1
1986 /*---------------------------------------------------------------------------------------------------------------------------------------------------
1988 * @details gets decoded IRMP data
1989 * @param pointer in order to store IRMP data
1990 * @return TRUE: successful, FALSE: failed
1991 *---------------------------------------------------------------------------------------------------------------------------------------------------
1994 irmp_get_data (IRMP_DATA
* irmp_data_p
)
1996 uint_fast8_t rtc
= FALSE
;
1998 if (irmp_ir_detected
)
2000 switch (irmp_protocol
)
2002 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2003 case IRMP_SAMSUNG_PROTOCOL
:
2004 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2006 irmp_command
&= 0xff;
2007 irmp_command
|= irmp_id
<< 8;
2012 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2013 case IRMP_SAMSUNG48_PROTOCOL
:
2014 irmp_command
= (irmp_command
& 0x00FF) | ((irmp_id
& 0x00FF) << 8);
2020 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2021 case IRMP_NEC_PROTOCOL
:
2022 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2024 irmp_command
&= 0xff;
2027 else if (irmp_address
== 0x87EE)
2030 ANALYZE_PRINTF ("Switching to APPLE protocol\n");
2032 irmp_protocol
= IRMP_APPLE_PROTOCOL
;
2033 irmp_address
= (irmp_command
& 0xFF00) >> 8;
2034 irmp_command
&= 0x00FF;
2039 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2040 case IRMP_BOSE_PROTOCOL
:
2041 if ((irmp_command
>> 8) == (~irmp_command
& 0x00FF))
2043 irmp_command
&= 0xff;
2048 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
2049 case IRMP_SIEMENS_PROTOCOL
:
2050 case IRMP_RUWIDO_PROTOCOL
:
2051 if (((irmp_command
>> 1) & 0x0001) == (~irmp_command
& 0x0001))
2058 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
2059 case IRMP_KATHREIN_PROTOCOL
:
2060 if (irmp_command
!= 0x0000)
2066 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2067 case IRMP_RC5_PROTOCOL
:
2068 irmp_address
&= ~0x20; // clear toggle bit
2072 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2073 case IRMP_S100_PROTOCOL
:
2074 irmp_address
&= ~0x20; // clear toggle bit
2078 #if IRMP_SUPPORT_IR60_PROTOCOL == 1
2079 case IRMP_IR60_PROTOCOL
:
2080 if (irmp_command
!= 0x007d) // 0x007d (== 62<<1 + 1) is start instruction frame
2087 ANALYZE_PRINTF("Info IR60: got start instruction frame\n");
2092 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2093 case IRMP_RCCAR_PROTOCOL
:
2094 // frame in irmp_data:
2095 // Bit 12 11 10 9 8 7 6 5 4 3 2 1 0
2096 // V D7 D6 D5 D4 D3 D2 D1 D0 A1 A0 C1 C0 // 10 9 8 7 6 5 4 3 2 1 0
2097 irmp_address
= (irmp_command
& 0x000C) >> 2; // addr: 0 0 0 0 0 0 0 0 0 A1 A0
2098 irmp_command
= ((irmp_command
& 0x1000) >> 2) | // V-Bit: V 0 0 0 0 0 0 0 0 0 0
2099 ((irmp_command
& 0x0003) << 8) | // C-Bits: 0 C1 C0 0 0 0 0 0 0 0 0
2100 ((irmp_command
& 0x0FF0) >> 4); // D-Bits: D7 D6 D5 D4 D3 D2 D1 D0
2101 rtc
= TRUE
; // Summe: V C1 C0 D7 D6 D5 D4 D3 D2 D1 D0
2105 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1 // squeeze code to 8 bit, upper bit indicates release-key
2106 case IRMP_NETBOX_PROTOCOL
:
2107 if (irmp_command
& 0x1000) // last bit set?
2109 if ((irmp_command
& 0x1f) == 0x15) // key pressed: 101 01 (LSB)
2112 irmp_command
&= 0x7F;
2115 else if ((irmp_command
& 0x1f) == 0x10) // key released: 000 01 (LSB)
2118 irmp_command
|= 0x80;
2124 ANALYZE_PRINTF("error NETBOX: bit6/7 must be 0/1\n");
2131 ANALYZE_PRINTF("error NETBOX: last bit not set\n");
2136 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
2137 case IRMP_LEGO_PROTOCOL
:
2139 uint_fast8_t crc
= 0x0F ^ ((irmp_command
& 0xF000) >> 12) ^ ((irmp_command
& 0x0F00) >> 8) ^ ((irmp_command
& 0x00F0) >> 4);
2141 if ((irmp_command
& 0x000F) == crc
)
2149 ANALYZE_PRINTF ("CRC error in LEGO protocol\n");
2151 // rtc = TRUE; // don't accept codes with CRC errors
2166 irmp_data_p
->protocol
= irmp_protocol
;
2167 irmp_data_p
->address
= irmp_address
;
2168 irmp_data_p
->command
= irmp_command
;
2169 irmp_data_p
->flags
= irmp_flags
;
2175 irmp_ir_detected
= FALSE
;
2181 #if IRMP_USE_CALLBACK == 1
2183 irmp_set_callback_ptr (void (*cb
)(uint_fast8_t))
2185 irmp_callback_ptr
= cb
;
2187 #endif // IRMP_USE_CALLBACK == 1
2189 // these statics must not be volatile, because they are only used by irmp_store_bit(), which is called by irmp_ISR()
2190 static uint_fast16_t irmp_tmp_address
; // ir address
2191 static uint_fast16_t irmp_tmp_command
; // ir command
2193 #if (IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2194 static uint_fast16_t irmp_tmp_address2
; // ir address
2195 static uint_fast16_t irmp_tmp_command2
; // ir command
2198 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2199 static uint_fast16_t irmp_lgair_address
; // ir address
2200 static uint_fast16_t irmp_lgair_command
; // ir command
2203 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2204 static uint_fast16_t irmp_tmp_id
; // ir id (only SAMSUNG)
2206 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2207 static uint8_t xor_check
[6]; // check kaseikyo "parity" bits
2208 static uint_fast8_t genre2
; // save genre2 bits here, later copied to MSB in flags
2211 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2212 static uint_fast8_t parity
; // number of '1' of the first 14 bits, check if even.
2215 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2217 * @details store bit in temp address or temp command
2218 * @param value to store: 0 or 1
2219 *---------------------------------------------------------------------------------------------------------------------------------------------------
2221 // verhindert, dass irmp_store_bit() inline compiliert wird:
2222 // static void irmp_store_bit (uint_fast8_t) __attribute__ ((noinline));
2225 irmp_store_bit (uint_fast8_t value
)
2227 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
2228 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
2237 else if (irmp_bit
== 14)
2239 if (value
) // value == 1: even parity
2243 parity
= PARITY_CHECK_FAILED
;
2247 parity
= PARITY_CHECK_OK
;
2252 if (parity
& 0x01) // value == 0: odd parity
2254 parity
= PARITY_CHECK_OK
;
2258 parity
= PARITY_CHECK_FAILED
;
2265 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
2266 if (irmp_bit
== 0 && irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
)
2273 if (irmp_bit
>= irmp_param
.address_offset
&& irmp_bit
< irmp_param
.address_end
)
2275 if (irmp_param
.lsb_first
)
2277 irmp_tmp_address
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.address_offset
)); // CV wants cast
2281 irmp_tmp_address
<<= 1;
2282 irmp_tmp_address
|= value
;
2285 else if (irmp_bit
>= irmp_param
.command_offset
&& irmp_bit
< irmp_param
.command_end
)
2287 if (irmp_param
.lsb_first
)
2289 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
2290 if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
>= 32)
2292 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 32)); // CV wants cast
2297 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- irmp_param
.command_offset
)); // CV wants cast
2302 irmp_tmp_command
<<= 1;
2303 irmp_tmp_command
|= value
;
2307 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2308 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
|| irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
)
2312 irmp_lgair_address
<<= 1; // LGAIR uses MSB
2313 irmp_lgair_address
|= value
;
2315 else if (irmp_bit
< 24)
2317 irmp_lgair_command
<<= 1; // LGAIR uses MSB
2318 irmp_lgair_command
|= value
;
2324 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2325 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
>= 13 && irmp_bit
< 26)
2327 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 13)); // CV wants cast
2332 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2333 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
>= SAMSUNG_ID_OFFSET
&& irmp_bit
< SAMSUNG_ID_OFFSET
+ SAMSUNG_ID_LEN
)
2335 irmp_tmp_id
|= (((uint_fast16_t) (value
)) << (irmp_bit
- SAMSUNG_ID_OFFSET
)); // store with LSB first
2340 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2341 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
2343 if (irmp_bit
>= 20 && irmp_bit
< 24)
2345 irmp_tmp_command
|= (((uint_fast16_t) (value
)) << (irmp_bit
- 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
2347 else if (irmp_bit
>= 24 && irmp_bit
< 28)
2349 genre2
|= (((uint_fast8_t) (value
)) << (irmp_bit
- 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
2352 if (irmp_bit
< KASEIKYO_COMPLETE_DATA_LEN
)
2356 xor_check
[irmp_bit
/ 8] |= 1 << (irmp_bit
% 8);
2360 xor_check
[irmp_bit
/ 8] &= ~(1 << (irmp_bit
% 8));
2373 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2375 * @details store bit in temp address or temp command
2376 * @param value to store: 0 or 1
2377 *---------------------------------------------------------------------------------------------------------------------------------------------------
2379 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2381 irmp_store_bit2 (uint_fast8_t value
)
2383 uint_fast8_t irmp_bit2
;
2385 if (irmp_param
.protocol
)
2387 irmp_bit2
= irmp_bit
- 2;
2391 irmp_bit2
= irmp_bit
- 1;
2394 if (irmp_bit2
>= irmp_param2
.address_offset
&& irmp_bit2
< irmp_param2
.address_end
)
2396 irmp_tmp_address2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.address_offset
)); // CV wants cast
2398 else if (irmp_bit2
>= irmp_param2
.command_offset
&& irmp_bit2
< irmp_param2
.command_end
)
2400 irmp_tmp_command2
|= (((uint_fast16_t) (value
)) << (irmp_bit2
- irmp_param2
.command_offset
)); // CV wants cast
2403 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2405 /*---------------------------------------------------------------------------------------------------------------------------------------------------
2407 * @details ISR routine, called 10000 times per second
2408 *---------------------------------------------------------------------------------------------------------------------------------------------------
2413 static uint_fast8_t irmp_start_bit_detected
; // flag: start bit detected
2414 static uint_fast8_t wait_for_space
; // flag: wait for data bit space
2415 static uint_fast8_t wait_for_start_space
; // flag: wait for start bit space
2416 static uint_fast8_t irmp_pulse_time
; // count bit time for pulse
2417 static PAUSE_LEN irmp_pause_time
; // count bit time for pause
2418 static uint_fast16_t last_irmp_address
= 0xFFFF; // save last irmp address to recognize key repetition
2419 static uint_fast16_t last_irmp_command
= 0xFFFF; // save last irmp command to recognize key repetition
2420 static uint_fast16_t key_repetition_len
; // SIRCS repeats frame 2-5 times with 45 ms pause
2421 static uint_fast8_t repetition_frame_number
;
2422 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2423 static uint_fast16_t last_irmp_denon_command
; // save last irmp command to recognize DENON frame repetition
2424 static uint_fast16_t denon_repetition_len
= 0xFFFF; // denon repetition len of 2nd auto generated frame
2426 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2427 static uint_fast8_t rc5_cmd_bit6
; // bit 6 of RC5 command is the inverted 2nd start bit
2429 #if IRMP_SUPPORT_MANCHESTER == 1
2430 static PAUSE_LEN last_pause
; // last pause value
2432 #if IRMP_SUPPORT_MANCHESTER == 1 || IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
2433 static uint_fast8_t last_value
; // last bit value
2435 uint_fast8_t irmp_input
; // input value
2441 irmp_input
= input(IRMP_PIN
);
2443 #if IRMP_USE_CALLBACK == 1
2444 if (irmp_callback_ptr
)
2446 static uint_fast8_t last_inverted_input
;
2448 if (last_inverted_input
!= !irmp_input
)
2450 (*irmp_callback_ptr
) (! irmp_input
);
2451 last_inverted_input
= !irmp_input
;
2454 #endif // IRMP_USE_CALLBACK == 1
2456 irmp_log(irmp_input
); // log ir signal, if IRMP_LOGGING defined
2458 if (! irmp_ir_detected
) // ir code already detected?
2460 if (! irmp_start_bit_detected
) // start bit detected?
2462 if (! irmp_input
) // receiving burst?
2464 // irmp_busy_flag = TRUE;
2466 if (! irmp_pulse_time
)
2468 ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
2471 irmp_pulse_time
++; // increment counter
2475 if (irmp_pulse_time
) // it's dark....
2476 { // set flags for counting the time of darkness...
2477 irmp_start_bit_detected
= 1;
2478 wait_for_start_space
= 1;
2480 irmp_tmp_command
= 0;
2481 irmp_tmp_address
= 0;
2482 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2485 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2489 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
2490 irmp_tmp_command2
= 0;
2491 irmp_tmp_address2
= 0;
2493 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
2494 irmp_lgair_command
= 0;
2495 irmp_lgair_address
= 0;
2498 irmp_pause_time
= 1; // 1st pause: set to 1, not to 0!
2499 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 || IRMP_SUPPORT_S100_PROTOCOL == 1
2500 rc5_cmd_bit6
= 0; // fm 2010-03-07: bugfix: reset it after incomplete RC5 frame!
2505 if (key_repetition_len
< 0xFFFF) // avoid overflow of counter
2507 key_repetition_len
++;
2509 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2510 if (denon_repetition_len
< 0xFFFF) // avoid overflow of counter
2512 denon_repetition_len
++;
2514 if (denon_repetition_len
>= DENON_AUTO_REPETITION_PAUSE_LEN
&& last_irmp_denon_command
!= 0)
2517 ANALYZE_PRINTF ("%8.3fms warning: did not receive inverted command repetition\n",
2518 (double) (time_counter
* 1000) / F_INTERRUPTS
);
2520 last_irmp_denon_command
= 0;
2521 denon_repetition_len
= 0xFFFF;
2524 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2531 if (wait_for_start_space
) // we have received start bit...
2532 { // ...and are counting the time of darkness
2533 if (irmp_input
) // still dark?
2535 irmp_pause_time
++; // increment counter
2537 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2538 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
) ||
2539 irmp_pause_time
> IRMP_TIMEOUT_NIKON_LEN
)
2541 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
2544 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2545 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // don't show eror if JVC protocol, irmp_pulse_time has been set below!
2550 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2553 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
);
2554 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
2558 irmp_start_bit_detected
= 0; // reset flags, let's wait for another start bit
2559 irmp_pulse_time
= 0;
2560 irmp_pause_time
= 0;
2564 { // receiving first data pulse!
2565 IRMP_PARAMETER
* irmp_param_p
;
2566 irmp_param_p
= (IRMP_PARAMETER
*) 0;
2568 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
2569 irmp_param2
.protocol
= 0;
2573 ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_pulse_time
, irmp_pause_time
);
2576 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2577 if (irmp_pulse_time
>= SIRCS_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIRCS_START_BIT_PULSE_LEN_MAX
&&
2578 irmp_pause_time
>= SIRCS_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIRCS_START_BIT_PAUSE_LEN_MAX
)
2581 ANALYZE_PRINTF ("protocol = SIRCS, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2582 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
,
2583 SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
);
2585 irmp_param_p
= (IRMP_PARAMETER
*) &sircs_param
;
2588 #endif // IRMP_SUPPORT_SIRCS_PROTOCOL == 1
2590 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2591 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2592 irmp_pulse_time
>= JVC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= JVC_START_BIT_PULSE_LEN_MAX
&&
2593 irmp_pause_time
>= JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2596 ANALYZE_PRINTF ("protocol = NEC or JVC (type 1) repeat frame, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2597 JVC_START_BIT_PULSE_LEN_MIN
, JVC_START_BIT_PULSE_LEN_MAX
,
2598 JVC_REPEAT_START_BIT_PAUSE_LEN_MIN
, JVC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2600 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2603 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2605 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
2606 if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2607 irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
2609 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
2611 ANALYZE_PRINTF ("protocol = NEC42, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2612 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2613 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2615 irmp_param_p
= (IRMP_PARAMETER
*) &nec42_param
;
2618 ANALYZE_PRINTF ("protocol = NEC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2619 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2620 NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
);
2622 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2625 else if (irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2626 irmp_pause_time
>= NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
)
2628 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2629 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // last protocol was JVC, awaiting repeat frame
2630 { // some jvc remote controls use nec repetition frame for jvc repetition frame
2632 ANALYZE_PRINTF ("protocol = JVC repeat frame type 2, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2633 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2634 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2636 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2639 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2642 ANALYZE_PRINTF ("protocol = NEC (repetition frame), start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2643 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2644 NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
);
2647 irmp_param_p
= (IRMP_PARAMETER
*) &nec_rep_param
;
2652 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
2653 if (irmp_protocol
== IRMP_JVC_PROTOCOL
&& // last protocol was JVC, awaiting repeat frame
2654 irmp_pulse_time
>= NEC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NEC_START_BIT_PULSE_LEN_MAX
&&
2655 irmp_pause_time
>= NEC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_0_PAUSE_LEN_MAX
)
2656 { // it's JVC repetition type 3
2658 ANALYZE_PRINTF ("protocol = JVC repeat frame type 3, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2659 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
,
2660 NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
);
2662 irmp_param_p
= (IRMP_PARAMETER
*) &nec_param
;
2665 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
2667 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
2669 #if IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2670 if (irmp_pulse_time
>= TELEFUNKEN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= TELEFUNKEN_START_BIT_PULSE_LEN_MAX
&&
2671 irmp_pause_time
>= TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
)
2674 ANALYZE_PRINTF ("protocol = TELEFUNKEN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2675 TELEFUNKEN_START_BIT_PULSE_LEN_MIN
, TELEFUNKEN_START_BIT_PULSE_LEN_MAX
,
2676 TELEFUNKEN_START_BIT_PAUSE_LEN_MIN
, TELEFUNKEN_START_BIT_PAUSE_LEN_MAX
);
2678 irmp_param_p
= (IRMP_PARAMETER
*) &telefunken_param
;
2681 #endif // IRMP_SUPPORT_TELEFUNKEN_PROTOCOL == 1
2683 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2684 if (irmp_pulse_time
>= ROOMBA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_START_BIT_PULSE_LEN_MAX
&&
2685 irmp_pause_time
>= ROOMBA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ROOMBA_START_BIT_PAUSE_LEN_MAX
)
2688 ANALYZE_PRINTF ("protocol = ROOMBA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2689 ROOMBA_START_BIT_PULSE_LEN_MIN
, ROOMBA_START_BIT_PULSE_LEN_MAX
,
2690 ROOMBA_START_BIT_PAUSE_LEN_MIN
, ROOMBA_START_BIT_PAUSE_LEN_MAX
);
2692 irmp_param_p
= (IRMP_PARAMETER
*) &roomba_param
;
2695 #endif // IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
2697 #if IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2698 if (irmp_pulse_time
>= PENTAX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= PENTAX_START_BIT_PULSE_LEN_MAX
&&
2699 irmp_pause_time
>= PENTAX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= PENTAX_START_BIT_PAUSE_LEN_MAX
)
2702 ANALYZE_PRINTF ("protocol = PENTAX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2703 PENTAX_START_BIT_PULSE_LEN_MIN
, PENTAX_START_BIT_PULSE_LEN_MAX
,
2704 PENTAX_START_BIT_PAUSE_LEN_MIN
, PENTAX_START_BIT_PAUSE_LEN_MAX
);
2706 irmp_param_p
= (IRMP_PARAMETER
*) &pentax_param
;
2709 #endif // IRMP_SUPPORT_PENTAX_PROTOCOL == 1
2711 #if IRMP_SUPPORT_NIKON_PROTOCOL == 1
2712 if (irmp_pulse_time
>= NIKON_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NIKON_START_BIT_PULSE_LEN_MAX
&&
2713 irmp_pause_time
>= NIKON_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NIKON_START_BIT_PAUSE_LEN_MAX
)
2716 ANALYZE_PRINTF ("protocol = NIKON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2717 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
,
2718 NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
);
2720 irmp_param_p
= (IRMP_PARAMETER
*) &nikon_param
;
2723 #endif // IRMP_SUPPORT_NIKON_PROTOCOL == 1
2725 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2726 if (irmp_pulse_time
>= SAMSUNG_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_START_BIT_PULSE_LEN_MAX
&&
2727 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
2730 ANALYZE_PRINTF ("protocol = SAMSUNG, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2731 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
,
2732 SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
);
2734 irmp_param_p
= (IRMP_PARAMETER
*) &samsung_param
;
2737 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
2739 #if IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2740 if (irmp_pulse_time
>= MATSUSHITA_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MATSUSHITA_START_BIT_PULSE_LEN_MAX
&&
2741 irmp_pause_time
>= MATSUSHITA_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MATSUSHITA_START_BIT_PAUSE_LEN_MAX
)
2742 { // it's MATSUSHITA
2744 ANALYZE_PRINTF ("protocol = MATSUSHITA, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2745 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
,
2746 MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
);
2748 irmp_param_p
= (IRMP_PARAMETER
*) &matsushita_param
;
2751 #endif // IRMP_SUPPORT_MATSUSHITA_PROTOCOL == 1
2753 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2754 if (irmp_pulse_time
>= KASEIKYO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KASEIKYO_START_BIT_PULSE_LEN_MAX
&&
2755 irmp_pause_time
>= KASEIKYO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KASEIKYO_START_BIT_PAUSE_LEN_MAX
)
2758 ANALYZE_PRINTF ("protocol = KASEIKYO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2759 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
,
2760 KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
);
2762 irmp_param_p
= (IRMP_PARAMETER
*) &kaseikyo_param
;
2765 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
2767 #if IRMP_SUPPORT_RADIO1_PROTOCOL == 1
2768 if (irmp_pulse_time
>= RADIO1_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RADIO1_START_BIT_PULSE_LEN_MAX
&&
2769 irmp_pause_time
>= RADIO1_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RADIO1_START_BIT_PAUSE_LEN_MAX
)
2772 ANALYZE_PRINTF ("protocol = RADIO1, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2773 RADIO1_START_BIT_PULSE_LEN_MIN
, RADIO1_START_BIT_PULSE_LEN_MAX
,
2774 RADIO1_START_BIT_PAUSE_LEN_MIN
, RADIO1_START_BIT_PAUSE_LEN_MAX
);
2776 irmp_param_p
= (IRMP_PARAMETER
*) &radio1_param
;
2779 #endif // IRMP_SUPPORT_RRADIO1_PROTOCOL == 1
2781 #if IRMP_SUPPORT_RECS80_PROTOCOL == 1
2782 if (irmp_pulse_time
>= RECS80_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80_START_BIT_PULSE_LEN_MAX
&&
2783 irmp_pause_time
>= RECS80_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80_START_BIT_PAUSE_LEN_MAX
)
2786 ANALYZE_PRINTF ("protocol = RECS80, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2787 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
,
2788 RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
);
2790 irmp_param_p
= (IRMP_PARAMETER
*) &recs80_param
;
2793 #endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
2795 #if IRMP_SUPPORT_S100_PROTOCOL == 1
2796 if (((irmp_pulse_time
>= S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= S100_START_BIT_LEN_MAX
) ||
2797 (irmp_pulse_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
)) &&
2798 ((irmp_pause_time
>= S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= S100_START_BIT_LEN_MAX
) ||
2799 (irmp_pause_time
>= 2 * S100_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
)))
2802 ANALYZE_PRINTF ("protocol = S100, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2803 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2804 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
,
2805 S100_START_BIT_LEN_MIN
, S100_START_BIT_LEN_MAX
,
2806 2 * S100_START_BIT_LEN_MIN
, 2 * S100_START_BIT_LEN_MAX
);
2809 irmp_param_p
= (IRMP_PARAMETER
*) &s100_param
;
2810 last_pause
= irmp_pause_time
;
2812 if ((irmp_pulse_time
> S100_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * S100_START_BIT_LEN_MAX
) ||
2813 (irmp_pause_time
> S100_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * S100_START_BIT_LEN_MAX
))
2816 rc5_cmd_bit6
= 1<<6;
2824 #endif // IRMP_SUPPORT_S100_PROTOCOL == 1
2826 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
2827 if (((irmp_pulse_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= RC5_START_BIT_LEN_MAX
) ||
2828 (irmp_pulse_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
)) &&
2829 ((irmp_pause_time
>= RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= RC5_START_BIT_LEN_MAX
) ||
2830 (irmp_pause_time
>= 2 * RC5_START_BIT_LEN_MIN
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
)))
2832 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
2833 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
2834 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
2837 ANALYZE_PRINTF ("protocol = RC5 or FDC\n");
2838 ANALYZE_PRINTF ("FDC start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2839 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
2840 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
2841 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2842 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2843 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2845 memcpy_P (&irmp_param2
, &fdc_param
, sizeof (IRMP_PARAMETER
));
2848 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
2850 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2851 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
2852 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
2855 ANALYZE_PRINTF ("protocol = RC5 or RCCAR\n");
2856 ANALYZE_PRINTF ("RCCAR start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2857 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
2858 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
2859 ANALYZE_PRINTF ("RC5 start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2860 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2861 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
);
2863 memcpy_P (&irmp_param2
, &rccar_param
, sizeof (IRMP_PARAMETER
));
2866 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
2869 ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
2870 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2871 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
,
2872 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
2873 2 * RC5_START_BIT_LEN_MIN
, 2 * RC5_START_BIT_LEN_MAX
);
2877 irmp_param_p
= (IRMP_PARAMETER
*) &rc5_param
;
2878 last_pause
= irmp_pause_time
;
2880 if ((irmp_pulse_time
> RC5_START_BIT_LEN_MAX
&& irmp_pulse_time
<= 2 * RC5_START_BIT_LEN_MAX
) ||
2881 (irmp_pause_time
> RC5_START_BIT_LEN_MAX
&& irmp_pause_time
<= 2 * RC5_START_BIT_LEN_MAX
))
2884 rc5_cmd_bit6
= 1<<6;
2892 #endif // IRMP_SUPPORT_RC5_PROTOCOL == 1
2894 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
2895 if ( (irmp_pulse_time
>= DENON_PULSE_LEN_MIN
&& irmp_pulse_time
<= DENON_PULSE_LEN_MAX
) &&
2896 ((irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
) ||
2897 (irmp_pause_time
>= DENON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_0_PAUSE_LEN_MAX
)))
2900 ANALYZE_PRINTF ("protocol = DENON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2901 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
2902 DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
,
2903 DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
);
2905 irmp_param_p
= (IRMP_PARAMETER
*) &denon_param
;
2908 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
2910 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2911 if ( (irmp_pulse_time
>= THOMSON_PULSE_LEN_MIN
&& irmp_pulse_time
<= THOMSON_PULSE_LEN_MAX
) &&
2912 ((irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
) ||
2913 (irmp_pause_time
>= THOMSON_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_0_PAUSE_LEN_MAX
)))
2916 ANALYZE_PRINTF ("protocol = THOMSON, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
2917 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
2918 THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
,
2919 THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
);
2921 irmp_param_p
= (IRMP_PARAMETER
*) &thomson_param
;
2924 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
2926 #if IRMP_SUPPORT_BOSE_PROTOCOL == 1
2927 if (irmp_pulse_time
>= BOSE_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= BOSE_START_BIT_PULSE_LEN_MAX
&&
2928 irmp_pause_time
>= BOSE_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BOSE_START_BIT_PAUSE_LEN_MAX
)
2931 ANALYZE_PRINTF ("protocol = BOSE, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2932 BOSE_START_BIT_PULSE_LEN_MIN
, BOSE_START_BIT_PULSE_LEN_MAX
,
2933 BOSE_START_BIT_PAUSE_LEN_MIN
, BOSE_START_BIT_PAUSE_LEN_MAX
);
2935 irmp_param_p
= (IRMP_PARAMETER
*) &bose_param
;
2938 #endif // IRMP_SUPPORT_BOSE_PROTOCOL == 1
2940 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
2941 if (irmp_pulse_time
>= RC6_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RC6_START_BIT_PULSE_LEN_MAX
&&
2942 irmp_pause_time
>= RC6_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RC6_START_BIT_PAUSE_LEN_MAX
)
2945 ANALYZE_PRINTF ("protocol = RC6, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2946 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
,
2947 RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
);
2949 irmp_param_p
= (IRMP_PARAMETER
*) &rc6_param
;
2954 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
2956 #if IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2957 if (irmp_pulse_time
>= RECS80EXT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RECS80EXT_START_BIT_PULSE_LEN_MAX
&&
2958 irmp_pause_time
>= RECS80EXT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RECS80EXT_START_BIT_PAUSE_LEN_MAX
)
2961 ANALYZE_PRINTF ("protocol = RECS80EXT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2962 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
,
2963 RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
);
2965 irmp_param_p
= (IRMP_PARAMETER
*) &recs80ext_param
;
2968 #endif // IRMP_SUPPORT_RECS80EXT_PROTOCOL == 1
2970 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2971 if (irmp_pulse_time
>= NUBERT_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NUBERT_START_BIT_PULSE_LEN_MAX
&&
2972 irmp_pause_time
>= NUBERT_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NUBERT_START_BIT_PAUSE_LEN_MAX
)
2975 ANALYZE_PRINTF ("protocol = NUBERT, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2976 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
,
2977 NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
);
2979 irmp_param_p
= (IRMP_PARAMETER
*) &nubert_param
;
2982 #endif // IRMP_SUPPORT_NUBERT_PROTOCOL == 1
2984 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
2985 if (irmp_pulse_time
>= FAN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FAN_START_BIT_PULSE_LEN_MAX
&&
2986 irmp_pause_time
>= FAN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FAN_START_BIT_PAUSE_LEN_MAX
)
2989 ANALYZE_PRINTF ("protocol = FAN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
2990 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
,
2991 FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
);
2993 irmp_param_p
= (IRMP_PARAMETER
*) &fan_param
;
2996 #endif // IRMP_SUPPORT_FAN_PROTOCOL == 1
2998 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
2999 if (irmp_pulse_time
>= SPEAKER_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SPEAKER_START_BIT_PULSE_LEN_MAX
&&
3000 irmp_pause_time
>= SPEAKER_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SPEAKER_START_BIT_PAUSE_LEN_MAX
)
3003 ANALYZE_PRINTF ("protocol = SPEAKER, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3004 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
,
3005 SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
);
3007 irmp_param_p
= (IRMP_PARAMETER
*) &speaker_param
;
3010 #endif // IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
3012 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3013 if (irmp_pulse_time
>= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
&&
3014 irmp_pause_time
>= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
)
3015 { // it's BANG_OLUFSEN
3017 ANALYZE_PRINTF ("protocol = BANG_OLUFSEN\n");
3018 ANALYZE_PRINTF ("start bit 1 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3019 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
3020 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
3021 ANALYZE_PRINTF ("start bit 2 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3022 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
3023 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
3024 ANALYZE_PRINTF ("start bit 3 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3025 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
3026 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
3027 ANALYZE_PRINTF ("start bit 4 timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3028 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
3029 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
3031 irmp_param_p
= (IRMP_PARAMETER
*) &bang_olufsen_param
;
3035 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3037 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3038 if (irmp_pulse_time
>= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
&& irmp_pulse_time
<= GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
&&
3039 irmp_pause_time
>= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
&& irmp_pause_time
<= GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
)
3042 ANALYZE_PRINTF ("protocol = GRUNDIG, pre bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3043 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
3044 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
);
3046 irmp_param_p
= (IRMP_PARAMETER
*) &grundig_param
;
3047 last_pause
= irmp_pause_time
;
3051 #endif // IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3053 #if IRMP_SUPPORT_MERLIN_PROTOCOL == 1 // check MERLIN before RUWIDO!
3054 if (irmp_pulse_time
>= MERLIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= MERLIN_START_BIT_PULSE_LEN_MAX
&&
3055 irmp_pause_time
>= MERLIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= MERLIN_START_BIT_PAUSE_LEN_MAX
)
3058 ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3059 MERLIN_START_BIT_PULSE_LEN_MIN
, MERLIN_START_BIT_PULSE_LEN_MAX
,
3060 MERLIN_START_BIT_PAUSE_LEN_MIN
, MERLIN_START_BIT_PAUSE_LEN_MAX
);
3062 irmp_param_p
= (IRMP_PARAMETER
*) &merlin_param
;
3067 #endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
3069 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3070 if (((irmp_pulse_time
>= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
) ||
3071 (irmp_pulse_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
)) &&
3072 ((irmp_pause_time
>= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
) ||
3073 (irmp_pause_time
>= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
)))
3074 { // it's RUWIDO or SIEMENS
3076 ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
3077 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3078 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
3079 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
3080 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
);
3082 irmp_param_p
= (IRMP_PARAMETER
*) &ruwido_param
;
3083 last_pause
= irmp_pause_time
;
3087 #endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3089 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
3090 if (irmp_pulse_time
>= FDC_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_START_BIT_PULSE_LEN_MAX
&&
3091 irmp_pause_time
>= FDC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_START_BIT_PAUSE_LEN_MAX
)
3094 ANALYZE_PRINTF ("protocol = FDC, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3095 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
,
3096 FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
);
3098 irmp_param_p
= (IRMP_PARAMETER
*) &fdc_param
;
3101 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3103 #if IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3104 if (irmp_pulse_time
>= RCCAR_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_START_BIT_PULSE_LEN_MAX
&&
3105 irmp_pause_time
>= RCCAR_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_START_BIT_PAUSE_LEN_MAX
)
3108 ANALYZE_PRINTF ("protocol = RCCAR, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3109 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
,
3110 RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
);
3112 irmp_param_p
= (IRMP_PARAMETER
*) &rccar_param
;
3115 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3117 #if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3118 if (irmp_pulse_time
>= KATHREIN_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_START_BIT_PULSE_LEN_MAX
&&
3119 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)
3122 ANALYZE_PRINTF ("protocol = KATHREIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3123 KATHREIN_START_BIT_PULSE_LEN_MIN
, KATHREIN_START_BIT_PULSE_LEN_MAX
,
3124 KATHREIN_START_BIT_PAUSE_LEN_MIN
, KATHREIN_START_BIT_PAUSE_LEN_MAX
);
3126 irmp_param_p
= (IRMP_PARAMETER
*) &kathrein_param
;
3129 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
3131 #if IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3132 if (irmp_pulse_time
>= NETBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= NETBOX_START_BIT_PULSE_LEN_MAX
&&
3133 irmp_pause_time
>= NETBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NETBOX_START_BIT_PAUSE_LEN_MAX
)
3136 ANALYZE_PRINTF ("protocol = NETBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3137 NETBOX_START_BIT_PULSE_LEN_MIN
, NETBOX_START_BIT_PULSE_LEN_MAX
,
3138 NETBOX_START_BIT_PAUSE_LEN_MIN
, NETBOX_START_BIT_PAUSE_LEN_MAX
);
3140 irmp_param_p
= (IRMP_PARAMETER
*) &netbox_param
;
3143 #endif // IRMP_SUPPORT_NETBOX_PROTOCOL == 1
3145 #if IRMP_SUPPORT_LEGO_PROTOCOL == 1
3146 if (irmp_pulse_time
>= LEGO_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= LEGO_START_BIT_PULSE_LEN_MAX
&&
3147 irmp_pause_time
>= LEGO_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= LEGO_START_BIT_PAUSE_LEN_MAX
)
3150 ANALYZE_PRINTF ("protocol = LEGO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3151 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
,
3152 LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
);
3154 irmp_param_p
= (IRMP_PARAMETER
*) &lego_param
;
3157 #endif // IRMP_SUPPORT_LEGO_PROTOCOL == 1
3159 #if IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3160 if (irmp_pulse_time
>= A1TVBOX_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= A1TVBOX_START_BIT_PULSE_LEN_MAX
&&
3161 irmp_pause_time
>= A1TVBOX_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= A1TVBOX_START_BIT_PAUSE_LEN_MAX
)
3164 ANALYZE_PRINTF ("protocol = A1TVBOX, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3165 A1TVBOX_START_BIT_PULSE_LEN_MIN
, A1TVBOX_START_BIT_PULSE_LEN_MAX
,
3166 A1TVBOX_START_BIT_PAUSE_LEN_MIN
, A1TVBOX_START_BIT_PAUSE_LEN_MAX
);
3168 irmp_param_p
= (IRMP_PARAMETER
*) &a1tvbox_param
;
3173 #endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
3175 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3176 if (irmp_pulse_time
>= ORTEK_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= ORTEK_START_BIT_PULSE_LEN_MAX
&&
3177 irmp_pause_time
>= ORTEK_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= ORTEK_START_BIT_PAUSE_LEN_MAX
)
3178 { // it's ORTEK (Hama)
3180 ANALYZE_PRINTF ("protocol = ORTEK, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3181 ORTEK_START_BIT_PULSE_LEN_MIN
, ORTEK_START_BIT_PULSE_LEN_MAX
,
3182 ORTEK_START_BIT_PAUSE_LEN_MIN
, ORTEK_START_BIT_PAUSE_LEN_MAX
);
3184 irmp_param_p
= (IRMP_PARAMETER
*) &ortek_param
;
3190 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
3192 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3193 if (irmp_pulse_time
>= RCMM32_START_BIT_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCMM32_START_BIT_PULSE_LEN_MAX
&&
3194 irmp_pause_time
>= RCMM32_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_START_BIT_PAUSE_LEN_MAX
)
3197 ANALYZE_PRINTF ("protocol = RCMM, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
3198 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
,
3199 RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
);
3201 irmp_param_p
= (IRMP_PARAMETER
*) &rcmm_param
;
3204 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3207 ANALYZE_PRINTF ("protocol = UNKNOWN\n");
3209 irmp_start_bit_detected
= 0; // wait for another start bit...
3212 if (irmp_start_bit_detected
)
3214 memcpy_P (&irmp_param
, irmp_param_p
, sizeof (IRMP_PARAMETER
));
3216 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3219 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
);
3220 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
);
3226 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_1_len_min
, irmp_param
.pulse_1_len_max
,
3227 2 * irmp_param
.pulse_1_len_min
, 2 * irmp_param
.pulse_1_len_max
);
3228 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_1_len_min
, irmp_param
.pause_1_len_max
,
3229 2 * irmp_param
.pause_1_len_min
, 2 * irmp_param
.pause_1_len_max
);
3233 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3234 if (irmp_param2
.protocol
)
3237 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param2
.pulse_0_len_min
, irmp_param2
.pulse_0_len_max
);
3238 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param2
.pause_0_len_min
, irmp_param2
.pause_0_len_max
);
3239 ANALYZE_PRINTF ("pulse_1: %3d - %3d\n", irmp_param2
.pulse_1_len_min
, irmp_param2
.pulse_1_len_max
);
3240 ANALYZE_PRINTF ("pause_1: %3d - %3d\n", irmp_param2
.pause_1_len_min
, irmp_param2
.pause_1_len_max
);
3246 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3247 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
)
3250 ANALYZE_PRINTF ("pulse_toggle: %3d - %3d\n", RC6_TOGGLE_BIT_LEN_MIN
, RC6_TOGGLE_BIT_LEN_MAX
);
3255 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3258 ANALYZE_PRINTF ("pulse_0: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3259 ANALYZE_PRINTF ("pause_0: %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
);
3265 ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
,
3266 2 * irmp_param
.pulse_0_len_min
, 2 * irmp_param
.pulse_0_len_max
);
3267 ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param
.pause_0_len_min
, irmp_param
.pause_0_len_max
,
3268 2 * irmp_param
.pause_0_len_min
, 2 * irmp_param
.pause_0_len_max
);
3273 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
3274 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
3276 ANALYZE_PRINTF ("pulse_r: %3d - %3d\n", irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3277 ANALYZE_PRINTF ("pause_r: %3d - %3d\n", BANG_OLUFSEN_R_PAUSE_LEN_MIN
, BANG_OLUFSEN_R_PAUSE_LEN_MAX
);
3281 ANALYZE_PRINTF ("command_offset: %2d\n", irmp_param
.command_offset
);
3282 ANALYZE_PRINTF ("command_len: %3d\n", irmp_param
.command_end
- irmp_param
.command_offset
);
3283 ANALYZE_PRINTF ("complete_len: %3d\n", irmp_param
.complete_len
);
3284 ANALYZE_PRINTF ("stop_bit: %3d\n", irmp_param
.stop_bit
);
3290 #if IRMP_SUPPORT_MANCHESTER == 1
3291 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3292 irmp_param
.protocol
!= IRMP_RUWIDO_PROTOCOL
&& // Manchester, but not RUWIDO
3293 irmp_param
.protocol
!= IRMP_RC6_PROTOCOL
) // Manchester, but not RC6
3295 if (irmp_pause_time
> irmp_param
.pulse_1_len_max
&& irmp_pause_time
<= 2 * irmp_param
.pulse_1_len_max
)
3298 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3299 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3302 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1);
3304 else if (! last_value
) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
3307 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3308 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3311 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0);
3315 #endif // IRMP_SUPPORT_MANCHESTER == 1
3317 #if IRMP_SUPPORT_SERIAL == 1
3318 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3323 #endif // IRMP_SUPPORT_SERIAL == 1
3326 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
3327 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
3330 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3333 if (irmp_pause_time
>= DENON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= DENON_1_PAUSE_LEN_MAX
)
3334 { // pause timings correct for "1"?
3336 ANALYZE_PUTCHAR ('1'); // yes, store 1
3341 else // if (irmp_pause_time >= DENON_0_PAUSE_LEN_MIN && irmp_pause_time <= DENON_0_PAUSE_LEN_MAX)
3342 { // pause timings correct for "0"?
3344 ANALYZE_PUTCHAR ('0'); // yes, store 0
3351 #endif // IRMP_SUPPORT_DENON_PROTOCOL == 1
3352 #if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3353 if (irmp_param
.protocol
== IRMP_THOMSON_PROTOCOL
)
3356 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3359 if (irmp_pause_time
>= THOMSON_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= THOMSON_1_PAUSE_LEN_MAX
)
3360 { // pause timings correct for "1"?
3362 ANALYZE_PUTCHAR ('1'); // yes, store 1
3367 else // if (irmp_pause_time >= THOMSON_0_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_0_PAUSE_LEN_MAX)
3368 { // pause timings correct for "0"?
3370 ANALYZE_PUTCHAR ('0'); // yes, store 0
3377 #endif // IRMP_SUPPORT_THOMSON_PROTOCOL == 1
3379 ; // else do nothing
3382 irmp_pulse_time
= 1; // set counter to 1, not 0
3383 irmp_pause_time
= 0;
3384 wait_for_start_space
= 0;
3387 else if (wait_for_space
) // the data section....
3388 { // counting the time of darkness....
3389 uint_fast8_t got_light
= FALSE
;
3391 if (irmp_input
) // still dark?
3393 if (irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 1)
3396 #if IRMP_SUPPORT_MANCHESTER == 1
3397 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) ||
3399 #if IRMP_SUPPORT_SERIAL == 1
3400 (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) ||
3402 (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
))
3405 if (! (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
))
3407 ANALYZE_PRINTF ("stop bit detected\n");
3410 irmp_param
.stop_bit
= 0;
3415 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",
3416 irmp_bit
, irmp_pulse_time
, irmp_param
.pulse_0_len_min
, irmp_param
.pulse_0_len_max
);
3418 irmp_start_bit_detected
= 0; // wait for another start bit...
3419 irmp_pulse_time
= 0;
3420 irmp_pause_time
= 0;
3425 irmp_pause_time
++; // increment counter
3427 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
3428 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& // Sony has a variable number of bits:
3429 irmp_pause_time
> SIRCS_PAUSE_LEN_MAX
&& // minimum is 12
3430 irmp_bit
>= 12 - 1) // pause too long?
3431 { // yes, break and close this frame
3432 irmp_param
.complete_len
= irmp_bit
+ 1; // set new complete length
3433 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3434 irmp_tmp_address
|= (irmp_bit
- SIRCS_MINIMUM_DATA_LEN
+ 1) << 8; // new: store number of additional bits in upper byte of address!
3435 irmp_param
.command_end
= irmp_param
.command_offset
+ irmp_bit
+ 1; // correct command length
3436 irmp_pause_time
= SIRCS_PAUSE_LEN_MAX
- 1; // correct pause length
3440 #if IRMP_SUPPORT_FAN_PROTOCOL == 1
3441 if (irmp_param
.protocol
== IRMP_FAN_PROTOCOL
&& // FAN has no stop bit.
3442 irmp_bit
>= FAN_COMPLETE_DATA_LEN
- 1) // last bit in frame
3443 { // yes, break and close this frame
3444 if (irmp_pulse_time
<= FAN_0_PULSE_LEN_MAX
&& irmp_pause_time
>= FAN_0_PAUSE_LEN_MIN
)
3447 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3449 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3451 else if (irmp_pulse_time
>= FAN_1_PULSE_LEN_MIN
&& irmp_pause_time
>= FAN_1_PAUSE_LEN_MIN
)
3454 ANALYZE_PRINTF ("Generating virtual stop bit\n");
3456 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3461 #if IRMP_SUPPORT_SERIAL == 1
3462 // NETBOX generates no stop bit, here is the timeout condition:
3463 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
) && irmp_param
.protocol
== IRMP_NETBOX_PROTOCOL
&&
3464 irmp_pause_time
>= NETBOX_PULSE_LEN
* (NETBOX_COMPLETE_DATA_LEN
- irmp_bit
))
3466 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3470 #if IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1
3471 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& !irmp_param
.stop_bit
)
3473 if (irmp_pause_time
> IR60_TIMEOUT_LEN
&& (irmp_bit
== 5 || irmp_bit
== 6))
3476 ANALYZE_PRINTF ("Switching to IR60 protocol\n");
3478 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3479 irmp_param
.stop_bit
= TRUE
; // set flag
3481 irmp_param
.protocol
= IRMP_IR60_PROTOCOL
; // change protocol
3482 irmp_param
.complete_len
= IR60_COMPLETE_DATA_LEN
; // correct complete len
3483 irmp_param
.address_offset
= IR60_ADDRESS_OFFSET
;
3484 irmp_param
.address_end
= IR60_ADDRESS_OFFSET
+ IR60_ADDRESS_LEN
;
3485 irmp_param
.command_offset
= IR60_COMMAND_OFFSET
;
3486 irmp_param
.command_end
= IR60_COMMAND_OFFSET
+ IR60_COMMAND_LEN
;
3488 irmp_tmp_command
<<= 1;
3489 irmp_tmp_command
|= first_bit
;
3491 else if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
- 2)
3492 { // special manchester decoder
3493 irmp_param
.complete_len
= GRUNDIG_COMPLETE_DATA_LEN
; // correct complete len
3494 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3495 irmp_param
.stop_bit
= TRUE
; // set flag
3497 else if (irmp_bit
>= GRUNDIG_COMPLETE_DATA_LEN
)
3500 ANALYZE_PRINTF ("Switching to NOKIA protocol\n");
3502 irmp_param
.protocol
= IRMP_NOKIA_PROTOCOL
; // change protocol
3503 irmp_param
.address_offset
= NOKIA_ADDRESS_OFFSET
;
3504 irmp_param
.address_end
= NOKIA_ADDRESS_OFFSET
+ NOKIA_ADDRESS_LEN
;
3505 irmp_param
.command_offset
= NOKIA_COMMAND_OFFSET
;
3506 irmp_param
.command_end
= NOKIA_COMMAND_OFFSET
+ NOKIA_COMMAND_LEN
;
3508 if (irmp_tmp_command
& 0x300)
3510 irmp_tmp_address
= (irmp_tmp_command
>> 8);
3511 irmp_tmp_command
&= 0xFF;
3517 #if IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
3518 if (irmp_param
.protocol
== IRMP_RUWIDO_PROTOCOL
&& !irmp_param
.stop_bit
)
3520 if (irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
- 2)
3521 { // special manchester decoder
3522 irmp_param
.complete_len
= RUWIDO_COMPLETE_DATA_LEN
; // correct complete len
3523 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3524 irmp_param
.stop_bit
= TRUE
; // set flag
3526 else if (irmp_bit
>= RUWIDO_COMPLETE_DATA_LEN
)
3529 ANALYZE_PRINTF ("Switching to SIEMENS protocol\n");
3531 irmp_param
.protocol
= IRMP_SIEMENS_PROTOCOL
; // change protocol
3532 irmp_param
.address_offset
= SIEMENS_ADDRESS_OFFSET
;
3533 irmp_param
.address_end
= SIEMENS_ADDRESS_OFFSET
+ SIEMENS_ADDRESS_LEN
;
3534 irmp_param
.command_offset
= SIEMENS_COMMAND_OFFSET
;
3535 irmp_param
.command_end
= SIEMENS_COMMAND_OFFSET
+ SIEMENS_COMMAND_LEN
;
3538 // RUWIDO: AAAAAAAAACCCCCCCp
3539 // SIEMENS: AAAAAAAAAAACCCCCCCCCCp
3540 irmp_tmp_address
<<= 2;
3541 irmp_tmp_address
|= (irmp_tmp_command
>> 6);
3542 irmp_tmp_command
&= 0x003F;
3543 // irmp_tmp_command <<= 4;
3544 irmp_tmp_command
|= last_value
;
3549 #if IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
3550 if (irmp_param
.protocol
== IRMP_ROOMBA_PROTOCOL
&& // Roomba has no stop bit
3551 irmp_bit
>= ROOMBA_COMPLETE_DATA_LEN
- 1) // it's the last data bit...
3552 { // break and close this frame
3553 if (irmp_pulse_time
>= ROOMBA_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_1_PULSE_LEN_MAX
)
3555 irmp_pause_time
= ROOMBA_1_PAUSE_LEN_EXACT
;
3557 else if (irmp_pulse_time
>= ROOMBA_0_PULSE_LEN_MIN
&& irmp_pulse_time
<= ROOMBA_0_PULSE_LEN_MAX
)
3559 irmp_pause_time
= ROOMBA_0_PAUSE_LEN
;
3562 got_light
= TRUE
; // this is a lie, but helps (generates stop bit)
3566 #if IRMP_SUPPORT_MANCHESTER == 1
3567 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
) &&
3568 irmp_pause_time
>= 2 * irmp_param
.pause_1_len_max
&& irmp_bit
>= irmp_param
.complete_len
- 2 && !irmp_param
.stop_bit
)
3569 { // special manchester decoder
3570 got_light
= TRUE
; // this is a lie, but generates a stop bit ;-)
3571 irmp_param
.stop_bit
= TRUE
; // set flag
3574 #endif // IRMP_SUPPORT_MANCHESTER == 1
3575 if (irmp_pause_time
> IRMP_TIMEOUT_LEN
) // timeout?
3577 if (irmp_bit
== irmp_param
.complete_len
- 1 && irmp_param
.stop_bit
== 0)
3581 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3582 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3585 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3587 irmp_param
.stop_bit
= TRUE
; // set flag
3588 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3589 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3590 irmp_tmp_command
= (irmp_tmp_address
>> 4); // set command: upper 12 bits are command bits
3591 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3592 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3594 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3595 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3596 else if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& (irmp_bit
== 28 || irmp_bit
== 29)) // it was a LGAIR stop bit
3599 ANALYZE_PRINTF ("Switching to LGAIR protocol, irmp_bit = %d\n", irmp_bit
);
3601 irmp_param
.stop_bit
= TRUE
; // set flag
3602 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3603 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3604 irmp_tmp_command
= irmp_lgair_command
; // set command: upper 8 bits are command bits
3605 irmp_tmp_address
= irmp_lgair_address
; // lower 4 bits are address bits
3606 irmp_start_bit_detected
= 1; // tricky: don't wait for another start bit...
3608 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3610 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
3611 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
3612 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 32) // it was a NEC stop bit
3615 ANALYZE_PRINTF ("Switching to NEC protocol\n");
3617 irmp_param
.stop_bit
= TRUE
; // set flag
3618 irmp_param
.protocol
= IRMP_NEC_PROTOCOL
; // switch protocol
3619 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3621 // 0123456789ABC0123456789ABC0123456701234567
3622 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3623 // NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
3624 irmp_tmp_address
|= (irmp_tmp_address2
& 0x0007) << 13; // fm 2012-02-13: 12 -> 13
3625 irmp_tmp_command
= (irmp_tmp_address2
>> 3) | (irmp_tmp_command
<< 10);
3627 #endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
3628 #if IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3629 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& irmp_bit
== 28) // it was a NEC stop bit
3632 ANALYZE_PRINTF ("Switching to LGAIR protocol\n");
3634 irmp_param
.stop_bit
= TRUE
; // set flag
3635 irmp_param
.protocol
= IRMP_LGAIR_PROTOCOL
; // switch protocol
3636 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3637 irmp_tmp_address
= irmp_lgair_address
;
3638 irmp_tmp_command
= irmp_lgair_command
;
3640 #endif // IRMP_SUPPORT_LGAIR_PROTOCOL == 1
3641 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
3642 else if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&& (irmp_bit
== 16 || irmp_bit
== 17)) // it was a JVC stop bit
3645 ANALYZE_PRINTF ("Switching to JVC protocol, irmp_bit = %d\n", irmp_bit
);
3647 irmp_param
.stop_bit
= TRUE
; // set flag
3648 irmp_param
.protocol
= IRMP_JVC_PROTOCOL
; // switch protocol
3649 irmp_param
.complete_len
= irmp_bit
; // patch length: 16 or 17
3651 // 0123456789ABC0123456789ABC0123456701234567
3652 // NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
3653 // JVC: AAAACCCCCCCCCCCC
3654 irmp_tmp_command
= (irmp_tmp_address
>> 4) | (irmp_tmp_address2
<< 9); // set command: upper 12 bits are command bits
3655 irmp_tmp_address
= irmp_tmp_address
& 0x000F; // lower 4 bits are address bits
3657 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
3658 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
3660 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
3661 else if (irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
&& irmp_bit
== 32) // it was a SAMSUNG32 stop bit
3664 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol\n");
3666 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
3667 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
3668 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
3669 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
3671 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3673 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
3674 else if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
&& (irmp_bit
== 12 || irmp_bit
== 24)) // it was a RCMM stop bit
3678 irmp_tmp_command
= (irmp_tmp_address
& 0xFF); // set command: lower 8 bits are command bits
3679 irmp_tmp_address
>>= 8; // upper 4 bits are address bits
3682 ANALYZE_PRINTF ("Switching to RCMM12 protocol, irmp_bit = %d\n", irmp_bit
);
3684 irmp_param
.protocol
= IRMP_RCMM12_PROTOCOL
; // switch protocol
3686 else // if ((irmp_bit == 24)
3689 ANALYZE_PRINTF ("Switching to RCMM24 protocol, irmp_bit = %d\n", irmp_bit
);
3691 irmp_param
.protocol
= IRMP_RCMM24_PROTOCOL
; // switch protocol
3693 irmp_param
.stop_bit
= TRUE
; // set flag
3694 irmp_param
.complete_len
= irmp_bit
; // patch length
3696 #endif // IRMP_SUPPORT_RCMM_PROTOCOL == 1
3700 ANALYZE_PRINTF ("error 2: pause %d after data bit %d too long\n", irmp_pause_time
, irmp_bit
);
3701 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3703 irmp_start_bit_detected
= 0; // wait for another start bit...
3704 irmp_pulse_time
= 0;
3705 irmp_pause_time
= 0;
3718 ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3721 #if IRMP_SUPPORT_MANCHESTER == 1
3722 if ((irmp_param
.flags
& IRMP_PARAM_FLAG_IS_MANCHESTER
)) // Manchester
3725 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
/* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
3726 #else // better, but some IR-RCs use asymmetric timings :-/
3727 if (irmp_pulse_time
> irmp_param
.pulse_1_len_max
&& irmp_pulse_time
<= 2 * irmp_param
.pulse_1_len_max
&&
3728 irmp_pause_time
<= 2 * irmp_param
.pause_1_len_max
)
3731 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3732 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3735 ANALYZE_PUTCHAR ('T');
3737 if (irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode 6A
3752 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3755 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '0' : '1');
3757 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 0 : 1 );
3759 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3760 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 4 && irmp_pulse_time
> RC6_TOGGLE_BIT_LEN_MIN
) // RC6 toggle bit
3763 ANALYZE_PUTCHAR ('T');
3767 if (irmp_pause_time
> 2 * irmp_param
.pause_1_len_max
)
3780 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3783 ANALYZE_PUTCHAR ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? '1' : '0');
3785 irmp_store_bit ((irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0 );
3786 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3787 if (! irmp_param2
.protocol
)
3794 last_value
= (irmp_param
.flags
& IRMP_PARAM_FLAG_1ST_PULSE_IS_1
) ? 1 : 0;
3798 else if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
3799 /* && irmp_pause_time <= 2 * irmp_param.pause_1_len_max */)
3801 uint_fast8_t manchester_value
;
3803 if (last_pause
> irmp_param
.pause_1_len_max
&& last_pause
<= 2 * irmp_param
.pause_1_len_max
)
3805 manchester_value
= last_value
? 0 : 1;
3806 last_value
= manchester_value
;
3810 manchester_value
= last_value
;
3814 ANALYZE_PUTCHAR (manchester_value
+ '0');
3817 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
3818 if (! irmp_param2
.protocol
)
3826 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
3827 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_bit
== 1 && manchester_value
== 1) // RC6 mode != 0 ???
3830 ANALYZE_PRINTF ("Switching to RC6A protocol\n");
3832 irmp_param
.complete_len
= RC6_COMPLETE_DATA_LEN_LONG
;
3833 irmp_param
.address_offset
= 5;
3834 irmp_param
.address_end
= irmp_param
.address_offset
+ 15;
3835 irmp_param
.command_offset
= irmp_param
.address_end
+ 1; // skip 1 system bit, changes like a toggle bit
3836 irmp_param
.command_end
= irmp_param
.command_offset
+ 16 - 1;
3837 irmp_tmp_address
= 0;
3839 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
3841 irmp_store_bit (manchester_value
);
3845 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3846 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&&
3847 irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
&&
3848 ((irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
) ||
3849 (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)))
3852 ANALYZE_PUTCHAR ('?');
3854 irmp_param
.protocol
= 0; // switch to FDC, see below
3857 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3858 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3859 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&&
3860 irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
&&
3861 ((irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
) ||
3862 (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)))
3865 ANALYZE_PUTCHAR ('?');
3867 irmp_param
.protocol
= 0; // switch to RCCAR, see below
3870 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3873 ANALYZE_PUTCHAR ('?');
3875 ANALYZE_PRINTF ("error 3 manchester: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
3876 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
3878 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
3879 irmp_pause_time
= 0;
3883 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_FDC_PROTOCOL == 1
3884 if (irmp_param2
.protocol
== IRMP_FDC_PROTOCOL
&& irmp_pulse_time
>= FDC_PULSE_LEN_MIN
&& irmp_pulse_time
<= FDC_PULSE_LEN_MAX
)
3886 if (irmp_pause_time
>= FDC_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_1_PAUSE_LEN_MAX
)
3889 ANALYZE_PRINTF (" 1 (FDC)\n");
3891 irmp_store_bit2 (1);
3893 else if (irmp_pause_time
>= FDC_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= FDC_0_PAUSE_LEN_MAX
)
3896 ANALYZE_PRINTF (" 0 (FDC)\n");
3898 irmp_store_bit2 (0);
3901 if (! irmp_param
.protocol
)
3904 ANALYZE_PRINTF ("Switching to FDC protocol\n");
3906 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3907 irmp_param2
.protocol
= 0;
3908 irmp_tmp_address
= irmp_tmp_address2
;
3909 irmp_tmp_command
= irmp_tmp_command2
;
3912 #endif // IRMP_SUPPORT_FDC_PROTOCOL == 1
3913 #if IRMP_SUPPORT_RC5_PROTOCOL == 1 && IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3914 if (irmp_param2
.protocol
== IRMP_RCCAR_PROTOCOL
&& irmp_pulse_time
>= RCCAR_PULSE_LEN_MIN
&& irmp_pulse_time
<= RCCAR_PULSE_LEN_MAX
)
3916 if (irmp_pause_time
>= RCCAR_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_1_PAUSE_LEN_MAX
)
3919 ANALYZE_PRINTF (" 1 (RCCAR)\n");
3921 irmp_store_bit2 (1);
3923 else if (irmp_pause_time
>= RCCAR_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCCAR_0_PAUSE_LEN_MAX
)
3926 ANALYZE_PRINTF (" 0 (RCCAR)\n");
3928 irmp_store_bit2 (0);
3931 if (! irmp_param
.protocol
)
3934 ANALYZE_PRINTF ("Switching to RCCAR protocol\n");
3936 memcpy (&irmp_param
, &irmp_param2
, sizeof (IRMP_PARAMETER
));
3937 irmp_param2
.protocol
= 0;
3938 irmp_tmp_address
= irmp_tmp_address2
;
3939 irmp_tmp_command
= irmp_tmp_command2
;
3942 #endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
3944 last_pause
= irmp_pause_time
;
3948 #endif // IRMP_SUPPORT_MANCHESTER == 1
3950 #if IRMP_SUPPORT_SERIAL == 1
3951 if (irmp_param
.flags
& IRMP_PARAM_FLAG_IS_SERIAL
)
3953 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pulse_time
> irmp_param
.pulse_1_len_max
)
3956 ANALYZE_PUTCHAR ('1');
3960 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
)
3962 irmp_pulse_time
-= irmp_param
.pulse_1_len_min
;
3966 irmp_pulse_time
= 0;
3970 while (irmp_bit
< irmp_param
.complete_len
&& irmp_pause_time
> irmp_param
.pause_1_len_max
)
3973 ANALYZE_PUTCHAR ('0');
3977 if (irmp_pause_time
>= irmp_param
.pause_1_len_min
)
3979 irmp_pause_time
-= irmp_param
.pause_1_len_min
;
3983 irmp_pause_time
= 0;
3992 #endif // IRMP_SUPPORT_SERIAL == 1
3994 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
3995 if (irmp_param
.protocol
== IRMP_SAMSUNG_PROTOCOL
&& irmp_bit
== 16) // Samsung: 16th bit
3997 if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
&&
3998 irmp_pause_time
>= SAMSUNG_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_START_BIT_PAUSE_LEN_MAX
)
4001 ANALYZE_PRINTF ("SYNC\n");
4006 else if (irmp_pulse_time
>= SAMSUNG_PULSE_LEN_MIN
&& irmp_pulse_time
<= SAMSUNG_PULSE_LEN_MAX
)
4008 #if IRMP_SUPPORT_SAMSUNG48_PROTOCOL == 1
4010 ANALYZE_PRINTF ("Switching to SAMSUNG48 protocol ");
4012 irmp_param
.protocol
= IRMP_SAMSUNG48_PROTOCOL
;
4013 irmp_param
.command_offset
= SAMSUNG48_COMMAND_OFFSET
;
4014 irmp_param
.command_end
= SAMSUNG48_COMMAND_OFFSET
+ SAMSUNG48_COMMAND_LEN
;
4015 irmp_param
.complete_len
= SAMSUNG48_COMPLETE_DATA_LEN
;
4018 ANALYZE_PRINTF ("Switching to SAMSUNG32 protocol ");
4020 irmp_param
.protocol
= IRMP_SAMSUNG32_PROTOCOL
;
4021 irmp_param
.command_offset
= SAMSUNG32_COMMAND_OFFSET
;
4022 irmp_param
.command_end
= SAMSUNG32_COMMAND_OFFSET
+ SAMSUNG32_COMMAND_LEN
;
4023 irmp_param
.complete_len
= SAMSUNG32_COMPLETE_DATA_LEN
;
4025 if (irmp_pause_time
>= SAMSUNG_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= SAMSUNG_1_PAUSE_LEN_MAX
)
4028 ANALYZE_PUTCHAR ('1');
4037 ANALYZE_PUTCHAR ('0');
4045 { // timing incorrect!
4047 ANALYZE_PRINTF ("error 3 Samsung: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4048 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4050 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4051 irmp_pause_time
= 0;
4055 #endif // IRMP_SUPPORT_SAMSUNG_PROTOCOL
4057 #if IRMP_SUPPORT_NEC16_PROTOCOL
4058 #if IRMP_SUPPORT_NEC42_PROTOCOL == 1
4059 if (irmp_param
.protocol
== IRMP_NEC42_PROTOCOL
&&
4060 #else // IRMP_SUPPORT_NEC_PROTOCOL instead
4061 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&&
4062 #endif // IRMP_SUPPORT_NEC42_PROTOCOL == 1
4063 irmp_bit
== 8 && irmp_pause_time
>= NEC_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= NEC_START_BIT_PAUSE_LEN_MAX
)
4066 ANALYZE_PRINTF ("Switching to NEC16 protocol\n");
4068 irmp_param
.protocol
= IRMP_NEC16_PROTOCOL
;
4069 irmp_param
.address_offset
= NEC16_ADDRESS_OFFSET
;
4070 irmp_param
.address_end
= NEC16_ADDRESS_OFFSET
+ NEC16_ADDRESS_LEN
;
4071 irmp_param
.command_offset
= NEC16_COMMAND_OFFSET
;
4072 irmp_param
.command_end
= NEC16_COMMAND_OFFSET
+ NEC16_COMMAND_LEN
;
4073 irmp_param
.complete_len
= NEC16_COMPLETE_DATA_LEN
;
4077 #endif // IRMP_SUPPORT_NEC16_PROTOCOL
4079 #if IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
4080 if (irmp_param
.protocol
== IRMP_BANG_OLUFSEN_PROTOCOL
)
4082 if (irmp_pulse_time
>= BANG_OLUFSEN_PULSE_LEN_MIN
&& irmp_pulse_time
<= BANG_OLUFSEN_PULSE_LEN_MAX
)
4084 if (irmp_bit
== 1) // Bang & Olufsen: 3rd bit
4086 if (irmp_pause_time
>= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
)
4089 ANALYZE_PRINTF ("3rd start bit\n");
4095 { // timing incorrect!
4097 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
);
4098 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4100 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4101 irmp_pause_time
= 0;
4104 else if (irmp_bit
== 19) // Bang & Olufsen: trailer bit
4106 if (irmp_pause_time
>= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN_MAX
)
4109 ANALYZE_PRINTF ("trailer bit\n");
4115 { // timing incorrect!
4117 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
);
4118 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4120 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4121 irmp_pause_time
= 0;
4126 if (irmp_pause_time
>= BANG_OLUFSEN_1_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_1_PAUSE_LEN_MAX
)
4127 { // pulse & pause timings correct for "1"?
4129 ANALYZE_PUTCHAR ('1');
4136 else if (irmp_pause_time
>= BANG_OLUFSEN_0_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_0_PAUSE_LEN_MAX
)
4137 { // pulse & pause timings correct for "0"?
4139 ANALYZE_PUTCHAR ('0');
4146 else if (irmp_pause_time
>= BANG_OLUFSEN_R_PAUSE_LEN_MIN
&& irmp_pause_time
<= BANG_OLUFSEN_R_PAUSE_LEN_MAX
)
4149 ANALYZE_PUTCHAR (last_value
+ '0');
4152 irmp_store_bit (last_value
);
4156 { // timing incorrect!
4158 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
);
4159 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4161 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4162 irmp_pause_time
= 0;
4167 { // timing incorrect!
4169 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
);
4170 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4172 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4173 irmp_pause_time
= 0;
4177 #endif // IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL
4179 #if IRMP_SUPPORT_RCMM_PROTOCOL == 1
4180 if (irmp_param
.protocol
== IRMP_RCMM32_PROTOCOL
)
4182 if (irmp_pause_time
>= RCMM32_BIT_00_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_00_PAUSE_LEN_MAX
)
4185 ANALYZE_PUTCHAR ('0');
4186 ANALYZE_PUTCHAR ('0');
4191 else if (irmp_pause_time
>= RCMM32_BIT_01_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_01_PAUSE_LEN_MAX
)
4194 ANALYZE_PUTCHAR ('0');
4195 ANALYZE_PUTCHAR ('1');
4200 else if (irmp_pause_time
>= RCMM32_BIT_10_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_10_PAUSE_LEN_MAX
)
4203 ANALYZE_PUTCHAR ('1');
4204 ANALYZE_PUTCHAR ('0');
4209 else if (irmp_pause_time
>= RCMM32_BIT_11_PAUSE_LEN_MIN
&& irmp_pause_time
<= RCMM32_BIT_11_PAUSE_LEN_MAX
)
4212 ANALYZE_PUTCHAR ('1');
4213 ANALYZE_PUTCHAR ('1');
4219 ANALYZE_PRINTF ("\n");
4226 if (irmp_pulse_time
>= irmp_param
.pulse_1_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_1_len_max
&&
4227 irmp_pause_time
>= irmp_param
.pause_1_len_min
&& irmp_pause_time
<= irmp_param
.pause_1_len_max
)
4228 { // pulse & pause timings correct for "1"?
4230 ANALYZE_PUTCHAR ('1');
4236 else if (irmp_pulse_time
>= irmp_param
.pulse_0_len_min
&& irmp_pulse_time
<= irmp_param
.pulse_0_len_max
&&
4237 irmp_pause_time
>= irmp_param
.pause_0_len_min
&& irmp_pause_time
<= irmp_param
.pause_0_len_max
)
4238 { // pulse & pause timings correct for "0"?
4240 ANALYZE_PUTCHAR ('0');
4247 #if IRMP_SUPPORT_KATHREIN_PROTOCOL
4249 if (irmp_param
.protocol
== IRMP_KATHREIN_PROTOCOL
&&
4250 irmp_pulse_time
>= KATHREIN_1_PULSE_LEN_MIN
&& irmp_pulse_time
<= KATHREIN_1_PULSE_LEN_MAX
&&
4251 (((irmp_bit
== 8 || irmp_bit
== 6) &&
4252 irmp_pause_time
>= KATHREIN_SYNC_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_SYNC_BIT_PAUSE_LEN_MAX
) ||
4254 irmp_pause_time
>= KATHREIN_START_BIT_PAUSE_LEN_MIN
&& irmp_pause_time
<= KATHREIN_START_BIT_PAUSE_LEN_MAX
)))
4261 ANALYZE_PUTCHAR ('S');
4264 irmp_tmp_command
<<= 1;
4269 ANALYZE_PUTCHAR ('S');
4277 #endif // IRMP_SUPPORT_KATHREIN_PROTOCOL
4278 { // timing incorrect!
4280 ANALYZE_PRINTF ("error 3: timing not correct: data bit %d, pulse: %d, pause: %d\n", irmp_bit
, irmp_pulse_time
, irmp_pause_time
);
4281 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4283 irmp_start_bit_detected
= 0; // reset flags and wait for next start bit
4284 irmp_pause_time
= 0;
4287 irmp_pulse_time
= 1; // set counter to 1, not 0
4291 { // counting the pulse length ...
4292 if (! irmp_input
) // still light?
4294 irmp_pulse_time
++; // increment counter
4298 wait_for_space
= 1; // let's count the time (see above)
4299 irmp_pause_time
= 1; // set pause counter to 1, not 0
4303 if (irmp_start_bit_detected
&& irmp_bit
== irmp_param
.complete_len
&& irmp_param
.stop_bit
== 0) // enough bits received?
4305 if (last_irmp_command
== irmp_tmp_command
&& key_repetition_len
< AUTO_FRAME_REPETITION_LEN
)
4307 repetition_frame_number
++;
4311 repetition_frame_number
= 0;
4314 #if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
4315 // if SIRCS protocol and the code will be repeated within 50 ms, we will ignore 2nd and 3rd repetition frame
4316 if (irmp_param
.protocol
== IRMP_SIRCS_PROTOCOL
&& (repetition_frame_number
== 1 || repetition_frame_number
== 2))
4319 ANALYZE_PRINTF ("code skipped: SIRCS auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4320 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4322 key_repetition_len
= 0;
4327 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4328 // if ORTEK protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4329 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
&& repetition_frame_number
== 1)
4332 ANALYZE_PRINTF ("code skipped: ORTEK auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4333 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4335 key_repetition_len
= 0;
4340 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4341 // if KASEIKYO protocol and the code will be repeated within 50 ms, we will ignore 2nd repetition frame
4342 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
&& repetition_frame_number
== 1)
4345 ANALYZE_PRINTF ("code skipped: KASEIKYO auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4346 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4348 key_repetition_len
= 0;
4353 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4354 // if SAMSUNG32 or SAMSUNG48 protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4355 if ((irmp_param
.protocol
== IRMP_SAMSUNG32_PROTOCOL
|| irmp_param
.protocol
== IRMP_SAMSUNG48_PROTOCOL
) && (repetition_frame_number
& 0x01))
4358 ANALYZE_PRINTF ("code skipped: SAMSUNG32/SAMSUNG48 auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4359 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4361 key_repetition_len
= 0;
4366 #if IRMP_SUPPORT_NUBERT_PROTOCOL == 1
4367 // if NUBERT protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4368 if (irmp_param
.protocol
== IRMP_NUBERT_PROTOCOL
&& (repetition_frame_number
& 0x01))
4371 ANALYZE_PRINTF ("code skipped: NUBERT auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4372 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4374 key_repetition_len
= 0;
4379 #if IRMP_SUPPORT_SPEAKER_PROTOCOL == 1
4380 // if SPEAKER protocol and the code will be repeated within 50 ms, we will ignore every 2nd frame
4381 if (irmp_param
.protocol
== IRMP_SPEAKER_PROTOCOL
&& (repetition_frame_number
& 0x01))
4384 ANALYZE_PRINTF ("code skipped: SPEAKER auto repetition frame #%d, counter = %d, auto repetition len = %d\n",
4385 repetition_frame_number
+ 1, key_repetition_len
, AUTO_FRAME_REPETITION_LEN
);
4387 key_repetition_len
= 0;
4394 ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter
* 1000) / F_INTERRUPTS
, irmp_bit
);
4396 irmp_ir_detected
= TRUE
;
4398 #if IRMP_SUPPORT_DENON_PROTOCOL == 1
4399 if (irmp_param
.protocol
== IRMP_DENON_PROTOCOL
)
4400 { // check for repetition frame
4401 if ((~irmp_tmp_command
& 0x3FF) == last_irmp_denon_command
) // command bits must be inverted
4403 irmp_tmp_command
= last_irmp_denon_command
; // use command received before!
4404 last_irmp_denon_command
= 0;
4406 irmp_protocol
= irmp_param
.protocol
; // store protocol
4407 irmp_address
= irmp_tmp_address
; // store address
4408 irmp_command
= irmp_tmp_command
; // store command
4412 if ((irmp_tmp_command
& 0x01) == 0x00)
4415 ANALYZE_PRINTF ("%8.3fms info Denon: waiting for inverted command repetition\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4417 last_irmp_denon_command
= irmp_tmp_command
;
4418 denon_repetition_len
= 0;
4419 irmp_ir_detected
= FALSE
;
4424 ANALYZE_PRINTF ("%8.3fms warning Denon: got unexpected inverted command, ignoring it\n", (double) (time_counter
* 1000) / F_INTERRUPTS
);
4426 last_irmp_denon_command
= 0;
4427 irmp_ir_detected
= FALSE
;
4432 #endif // IRMP_SUPPORT_DENON_PROTOCOL
4434 #if IRMP_SUPPORT_GRUNDIG_PROTOCOL == 1
4435 if (irmp_param
.protocol
== IRMP_GRUNDIG_PROTOCOL
&& irmp_tmp_command
== 0x01ff)
4436 { // Grundig start frame?
4438 ANALYZE_PRINTF ("Detected GRUNDIG start frame, ignoring it\n");
4440 irmp_ir_detected
= FALSE
;
4443 #endif // IRMP_SUPPORT_GRUNDIG_PROTOCOL
4445 #if IRMP_SUPPORT_NOKIA_PROTOCOL == 1
4446 if (irmp_param
.protocol
== IRMP_NOKIA_PROTOCOL
&& irmp_tmp_address
== 0x00ff && irmp_tmp_command
== 0x00fe)
4447 { // Nokia start frame?
4449 ANALYZE_PRINTF ("Detected NOKIA start frame, ignoring it\n");
4451 irmp_ir_detected
= FALSE
;
4454 #endif // IRMP_SUPPORT_NOKIA_PROTOCOL
4456 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4457 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
&& irmp_bit
== 0) // repetition frame
4459 if (key_repetition_len
< NEC_FRAME_REPEAT_PAUSE_LEN_MAX
)
4462 ANALYZE_PRINTF ("Detected NEC repetition frame, key_repetition_len = %d\n", key_repetition_len
);
4463 ANALYZE_ONLY_NORMAL_PRINTF("REPETETION FRAME ");
4465 irmp_tmp_address
= last_irmp_address
; // address is last address
4466 irmp_tmp_command
= last_irmp_command
; // command is last command
4467 irmp_flags
|= IRMP_FLAG_REPETITION
;
4468 key_repetition_len
= 0;
4473 ANALYZE_PRINTF ("Detected NEC repetition frame, ignoring it: timeout occured, key_repetition_len = %d > %d\n",
4474 key_repetition_len
, NEC_FRAME_REPEAT_PAUSE_LEN_MAX
);
4476 irmp_ir_detected
= FALSE
;
4479 #endif // IRMP_SUPPORT_NEC_PROTOCOL
4481 #if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4482 if (irmp_param
.protocol
== IRMP_KASEIKYO_PROTOCOL
)
4484 uint_fast8_t xor_value
;
4486 xor_value
= (xor_check
[0] & 0x0F) ^ ((xor_check
[0] & 0xF0) >> 4) ^ (xor_check
[1] & 0x0F) ^ ((xor_check
[1] & 0xF0) >> 4);
4488 if (xor_value
!= (xor_check
[2] & 0x0F))
4491 ANALYZE_PRINTF ("error 4: wrong XOR check for customer id: 0x%1x 0x%1x\n", xor_value
, xor_check
[2] & 0x0F);
4493 irmp_ir_detected
= FALSE
;
4496 xor_value
= xor_check
[2] ^ xor_check
[3] ^ xor_check
[4];
4498 if (xor_value
!= xor_check
[5])
4501 ANALYZE_PRINTF ("error 5: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor_value
, xor_check
[5]);
4503 irmp_ir_detected
= FALSE
;
4506 irmp_flags
|= genre2
; // write the genre2 bits into MSB of the flag byte
4508 #endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
4510 #if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4511 if (irmp_param
.protocol
== IRMP_ORTEK_PROTOCOL
)
4513 if (parity
== PARITY_CHECK_FAILED
)
4516 ANALYZE_PRINTF ("error 6: parity check failed\n");
4518 irmp_ir_detected
= FALSE
;
4521 if ((irmp_tmp_address
& 0x03) == 0x02)
4524 ANALYZE_PRINTF ("code skipped: ORTEK end of transmission frame (key release)\n");
4526 irmp_ir_detected
= FALSE
;
4528 irmp_tmp_address
>>= 2;
4530 #endif // IRMP_SUPPORT_ORTEK_PROTOCOL == 1
4532 #if IRMP_SUPPORT_RC6_PROTOCOL == 1
4533 if (irmp_param
.protocol
== IRMP_RC6_PROTOCOL
&& irmp_param
.complete_len
== RC6_COMPLETE_DATA_LEN_LONG
) // RC6 mode = 6?
4535 irmp_protocol
= IRMP_RC6A_PROTOCOL
;
4538 #endif // IRMP_SUPPORT_RC6_PROTOCOL == 1
4540 irmp_protocol
= irmp_param
.protocol
;
4543 #if IRMP_SUPPORT_FDC_PROTOCOL == 1
4544 if (irmp_param
.protocol
== IRMP_FDC_PROTOCOL
)
4546 if (irmp_tmp_command
& 0x000F) // released key?
4548 irmp_tmp_command
= (irmp_tmp_command
>> 4) | 0x80; // yes, set bit 7
4552 irmp_tmp_command
>>= 4; // no, it's a pressed key
4554 irmp_tmp_command
|= (irmp_tmp_address
<< 2) & 0x0F00; // 000000CCCCAAAAAA -> 0000CCCC00000000
4555 irmp_tmp_address
&= 0x003F;
4559 irmp_address
= irmp_tmp_address
; // store address
4560 #if IRMP_SUPPORT_NEC_PROTOCOL == 1
4561 if (irmp_param
.protocol
== IRMP_NEC_PROTOCOL
)
4563 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4567 #if IRMP_SUPPORT_RC5_PROTOCOL == 1
4568 if (irmp_param
.protocol
== IRMP_RC5_PROTOCOL
)
4570 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4573 #if IRMP_SUPPORT_S100_PROTOCOL == 1
4574 if (irmp_param
.protocol
== IRMP_S100_PROTOCOL
)
4576 irmp_tmp_command
|= rc5_cmd_bit6
; // store bit 6
4579 irmp_command
= irmp_tmp_command
; // store command
4581 #if IRMP_SUPPORT_SAMSUNG_PROTOCOL == 1
4582 irmp_id
= irmp_tmp_id
;
4587 if (irmp_ir_detected
)
4589 if (last_irmp_command
== irmp_tmp_command
&&
4590 last_irmp_address
== irmp_tmp_address
&&
4591 key_repetition_len
< IRMP_KEY_REPETITION_LEN
)
4593 irmp_flags
|= IRMP_FLAG_REPETITION
;
4596 last_irmp_address
= irmp_tmp_address
; // store as last address, too
4597 last_irmp_command
= irmp_tmp_command
; // store as last command, too
4599 key_repetition_len
= 0;
4604 ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
4608 irmp_start_bit_detected
= 0; // and wait for next start bit
4609 irmp_tmp_command
= 0;
4610 irmp_pulse_time
= 0;
4611 irmp_pause_time
= 0;
4613 #if IRMP_SUPPORT_JVC_PROTOCOL == 1
4614 if (irmp_protocol
== IRMP_JVC_PROTOCOL
) // the stop bit of JVC frame is also start bit of next frame
4615 { // set pulse time here!
4616 irmp_pulse_time
= ((uint_fast8_t)(F_INTERRUPTS
* JVC_START_BIT_PULSE_TIME
));
4618 #endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
4623 #if defined(STELLARIS_ARM_CORTEX_M4)
4624 // Clear the timer interrupt
4625 TimerIntClear(TIMER1_BASE
, TIMER_TIMA_TIMEOUT
);
4628 return (irmp_ir_detected
);
4633 /*---------------------------------------------------------------------------------------------------------------------------------------------------
4634 * main functions - for Unix/Linux + Windows only!
4638 * Compile it under linux with:
4641 * usage: ./irmp [-v|-s|-a|-l|-p] < file
4647 * -l list pulse/pauses
4649 *---------------------------------------------------------------------------------------------------------------------------------------------------
4653 print_timings (void)
4655 printf ("IRMP_TIMEOUT_LEN: %d [%d byte(s)]\n", IRMP_TIMEOUT_LEN
, sizeof (PAUSE_LEN
));
4656 printf ("IRMP_KEY_REPETITION_LEN %d\n", IRMP_KEY_REPETITION_LEN
);
4658 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE-0 PAUSE-0 PULSE-1 PAUSE-1\n");
4659 printf ("====================================================================================\n");
4660 printf ("SIRCS 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4661 SIRCS_START_BIT_PULSE_LEN_MIN
, SIRCS_START_BIT_PULSE_LEN_MAX
, SIRCS_START_BIT_PAUSE_LEN_MIN
, SIRCS_START_BIT_PAUSE_LEN_MAX
,
4662 SIRCS_0_PULSE_LEN_MIN
, SIRCS_0_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
,
4663 SIRCS_1_PULSE_LEN_MIN
, SIRCS_1_PULSE_LEN_MAX
, SIRCS_PAUSE_LEN_MIN
, SIRCS_PAUSE_LEN_MAX
);
4665 printf ("NEC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4666 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_START_BIT_PAUSE_LEN_MIN
, NEC_START_BIT_PAUSE_LEN_MAX
,
4667 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4668 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4670 printf ("NEC (rep) 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4671 NEC_START_BIT_PULSE_LEN_MIN
, NEC_START_BIT_PULSE_LEN_MAX
, NEC_REPEAT_START_BIT_PAUSE_LEN_MIN
, NEC_REPEAT_START_BIT_PAUSE_LEN_MAX
,
4672 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_0_PAUSE_LEN_MIN
, NEC_0_PAUSE_LEN_MAX
,
4673 NEC_PULSE_LEN_MIN
, NEC_PULSE_LEN_MAX
, NEC_1_PAUSE_LEN_MIN
, NEC_1_PAUSE_LEN_MAX
);
4675 printf ("SAMSUNG 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4676 SAMSUNG_START_BIT_PULSE_LEN_MIN
, SAMSUNG_START_BIT_PULSE_LEN_MAX
, SAMSUNG_START_BIT_PAUSE_LEN_MIN
, SAMSUNG_START_BIT_PAUSE_LEN_MAX
,
4677 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_0_PAUSE_LEN_MIN
, SAMSUNG_0_PAUSE_LEN_MAX
,
4678 SAMSUNG_PULSE_LEN_MIN
, SAMSUNG_PULSE_LEN_MAX
, SAMSUNG_1_PAUSE_LEN_MIN
, SAMSUNG_1_PAUSE_LEN_MAX
);
4680 printf ("MATSUSHITA 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4681 MATSUSHITA_START_BIT_PULSE_LEN_MIN
, MATSUSHITA_START_BIT_PULSE_LEN_MAX
, MATSUSHITA_START_BIT_PAUSE_LEN_MIN
, MATSUSHITA_START_BIT_PAUSE_LEN_MAX
,
4682 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_0_PAUSE_LEN_MIN
, MATSUSHITA_0_PAUSE_LEN_MAX
,
4683 MATSUSHITA_PULSE_LEN_MIN
, MATSUSHITA_PULSE_LEN_MAX
, MATSUSHITA_1_PAUSE_LEN_MIN
, MATSUSHITA_1_PAUSE_LEN_MAX
);
4685 printf ("KASEIKYO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4686 KASEIKYO_START_BIT_PULSE_LEN_MIN
, KASEIKYO_START_BIT_PULSE_LEN_MAX
, KASEIKYO_START_BIT_PAUSE_LEN_MIN
, KASEIKYO_START_BIT_PAUSE_LEN_MAX
,
4687 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_0_PAUSE_LEN_MIN
, KASEIKYO_0_PAUSE_LEN_MAX
,
4688 KASEIKYO_PULSE_LEN_MIN
, KASEIKYO_PULSE_LEN_MAX
, KASEIKYO_1_PAUSE_LEN_MIN
, KASEIKYO_1_PAUSE_LEN_MAX
);
4690 printf ("RECS80 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4691 RECS80_START_BIT_PULSE_LEN_MIN
, RECS80_START_BIT_PULSE_LEN_MAX
, RECS80_START_BIT_PAUSE_LEN_MIN
, RECS80_START_BIT_PAUSE_LEN_MAX
,
4692 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_0_PAUSE_LEN_MIN
, RECS80_0_PAUSE_LEN_MAX
,
4693 RECS80_PULSE_LEN_MIN
, RECS80_PULSE_LEN_MAX
, RECS80_1_PAUSE_LEN_MIN
, RECS80_1_PAUSE_LEN_MAX
);
4695 printf ("RC5 1 %3d - %3d %3d - %3d %3d - %3d\n",
4696 RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
, RC5_START_BIT_LEN_MIN
, RC5_START_BIT_LEN_MAX
,
4697 RC5_BIT_LEN_MIN
, RC5_BIT_LEN_MAX
);
4699 printf ("DENON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4700 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
,
4701 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_0_PAUSE_LEN_MIN
, DENON_0_PAUSE_LEN_MAX
,
4702 DENON_PULSE_LEN_MIN
, DENON_PULSE_LEN_MAX
, DENON_1_PAUSE_LEN_MIN
, DENON_1_PAUSE_LEN_MAX
);
4704 printf ("THOMSON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4705 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
,
4706 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_0_PAUSE_LEN_MIN
, THOMSON_0_PAUSE_LEN_MAX
,
4707 THOMSON_PULSE_LEN_MIN
, THOMSON_PULSE_LEN_MAX
, THOMSON_1_PAUSE_LEN_MIN
, THOMSON_1_PAUSE_LEN_MAX
);
4709 printf ("RC6 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4710 RC6_START_BIT_PULSE_LEN_MIN
, RC6_START_BIT_PULSE_LEN_MAX
, RC6_START_BIT_PAUSE_LEN_MIN
, RC6_START_BIT_PAUSE_LEN_MAX
,
4711 RC6_BIT_PULSE_LEN_MIN
, RC6_BIT_PULSE_LEN_MAX
, RC6_BIT_PAUSE_LEN_MIN
, RC6_BIT_PAUSE_LEN_MAX
);
4713 printf ("RECS80EXT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4714 RECS80EXT_START_BIT_PULSE_LEN_MIN
, RECS80EXT_START_BIT_PULSE_LEN_MAX
, RECS80EXT_START_BIT_PAUSE_LEN_MIN
, RECS80EXT_START_BIT_PAUSE_LEN_MAX
,
4715 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_0_PAUSE_LEN_MIN
, RECS80EXT_0_PAUSE_LEN_MAX
,
4716 RECS80EXT_PULSE_LEN_MIN
, RECS80EXT_PULSE_LEN_MAX
, RECS80EXT_1_PAUSE_LEN_MIN
, RECS80EXT_1_PAUSE_LEN_MAX
);
4718 printf ("NUBERT 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4719 NUBERT_START_BIT_PULSE_LEN_MIN
, NUBERT_START_BIT_PULSE_LEN_MAX
, NUBERT_START_BIT_PAUSE_LEN_MIN
, NUBERT_START_BIT_PAUSE_LEN_MAX
,
4720 NUBERT_0_PULSE_LEN_MIN
, NUBERT_0_PULSE_LEN_MAX
, NUBERT_0_PAUSE_LEN_MIN
, NUBERT_0_PAUSE_LEN_MAX
,
4721 NUBERT_1_PULSE_LEN_MIN
, NUBERT_1_PULSE_LEN_MAX
, NUBERT_1_PAUSE_LEN_MIN
, NUBERT_1_PAUSE_LEN_MAX
);
4723 printf ("FAN 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4724 FAN_START_BIT_PULSE_LEN_MIN
, FAN_START_BIT_PULSE_LEN_MAX
, FAN_START_BIT_PAUSE_LEN_MIN
, FAN_START_BIT_PAUSE_LEN_MAX
,
4725 FAN_0_PULSE_LEN_MIN
, FAN_0_PULSE_LEN_MAX
, FAN_0_PAUSE_LEN_MIN
, FAN_0_PAUSE_LEN_MAX
,
4726 FAN_1_PULSE_LEN_MIN
, FAN_1_PULSE_LEN_MAX
, FAN_1_PAUSE_LEN_MIN
, FAN_1_PAUSE_LEN_MAX
);
4728 printf ("SPEAKER 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4729 SPEAKER_START_BIT_PULSE_LEN_MIN
, SPEAKER_START_BIT_PULSE_LEN_MAX
, SPEAKER_START_BIT_PAUSE_LEN_MIN
, SPEAKER_START_BIT_PAUSE_LEN_MAX
,
4730 SPEAKER_0_PULSE_LEN_MIN
, SPEAKER_0_PULSE_LEN_MAX
, SPEAKER_0_PAUSE_LEN_MIN
, SPEAKER_0_PAUSE_LEN_MAX
,
4731 SPEAKER_1_PULSE_LEN_MIN
, SPEAKER_1_PULSE_LEN_MAX
, SPEAKER_1_PAUSE_LEN_MIN
, SPEAKER_1_PAUSE_LEN_MAX
);
4733 printf ("BANG_OLUFSEN 1 %3d - %3d %3d - %3d\n",
4734 BANG_OLUFSEN_START_BIT1_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PULSE_LEN_MAX
,
4735 BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT1_PAUSE_LEN_MAX
);
4737 printf ("BANG_OLUFSEN 2 %3d - %3d %3d - %3d\n",
4738 BANG_OLUFSEN_START_BIT2_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PULSE_LEN_MAX
,
4739 BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT2_PAUSE_LEN_MAX
);
4741 printf ("BANG_OLUFSEN 3 %3d - %3d %3d - %3d\n",
4742 BANG_OLUFSEN_START_BIT3_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PULSE_LEN_MAX
,
4743 BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT3_PAUSE_LEN_MAX
);
4745 printf ("BANG_OLUFSEN 4 %3d - %3d %3d - %3d\n",
4746 BANG_OLUFSEN_START_BIT4_PULSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PULSE_LEN_MAX
,
4747 BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MIN
, BANG_OLUFSEN_START_BIT4_PAUSE_LEN_MAX
);
4749 printf ("BANG_OLUFSEN - %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4750 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_0_PAUSE_LEN_MIN
, BANG_OLUFSEN_0_PAUSE_LEN_MAX
,
4751 BANG_OLUFSEN_PULSE_LEN_MIN
, BANG_OLUFSEN_PULSE_LEN_MAX
, BANG_OLUFSEN_1_PAUSE_LEN_MIN
, BANG_OLUFSEN_1_PAUSE_LEN_MAX
);
4753 printf ("GRUNDIG/NOKIA 1 %3d - %3d %3d - %3d %3d - %3d\n",
4754 GRUNDIG_NOKIA_IR60_START_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_START_BIT_LEN_MAX
,
4755 GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MIN
, GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN_MAX
,
4756 GRUNDIG_NOKIA_IR60_BIT_LEN_MIN
, GRUNDIG_NOKIA_IR60_BIT_LEN_MAX
);
4758 printf ("SIEMENS/RUWIDO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4759 SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PULSE_LEN_MAX
,
4760 SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_START_BIT_PAUSE_LEN_MAX
,
4761 SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4762 SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
,
4763 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX
,
4764 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN
, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX
);
4766 printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4767 FDC_START_BIT_PULSE_LEN_MIN
, FDC_START_BIT_PULSE_LEN_MAX
, FDC_START_BIT_PAUSE_LEN_MIN
, FDC_START_BIT_PAUSE_LEN_MAX
,
4768 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_0_PAUSE_LEN_MIN
, FDC_0_PAUSE_LEN_MAX
,
4769 FDC_PULSE_LEN_MIN
, FDC_PULSE_LEN_MAX
, FDC_1_PAUSE_LEN_MIN
, FDC_1_PAUSE_LEN_MAX
);
4771 printf ("RCCAR 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4772 RCCAR_START_BIT_PULSE_LEN_MIN
, RCCAR_START_BIT_PULSE_LEN_MAX
, RCCAR_START_BIT_PAUSE_LEN_MIN
, RCCAR_START_BIT_PAUSE_LEN_MAX
,
4773 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_0_PAUSE_LEN_MIN
, RCCAR_0_PAUSE_LEN_MAX
,
4774 RCCAR_PULSE_LEN_MIN
, RCCAR_PULSE_LEN_MAX
, RCCAR_1_PAUSE_LEN_MIN
, RCCAR_1_PAUSE_LEN_MAX
);
4776 printf ("NIKON 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4777 NIKON_START_BIT_PULSE_LEN_MIN
, NIKON_START_BIT_PULSE_LEN_MAX
, NIKON_START_BIT_PAUSE_LEN_MIN
, NIKON_START_BIT_PAUSE_LEN_MAX
,
4778 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_0_PAUSE_LEN_MIN
, NIKON_0_PAUSE_LEN_MAX
,
4779 NIKON_PULSE_LEN_MIN
, NIKON_PULSE_LEN_MAX
, NIKON_1_PAUSE_LEN_MIN
, NIKON_1_PAUSE_LEN_MAX
);
4781 printf ("LEGO 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4782 LEGO_START_BIT_PULSE_LEN_MIN
, LEGO_START_BIT_PULSE_LEN_MAX
, LEGO_START_BIT_PAUSE_LEN_MIN
, LEGO_START_BIT_PAUSE_LEN_MAX
,
4783 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_0_PAUSE_LEN_MIN
, LEGO_0_PAUSE_LEN_MAX
,
4784 LEGO_PULSE_LEN_MIN
, LEGO_PULSE_LEN_MAX
, LEGO_1_PAUSE_LEN_MIN
, LEGO_1_PAUSE_LEN_MAX
);
4787 printf ("PROTOCOL S S-PULSE S-PAUSE PULSE PAUSE-00 PAUSE-01 PAUSE-10 PAUSE-11\n");
4788 printf ("================================================================================================\n");
4789 printf ("RCMM 1 %3d %3d %3d %3d %3d %3d %3d\n",
4790 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PULSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_START_BIT_PAUSE_TIME
),
4791 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_PULSE_TIME
),
4792 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_00_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_01_PAUSE_TIME
),
4793 (uint_fast8_t)(F_INTERRUPTS
* RCMM32_10_PAUSE_TIME
), (uint_fast8_t)(F_INTERRUPTS
* RCMM32_11_PAUSE_TIME
));
4794 printf ("RCMM 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
4795 RCMM32_START_BIT_PULSE_LEN_MIN
, RCMM32_START_BIT_PULSE_LEN_MAX
, RCMM32_START_BIT_PAUSE_LEN_MIN
, RCMM32_START_BIT_PAUSE_LEN_MAX
,
4796 RCMM32_BIT_PULSE_LEN_MIN
, RCMM32_BIT_PULSE_LEN_MAX
, RCMM32_BIT_00_PAUSE_LEN_MIN
, RCMM32_BIT_00_PAUSE_LEN_MAX
,
4797 RCMM32_BIT_01_PAUSE_LEN_MIN
, RCMM32_BIT_01_PAUSE_LEN_MAX
, RCMM32_BIT_10_PAUSE_LEN_MIN
, RCMM32_BIT_10_PAUSE_LEN_MAX
,
4798 RCMM32_BIT_11_PAUSE_LEN_MIN
, RCMM32_BIT_11_PAUSE_LEN_MAX
);
4802 print_spectrum (char * text
, int * buf
, int is_pulse
)
4815 puts ("-------------------------------------------------------------------------------");
4816 printf ("%s:\n", text
);
4818 for (i
= 0; i
< 256; i
++)
4820 if (buf
[i
] > max_value
)
4826 for (i
= 1; i
< 200; i
++)
4831 value
= (buf
[i
] * 60) / max_value
;
4833 for (j
= 0; j
< value
; j
++)
4837 printf (" %d\n", buf
[i
]);
4848 average
= (float) sum
/ (float) counter
;
4859 printf ("avg: %4.1f=%6.1f us, ", average
, (1000000. * average
) / (float) F_INTERRUPTS
);
4860 printf ("min: %2d=%6.1f us, ", min
, (1000000. * min
) / (float) F_INTERRUPTS
);
4861 printf ("max: %2d=%6.1f us, ", max
, (1000000. * max
) / (float) F_INTERRUPTS
);
4863 tolerance
= (max
- average
);
4865 if (average
- min
> tolerance
)
4867 tolerance
= average
- min
;
4870 tolerance
= tolerance
* 100 / average
;
4871 printf ("tol: %4.1f%%\n", tolerance
);
4881 #define STATE_LEFT_SHIFT 0x01
4882 #define STATE_RIGHT_SHIFT 0x02
4883 #define STATE_LEFT_CTRL 0x04
4884 #define STATE_LEFT_ALT 0x08
4885 #define STATE_RIGHT_ALT 0x10
4887 #define KEY_ESCAPE 0x1B // keycode = 0x006e
4888 #define KEY_MENUE 0x80 // keycode = 0x0070
4889 #define KEY_BACK 0x81 // keycode = 0x0071
4890 #define KEY_FORWARD 0x82 // keycode = 0x0072
4891 #define KEY_ADDRESS 0x83 // keycode = 0x0073
4892 #define KEY_WINDOW 0x84 // keycode = 0x0074
4893 #define KEY_1ST_PAGE 0x85 // keycode = 0x0075
4894 #define KEY_STOP 0x86 // keycode = 0x0076
4895 #define KEY_MAIL 0x87 // keycode = 0x0077
4896 #define KEY_FAVORITES 0x88 // keycode = 0x0078
4897 #define KEY_NEW_PAGE 0x89 // keycode = 0x0079
4898 #define KEY_SETUP 0x8A // keycode = 0x007a
4899 #define KEY_FONT 0x8B // keycode = 0x007b
4900 #define KEY_PRINT 0x8C // keycode = 0x007c
4901 #define KEY_ON_OFF 0x8E // keycode = 0x007c
4903 #define KEY_INSERT 0x90 // keycode = 0x004b
4904 #define KEY_DELETE 0x91 // keycode = 0x004c
4905 #define KEY_LEFT 0x92 // keycode = 0x004f
4906 #define KEY_HOME 0x93 // keycode = 0x0050
4907 #define KEY_END 0x94 // keycode = 0x0051
4908 #define KEY_UP 0x95 // keycode = 0x0053
4909 #define KEY_DOWN 0x96 // keycode = 0x0054
4910 #define KEY_PAGE_UP 0x97 // keycode = 0x0055
4911 #define KEY_PAGE_DOWN 0x98 // keycode = 0x0056
4912 #define KEY_RIGHT 0x99 // keycode = 0x0059
4913 #define KEY_MOUSE_1 0x9E // keycode = 0x0400
4914 #define KEY_MOUSE_2 0x9F // keycode = 0x0800
4917 get_fdc_key (uint_fast16_t cmd
)
4919 static uint8_t key_table
[128] =
4921 // 0 1 2 3 4 5 6 7 8 9 A B C D E F
4922 0, '^', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'ß', '´', 0, '\b',
4923 '\t','q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p', 'ü', '+', 0, 0, 'a',
4924 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'ö', 'ä', '#', '\r', 0, '<', 'y', 'x',
4925 'c', 'v', 'b', 'n', 'm', ',', '.', '-', 0, 0, 0, 0, 0, ' ', 0, 0,
4927 0, '°', '!', '"', '§', '$', '%', '&', '/', '(', ')', '=', '?', '`', 0, '\b',
4928 '\t','Q', 'W', 'E', 'R', 'T', 'Z', 'U', 'I', 'O', 'P', 'Ü', '*', 0, 0, 'A',
4929 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Ö', 'Ä', '\'','\r', 0, '>', 'Y', 'X',
4930 'C', 'V', 'B', 'N', 'M', ';', ':', '_', 0, 0, 0, 0, 0, ' ', 0, 0
4932 static uint_fast8_t state
;
4934 uint_fast8_t key
= 0;
4938 case 0x002C: state
|= STATE_LEFT_SHIFT
; break; // pressed left shift
4939 case 0x00AC: state
&= ~STATE_LEFT_SHIFT
; break; // released left shift
4940 case 0x0039: state
|= STATE_RIGHT_SHIFT
; break; // pressed right shift
4941 case 0x00B9: state
&= ~STATE_RIGHT_SHIFT
; break; // released right shift
4942 case 0x003A: state
|= STATE_LEFT_CTRL
; break; // pressed left ctrl
4943 case 0x00BA: state
&= ~STATE_LEFT_CTRL
; break; // released left ctrl
4944 case 0x003C: state
|= STATE_LEFT_ALT
; break; // pressed left alt
4945 case 0x00BC: state
&= ~STATE_LEFT_ALT
; break; // released left alt
4946 case 0x003E: state
|= STATE_RIGHT_ALT
; break; // pressed left alt
4947 case 0x00BE: state
&= ~STATE_RIGHT_ALT
; break; // released left alt
4949 case 0x006e: key
= KEY_ESCAPE
; break;
4950 case 0x004b: key
= KEY_INSERT
; break;
4951 case 0x004c: key
= KEY_DELETE
; break;
4952 case 0x004f: key
= KEY_LEFT
; break;
4953 case 0x0050: key
= KEY_HOME
; break;
4954 case 0x0051: key
= KEY_END
; break;
4955 case 0x0053: key
= KEY_UP
; break;
4956 case 0x0054: key
= KEY_DOWN
; break;
4957 case 0x0055: key
= KEY_PAGE_UP
; break;
4958 case 0x0056: key
= KEY_PAGE_DOWN
; break;
4959 case 0x0059: key
= KEY_RIGHT
; break;
4960 case 0x0400: key
= KEY_MOUSE_1
; break;
4961 case 0x0800: key
= KEY_MOUSE_2
; break;
4965 if (!(cmd
& 0x80)) // pressed key
4967 if (cmd
>= 0x70 && cmd
<= 0x7F) // function keys
4969 key
= cmd
+ 0x10; // 7x -> 8x
4971 else if (cmd
< 64) // key listed in key_table
4973 if (state
& (STATE_LEFT_ALT
| STATE_RIGHT_ALT
))
4977 case 0x0003: key
= '²'; break;
4978 case 0x0008: key
= '{'; break;
4979 case 0x0009: key
= '['; break;
4980 case 0x000A: key
= ']'; break;
4981 case 0x000B: key
= '}'; break;
4982 case 0x000C: key
= '\\'; break;
4983 case 0x001C: key
= '~'; break;
4984 case 0x002D: key
= '|'; break;
4985 case 0x0034: key
= 0xB5; break; // Mu
4988 else if (state
& (STATE_LEFT_CTRL
))
4990 if (key_table
[cmd
] >= 'a' && key_table
[cmd
] <= 'z')
4992 key
= key_table
[cmd
] - 'a' + 1;
4996 key
= key_table
[cmd
];
5001 int idx
= cmd
+ ((state
& (STATE_LEFT_SHIFT
| STATE_RIGHT_SHIFT
)) ? 64 : 0);
5005 key
= key_table
[idx
];
5017 static int analyze
= FALSE
;
5018 static int list
= FALSE
;
5019 static IRMP_DATA irmp_data
;
5020 static int expected_protocol
;
5021 static int expected_address
;
5022 static int expected_command
;
5023 static int do_check_expected_values
;
5028 if (! analyze
&& ! list
)
5032 if (irmp_get_data (&irmp_data
))
5036 ANALYZE_ONLY_NORMAL_PUTCHAR (' ');
5040 printf ("%8.3fms ", (double) (time_counter
* 1000) / F_INTERRUPTS
);
5043 if (irmp_data
.protocol
== IRMP_FDC_PROTOCOL
&& (key
= get_fdc_key (irmp_data
.command
)) != 0)
5045 if ((key
>= 0x20 && key
< 0x7F) || key
>= 0xA0)
5047 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key='%c'",
5048 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, key
);
5050 else if (key
== '\r' || key
== '\t' || key
== KEY_ESCAPE
|| (key
>= 0x80 && key
<= 0x9F)) // function keys
5052 char * p
= (char *) NULL
;
5056 case '\t' : p
= "TAB"; break;
5057 case '\r' : p
= "CR"; break;
5058 case KEY_ESCAPE
: p
= "ESCAPE"; break;
5059 case KEY_MENUE
: p
= "MENUE"; break;
5060 case KEY_BACK
: p
= "BACK"; break;
5061 case KEY_FORWARD
: p
= "FORWARD"; break;
5062 case KEY_ADDRESS
: p
= "ADDRESS"; break;
5063 case KEY_WINDOW
: p
= "WINDOW"; break;
5064 case KEY_1ST_PAGE
: p
= "1ST_PAGE"; break;
5065 case KEY_STOP
: p
= "STOP"; break;
5066 case KEY_MAIL
: p
= "MAIL"; break;
5067 case KEY_FAVORITES
: p
= "FAVORITES"; break;
5068 case KEY_NEW_PAGE
: p
= "NEW_PAGE"; break;
5069 case KEY_SETUP
: p
= "SETUP"; break;
5070 case KEY_FONT
: p
= "FONT"; break;
5071 case KEY_PRINT
: p
= "PRINT"; break;
5072 case KEY_ON_OFF
: p
= "ON_OFF"; break;
5074 case KEY_INSERT
: p
= "INSERT"; break;
5075 case KEY_DELETE
: p
= "DELETE"; break;
5076 case KEY_LEFT
: p
= "LEFT"; break;
5077 case KEY_HOME
: p
= "HOME"; break;
5078 case KEY_END
: p
= "END"; break;
5079 case KEY_UP
: p
= "UP"; break;
5080 case KEY_DOWN
: p
= "DOWN"; break;
5081 case KEY_PAGE_UP
: p
= "PAGE_UP"; break;
5082 case KEY_PAGE_DOWN
: p
= "PAGE_DOWN"; break;
5083 case KEY_RIGHT
: p
= "RIGHT"; break;
5084 case KEY_MOUSE_1
: p
= "KEY_MOUSE_1"; break;
5085 case KEY_MOUSE_2
: p
= "KEY_MOUSE_2"; break;
5086 default : p
= "<UNKNWON>"; break;
5089 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x, key=%s",
5090 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
, p
);
5094 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x, asc=0x%02x",
5095 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
, key
);
5100 printf ("p=%2d (%s), a=0x%04x, c=0x%04x, f=0x%02x",
5101 irmp_data
.protocol
, irmp_protocol_names
[irmp_data
.protocol
], irmp_data
.address
, irmp_data
.command
, irmp_data
.flags
);
5104 if (do_check_expected_values
)
5106 if (irmp_data
.protocol
!= expected_protocol
||
5107 irmp_data
.address
!= expected_address
||
5108 irmp_data
.command
!= expected_command
)
5110 printf ("\nerror 7: expected values differ: p=%2d (%s), a=0x%04x, c=0x%04x\n",
5111 expected_protocol
, irmp_protocol_names
[expected_protocol
], expected_address
, expected_command
);
5115 printf (" checked!\n");
5117 do_check_expected_values
= FALSE
; // only check 1st frame in a line!
5128 main (int argc
, char ** argv
)
5136 int start_pulses
[256];
5137 int start_pauses
[256];
5141 int first_pulse
= TRUE
;
5142 int first_pause
= TRUE
;
5146 if (! strcmp (argv
[1], "-v"))
5150 else if (! strcmp (argv
[1], "-l"))
5154 else if (! strcmp (argv
[1], "-a"))
5158 else if (! strcmp (argv
[1], "-s"))
5162 else if (! strcmp (argv
[1], "-p"))
5167 else if (! strcmp (argv
[1], "-r"))
5173 for (i
= 0; i
< 256; i
++)
5175 start_pulses
[i
] = 0;
5176 start_pauses
[i
] = 0;
5183 while ((ch
= getchar ()) != EOF
)
5185 if (ch
== '_' || ch
== '0')
5193 printf ("pause: %d\n", pause
);
5202 start_pauses
[pause
]++;
5204 first_pause
= FALSE
;
5220 else if (ch
== 0xaf || ch
== '-' || ch
== '1')
5226 printf ("pulse: %d ", pulse
);
5235 start_pulses
[pulse
]++;
5237 first_pulse
= FALSE
;
5253 else if (ch
== '\n')
5258 if (list
&& pause
> 0)
5260 printf ("pause: %d\n", pause
);
5266 for (i
= 0; i
< (int) ((10000.0 * F_INTERRUPTS
) / 10000); i
++) // newline: long pause of 10000 msec
5280 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5291 puts ("-------------------------------------------------------------------");
5295 while ((ch
= getchar()) != '\n' && ch
!= EOF
)
5297 if (ch
!= '\r') // ignore CR in DOS/Windows files
5299 if (ch
== '[' && idx
== -1)
5307 do_check_expected_values
= FALSE
;
5311 expected_protocol
= atoi (buf
);
5313 if (expected_protocol
> 0)
5322 if (sscanf (p
, "%x", &expected_address
) == 1)
5324 do_check_expected_values
= TRUE
;
5331 if (do_check_expected_values
)
5333 do_check_expected_values
= FALSE
;
5341 if (sscanf (p
, "%x", &expected_command
) == 1)
5343 do_check_expected_values
= TRUE
;
5350 if (do_check_expected_values
)
5352 // printf ("!%2d %04x %04x!\n", expected_protocol, expected_address, expected_command);
5357 else if (idx
< 1024 - 2)
5377 print_spectrum ("START PULSES", start_pulses
, TRUE
);
5378 print_spectrum ("START PAUSES", start_pauses
, FALSE
);
5379 print_spectrum ("PULSES", pulses
, TRUE
);
5380 print_spectrum ("PAUSES", pauses
, FALSE
);
5381 puts ("-------------------------------------------------------------------------------");