From a777fd4e74625adc63777d9dae68c5006b70b0ab Mon Sep 17 00:00:00 2001 From: ukw Date: Fri, 16 Dec 2016 09:20:08 +0000 Subject: [PATCH] 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 --- IR-Data/test-suite.sh | 1 + README.txt | 2 +- irmp.c | 28 +++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh index 0511870..2d7dd67 100644 --- a/IR-Data/test-suite.sh +++ b/IR-Data/test-suite.sh @@ -55,6 +55,7 @@ for j in \ nec-repetition.txt \ nec-skymaster-dt500.txt \ nec.txt \ + nec-non-std-rep.txt \ nikon.txt \ nubert-subwoofer.txt \ orion_vcr_07660BM070.txt \ diff --git a/README.txt b/README.txt index 623acd7..495e491 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ IRMP - Infrared Multi Protocol Decoder -------------------------------------- -Version IRMP: 3.0.4 2016-11-18 +Version IRMP: 3.0.5 2016-12-16 Version IRSND: 3.0.5 2016-11-18 Documentation: 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 { -- 2.39.2