summaryrefslogtreecommitdiff
path: root/irmp.c
diff options
context:
space:
mode:
authorukw2011-02-08 08:48:41 +0000
committerukw2011-02-08 08:48:41 +0000
commit1aee56bc62cbb8c7983eb5449ad075d94aaca5e1 (patch)
tree2670f4a21075f08cfc1b0e69d5456559a245cea8 /irmp.c
parent779fbc81da759376eaf8eeb8fb0fda639e376c55 (diff)
downloadirmp-1aee56bc62cbb8c7983eb5449ad075d94aaca5e1.zip
version 1.9.2: added RUWIDO protocol, for T-Home Mediareceiver
git-svn-id: svn://mikrocontroller.net/irmp@53 aeb2e35e-bfc4-4214-b83c-9e8de998ed28
Diffstat (limited to 'irmp.c')
-rw-r--r--irmp.c175
1 files changed, 124 insertions, 51 deletions
diff --git a/irmp.c b/irmp.c
index 3b49646..7bbb6f8 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.87 2011/01/18 13:02:15 fm Exp $
+ * $Id: irmp.c,v 1.88 2011/02/08 08:40:27 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -459,8 +459,12 @@ typedef unsigned int16 uint16_t;
#define RC5_START_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define RC5_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RC5_START_BIT_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RC5_START_BIT_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
#define RC5_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define RC5_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RC5_BIT_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * RC5_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RC5_BIT_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * RC5_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
#define DENON_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define DENON_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * DENON_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
@@ -480,6 +484,11 @@ typedef unsigned int16 uint16_t;
#define RC6_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1) // pauses: 300 - 600
#define RC6_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RC6_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RC6_BIT_PULSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RC6_BIT_PULSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * RC6_BIT_TIME * MAX_TOLERANCE_30 + 0.5) + 1) // pulses: 600 - 1400
+#define RC6_BIT_PAUSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * RC6_BIT_TIME * MIN_TOLERANCE_10 + 0.5) - 1) // pauses: 600 - 1200
+#define RC6_BIT_PAUSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * RC6_BIT_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+
#define RECS80EXT_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MIN_TOLERANCE_00 + 0.5) - 1)
#define RECS80EXT_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PULSE_TIME * MAX_TOLERANCE_00 + 0.5) + 1)
#define RECS80EXT_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RECS80EXT_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
@@ -535,6 +544,8 @@ typedef unsigned int16 uint16_t;
#define GRUNDIG_OR_NOKIA_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
#define GRUNDIG_OR_NOKIA_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
#define GRUNDIG_OR_NOKIA_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
+#define GRUNDIG_OR_NOKIA_BIT_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * GRUNDIG_OR_NOKIA_BIT_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
+#define GRUNDIG_OR_NOKIA_BIT_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * GRUNDIG_OR_NOKIA_BIT_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) + 1)
#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
@@ -542,6 +553,8 @@ typedef unsigned int16 uint16_t;
#define SIEMENS_START_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)
#define SIEMENS_BIT_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) - 1)
#define SIEMENS_BIT_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME * 1 + 0.5) + 1)
+#define SIEMENS_BIT_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_BIT_TIME * 1 + 0.5) - 1)
+#define SIEMENS_BIT_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * 2 * SIEMENS_BIT_TIME * 1 + 0.5) + 1)
#define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
@@ -596,6 +609,19 @@ typedef unsigned int16 uint16_t;
#define NIKON_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * NIKON_0_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
#define NIKON_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * NIKON_FRAME_REPEAT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5)
+#define RUWIDO_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
+#define RUWIDO_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
+#define RUWIDO_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PAUSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
+#define RUWIDO_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_START_BIT_PAUSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
+#define RUWIDO_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RUWIDO_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RUWIDO_BIT_PULSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RUWIDO_BIT_PULSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PULSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)
+#define RUWIDO_BIT_PAUSE_LEN_MIN_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME_2 * MIN_TOLERANCE_10 + 0.5) - 1)
+#define RUWIDO_BIT_PAUSE_LEN_MAX_2 ((uint8_t)(F_INTERRUPTS * RUWIDO_BIT_PAUSE_TIME_2 * MAX_TOLERANCE_10 + 0.5) + 1)
+
#define AUTO_FRAME_REPETITION_LEN (uint16_t)(F_INTERRUPTS * AUTO_FRAME_REPETITION_TIME + 0.5) // use uint16_t!
#ifdef ANALYZE
@@ -974,14 +1000,14 @@ static PROGMEM IRMP_PARAMETER recs80_param =
static PROGMEM IRMP_PARAMETER rc5_param =
{
IRMP_RC5_PROTOCOL, // protocol: ir protocol
- RC5_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
- RC5_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
- RC5_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
- RC5_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0
- 1, // pause_0_len_min: minimum length of pause with bit value 0
- 1, // pause_0_len_max: maximum length of pause with bit value 0
+ RC5_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ RC5_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ RC5_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ RC5_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ RC5_BIT_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse
+ RC5_BIT_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse
+ RC5_BIT_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause
+ RC5_BIT_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause
RC5_ADDRESS_OFFSET, // address_offset: address offset
RC5_ADDRESS_OFFSET + RC5_ADDRESS_LEN, // address_end: end of address
RC5_COMMAND_OFFSET, // command_offset: command offset
@@ -1024,14 +1050,15 @@ static PROGMEM IRMP_PARAMETER denon_param =
static PROGMEM IRMP_PARAMETER rc6_param =
{
IRMP_RC6_PROTOCOL, // protocol: ir protocol
- RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
- RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
- RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
- RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0
- 1, // pause_0_len_min: minimum length of pause with bit value 0
- 1, // pause_0_len_max: maximum length of pause with bit value 0
+
+ RC6_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ RC6_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ RC6_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ RC6_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ RC6_BIT_PULSE_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse
+ RC6_BIT_PULSE_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse
+ RC6_BIT_PAUSE_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause
+ RC6_BIT_PAUSE_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause
RC6_ADDRESS_OFFSET, // address_offset: address offset
RC6_ADDRESS_OFFSET + RC6_ADDRESS_LEN, // address_end: end of address
RC6_COMMAND_OFFSET, // command_offset: command offset
@@ -1124,14 +1151,16 @@ static PROGMEM IRMP_PARAMETER bang_olufsen_param =
static PROGMEM IRMP_PARAMETER grundig_param =
{
IRMP_GRUNDIG_PROTOCOL, // protocol: ir protocol
- GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
- GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
- GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
- GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0
- 1, // pause_0_len_min: minimum length of pause with bit value 0
- 1, // pause_0_len_max: maximum length of pause with bit value 0
+
+ GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ GRUNDIG_OR_NOKIA_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ GRUNDIG_OR_NOKIA_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ GRUNDIG_OR_NOKIA_BIT_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse
+ GRUNDIG_OR_NOKIA_BIT_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse
+ GRUNDIG_OR_NOKIA_BIT_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause
+ GRUNDIG_OR_NOKIA_BIT_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause
+
GRUNDIG_ADDRESS_OFFSET, // address_offset: address offset
GRUNDIG_ADDRESS_OFFSET + GRUNDIG_ADDRESS_LEN, // address_end: end of address
GRUNDIG_COMMAND_OFFSET, // command_offset: command offset
@@ -1149,14 +1178,14 @@ static PROGMEM IRMP_PARAMETER grundig_param =
static PROGMEM IRMP_PARAMETER siemens_param =
{
IRMP_SIEMENS_PROTOCOL, // protocol: ir protocol
- SIEMENS_BIT_LEN_MIN, // pulse_1_len_min: minimum length of pulse with bit value 1
- SIEMENS_BIT_LEN_MAX, // pulse_1_len_max: maximum length of pulse with bit value 1
- SIEMENS_BIT_LEN_MIN, // pause_1_len_min: minimum length of pause with bit value 1
- SIEMENS_BIT_LEN_MAX, // pause_1_len_max: maximum length of pause with bit value 1
- 1, // tricky: use this as stop bit length // pulse_0_len_min: minimum length of pulse with bit value 0
- 1, // pulse_0_len_max: maximum length of pulse with bit value 0
- 1, // pause_0_len_min: minimum length of pause with bit value 0
- 1, // pause_0_len_max: maximum length of pause with bit value 0
+ SIEMENS_BIT_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ SIEMENS_BIT_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ SIEMENS_BIT_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ SIEMENS_BIT_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ SIEMENS_BIT_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse
+ SIEMENS_BIT_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse
+ SIEMENS_BIT_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause
+ SIEMENS_BIT_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause
SIEMENS_ADDRESS_OFFSET, // address_offset: address offset
SIEMENS_ADDRESS_OFFSET + SIEMENS_ADDRESS_LEN, // address_end: end of address
SIEMENS_COMMAND_OFFSET, // command_offset: command offset
@@ -1244,6 +1273,31 @@ static PROGMEM IRMP_PARAMETER nikon_param =
#endif
+#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
+
+static PROGMEM IRMP_PARAMETER ruwido_param =
+{
+ IRMP_RUWIDO_PROTOCOL, // protocol: ir protocol
+ RUWIDO_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ RUWIDO_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ RUWIDO_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ RUWIDO_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ RUWIDO_BIT_PULSE_LEN_MIN_2, // pulse_0_len_min: here: minimum length of long pulse
+ RUWIDO_BIT_PULSE_LEN_MAX_2, // pulse_0_len_max: here: maximum length of long pulse
+ RUWIDO_BIT_PAUSE_LEN_MIN_2, // pause_0_len_min: here: minimum length of long pause
+ RUWIDO_BIT_PAUSE_LEN_MAX_2, // pause_0_len_max: here: maximum length of long pause
+ RUWIDO_ADDRESS_OFFSET, // address_offset: address offset
+ RUWIDO_ADDRESS_OFFSET + RUWIDO_ADDRESS_LEN, // address_end: end of address
+ RUWIDO_COMMAND_OFFSET, // command_offset: command offset
+ RUWIDO_COMMAND_OFFSET + RUWIDO_COMMAND_LEN, // command_end: end of command
+ RUWIDO_COMPLETE_DATA_LEN, // complete_len: complete length of frame
+ RUWIDO_STOP_BIT, // stop_bit: flag: frame has stop bit
+ RUWIDO_LSB, // lsb_first: flag: LSB first
+ RUWIDO_FLAGS // flags: some flags
+};
+
+#endif
+
static uint8_t irmp_bit; // current bit position
static IRMP_PARAMETER irmp_param;
@@ -1715,10 +1769,10 @@ irmp_ISR (void)
#endif // IRMP_SUPPORT_RECS80_PROTOCOL == 1
#if IRMP_SUPPORT_RC5_PROTOCOL == 1
- if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||
- (irmp_pulse_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX)) &&
- ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||
- (irmp_pause_time >= 2 * RC5_START_BIT_LEN_MIN && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX)))
+ if (((irmp_pulse_time >= RC5_START_BIT_LEN_MIN && irmp_pulse_time <= RC5_START_BIT_LEN_MAX) ||
+ (irmp_pulse_time >= RC5_START_BIT_LEN_MIN_2 && irmp_pulse_time <= RC5_START_BIT_LEN_MAX_2)) &&
+ ((irmp_pause_time >= RC5_START_BIT_LEN_MIN && irmp_pause_time <= RC5_START_BIT_LEN_MAX) ||
+ (irmp_pause_time >= RC5_START_BIT_LEN_MIN_2 && irmp_pause_time <= RC5_START_BIT_LEN_MAX_2)))
{ // it's RC5
#if IRMP_SUPPORT_FDC_PROTOCOL == 1
if (irmp_pulse_time >= FDC_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= FDC_START_BIT_PULSE_LEN_MAX &&
@@ -1751,16 +1805,18 @@ irmp_ISR (void)
else
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
{
- ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
+ ANALYZE_PRINTF ("protocol = RC5, start bit timings: pulse: %3d - %3d, pause: %3d - %3d or pulse: %3d - %3d, pause: %3d - %3d\n",
RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,
- RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX);
+ RC5_START_BIT_LEN_MIN_2, RC5_START_BIT_LEN_MAX_2,
+ RC5_START_BIT_LEN_MIN, RC5_START_BIT_LEN_MAX,
+ RC5_START_BIT_LEN_MIN_2, RC5_START_BIT_LEN_MAX_2);
}
irmp_param_p = (IRMP_PARAMETER *) &rc5_param;
last_pause = irmp_pause_time;
- if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= 2 * RC5_START_BIT_LEN_MAX) ||
- (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= 2 * RC5_START_BIT_LEN_MAX))
+ if ((irmp_pulse_time > RC5_START_BIT_LEN_MAX && irmp_pulse_time <= RC5_START_BIT_LEN_MAX_2) ||
+ (irmp_pause_time > RC5_START_BIT_LEN_MAX && irmp_pause_time <= RC5_START_BIT_LEN_MAX_2))
{
last_value = 0;
rc5_cmd_bit6 = 1<<6;
@@ -1899,6 +1955,23 @@ irmp_ISR (void)
}
else
#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
+#if IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
+ if ((irmp_pulse_time >= RUWIDO_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= RUWIDO_START_BIT_PULSE_LEN_MAX) &&
+ (irmp_pause_time >= RUWIDO_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= RUWIDO_START_BIT_PAUSE_LEN_MAX))
+ { // it's RUWIDO
+ {
+ ANALYZE_PRINTF ("protocol = RUWIDO, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
+ RUWIDO_START_BIT_PULSE_LEN_MIN, RUWIDO_START_BIT_PULSE_LEN_MAX,
+ RUWIDO_START_BIT_PAUSE_LEN_MIN, RUWIDO_START_BIT_PAUSE_LEN_MAX);
+ }
+
+ irmp_param_p = (IRMP_PARAMETER *) &ruwido_param;
+ last_pause = irmp_pause_time;
+
+ last_value = 1;
+ }
+ else
+#endif // IRMP_SUPPORT_RCCAR_PROTOCOL == 1
{
ANALYZE_PRINTF ("protocol = UNKNOWN\n");
irmp_start_bit_detected = 0; // wait for another start bit...
@@ -1917,9 +1990,9 @@ irmp_ISR (void)
else
{
ANALYZE_PRINTF ("pulse: %3d - %3d or %3d - %3d\n", irmp_param.pulse_1_len_min, irmp_param.pulse_1_len_max,
- irmp_param.pulse_1_len_max + 1, 2 * irmp_param.pulse_1_len_max);
+ irmp_param.pulse_0_len_max + 1, irmp_param.pulse_0_len_max);
ANALYZE_PRINTF ("pause: %3d - %3d or %3d - %3d\n", irmp_param.pause_1_len_min, irmp_param.pause_1_len_max,
- irmp_param.pause_1_len_max + 1, 2 * irmp_param.pause_1_len_max);
+ irmp_param.pause_0_len_max + 1, 2 * irmp_param.pause_0_len_max);
}
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1)
@@ -1966,7 +2039,7 @@ irmp_ISR (void)
#if IRMP_SUPPORT_MANCHESTER == 1
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) && irmp_param.protocol != IRMP_RC6_PROTOCOL) // Manchester, but not RC6
{
- if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= 2 * irmp_param.pulse_1_len_max)
+ if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= irmp_param.pulse_0_len_max)
{
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');
@@ -2022,7 +2095,8 @@ irmp_ISR (void)
{ // yes...
if (irmp_bit == irmp_param.complete_len && irmp_param.stop_bit == 1)
{
- if (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max)
+ if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) ||
+ (irmp_pulse_time >= irmp_param.pulse_0_len_min && irmp_pulse_time <= irmp_param.pulse_0_len_max))
{
#ifdef ANALYZE
if (! (irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER))
@@ -2061,7 +2135,7 @@ irmp_ISR (void)
#if IRMP_SUPPORT_GRUNDIG_OR_NOKIA_PROTOCOL == 1
if (irmp_param.protocol == IRMP_GRUNDIG_PROTOCOL && !irmp_param.stop_bit)
{
- if (irmp_pause_time > 2 * irmp_param.pause_1_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)
+ if (irmp_pause_time > irmp_param.pause_0_len_max && irmp_bit >= GRUNDIG_COMPLETE_DATA_LEN - 2)
{ // special manchester decoder
irmp_param.complete_len = GRUNDIG_COMPLETE_DATA_LEN; // correct complete len
got_light = TRUE; // this is a lie, but generates a stop bit ;-)
@@ -2087,7 +2161,7 @@ irmp_ISR (void)
#endif
#if IRMP_SUPPORT_MANCHESTER == 1
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER) &&
- irmp_pause_time > 2 * irmp_param.pause_1_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)
+ irmp_pause_time > irmp_param.pause_0_len_max && irmp_bit >= irmp_param.complete_len - 2 && !irmp_param.stop_bit)
{ // special manchester decoder
got_light = TRUE; // this is a lie, but generates a stop bit ;-)
irmp_param.stop_bit = TRUE; // set flag
@@ -2136,7 +2210,7 @@ irmp_ISR (void)
#if IRMP_SUPPORT_MANCHESTER == 1
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER)) // Manchester
{
- if (irmp_pulse_time > irmp_param.pulse_1_len_max /* && irmp_pulse_time <= 2 * irmp_param.pulse_1_len_max */)
+ if (irmp_pulse_time > irmp_param.pulse_1_len_max /* && irmp_pulse_time <= irmp_param.pulse_0_len_max */)
{
#if IRMP_SUPPORT_RC6_PROTOCOL == 1
if (irmp_param.protocol == IRMP_RC6_PROTOCOL && irmp_bit == 4 && irmp_pulse_time > RC6_TOGGLE_BIT_LEN_MIN) // RC6 toggle bit
@@ -2166,7 +2240,7 @@ irmp_ISR (void)
ANALYZE_PUTCHAR ('T');
irmp_store_bit (1);
- if (irmp_pause_time > 2 * irmp_param.pause_1_len_max)
+ if (irmp_pause_time > irmp_param.pause_0_len_max)
{
last_value = 0;
}
@@ -2195,7 +2269,7 @@ irmp_ISR (void)
{
uint8_t manchester_value;
- if (last_pause > irmp_param.pause_1_len_max && last_pause <= 2 * irmp_param.pause_1_len_max)
+ if (last_pause > irmp_param.pause_1_len_max && last_pause <= irmp_param.pause_0_len_max)
{
manchester_value = last_value ? 0 : 1;
last_value = manchester_value;
@@ -2840,7 +2914,6 @@ print_timings (void)
NIKON_START_BIT_PULSE_LEN_MIN, NIKON_START_BIT_PULSE_LEN_MAX, NIKON_START_BIT_PAUSE_LEN_MIN, NIKON_START_BIT_PAUSE_LEN_MAX,
NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_0_PAUSE_LEN_MIN, NIKON_0_PAUSE_LEN_MAX,
NIKON_PULSE_LEN_MIN, NIKON_PULSE_LEN_MAX, NIKON_1_PAUSE_LEN_MIN, NIKON_1_PAUSE_LEN_MAX);
-
}
void