summaryrefslogtreecommitdiff
path: root/irmp.c
diff options
context:
space:
mode:
authorukw2016-12-16 09:20:08 +0000
committerukw2016-12-16 09:20:08 +0000
commita777fd4e74625adc63777d9dae68c5006b70b0ab (patch)
tree38d87eb261031c2a3e47cdb161e4401e3fb365df /irmp.c
parent17cabd54715636a50a3dc6dd87d3f136d65176bd (diff)
downloadirmp-a777fd4e74625adc63777d9dae68c5006b70b0ab.zip
Version 3.0.5: added support of non-standard NEC repetition frames with pause of 4500us instead of 2250us
git-svn-id: svn://mikrocontroller.net/irmp@180 aeb2e35e-bfc4-4214-b83c-9e8de998ed28
Diffstat (limited to 'irmp.c')
-rw-r--r--irmp.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/irmp.c b/irmp.c
index 6297aa5..27c31be 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2016 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.188 2016/09/14 06:31:48 fm Exp $
+ * $Id: irmp.c,v 1.190 2016/12/16 09:18:11 fm Exp $
*
* Supported AVR mikrocontrollers:
*
@@ -3944,6 +3944,32 @@ irmp_ISR (void)
{
irmp_bit++;
}
+#if IRMP_SUPPORT_NEC_PROTOCOL == 1
+ else if ((irmp_param.protocol == IRMP_NEC_PROTOCOL || irmp_param.protocol == IRMP_NEC42_PROTOCOL) && irmp_bit == 0)
+ { // it was a non-standard repetition frame
+#ifdef ANALYZE // with 4500µs pause instead of 2250µs
+ ANALYZE_PRINTF ("Detected non-standard repetition frame, switching to NEC repetition\n");
+#endif // ANALYZE
+ if (key_repetition_len < NEC_FRAME_REPEAT_PAUSE_LEN_MAX)
+ {
+ irmp_param.stop_bit = TRUE; // set flag
+ irmp_param.protocol = IRMP_NEC_PROTOCOL; // switch protocol
+ irmp_param.complete_len = irmp_bit; // patch length: 16 or 17
+ irmp_tmp_address = last_irmp_address; // address is last address
+ irmp_tmp_command = last_irmp_command; // command is last command
+ irmp_flags |= IRMP_FLAG_REPETITION;
+ key_repetition_len = 0;
+ }
+ else
+ {
+#ifdef ANALYZE
+ ANALYZE_PRINTF ("ignoring NEC repetition frame: timeout occured, key_repetition_len = %d > %d\n",
+ key_repetition_len, NEC_FRAME_REPEAT_PAUSE_LEN_MAX);
+#endif // ANALYZE
+ irmp_ir_detected = FALSE;
+ }
+ }
+#endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
#if IRMP_SUPPORT_JVC_PROTOCOL == 1
else if (irmp_param.protocol == IRMP_NEC_PROTOCOL && (irmp_bit == 16 || irmp_bit == 17)) // it was a JVC stop bit
{