summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorukw2015-01-19 11:04:00 +0000
committerukw2015-01-19 11:04:00 +0000
commit061e654cba197b09f58c6297e7d76d4527742885 (patch)
treec9f1cb9a4075fbfb3fb6ed114c6b002903025c65
parent7a0f3214a21aaa500521005adbadb0fa77da8fe5 (diff)
downloadirmp-061e654cba197b09f58c6297e7d76d4527742885.zip
Version 2.6.8: added merlin protocol
git-svn-id: svn://mikrocontroller.net/irmp@151 aeb2e35e-bfc4-4214-b83c-9e8de998ed28
-rw-r--r--IR-Data/test-suite.sh64
-rw-r--r--README.txt2
-rw-r--r--irmp.c73
-rw-r--r--irmp.h37
-rw-r--r--irmpconfig.h3
-rw-r--r--irmpprotocols.h27
-rw-r--r--irmpsystem.h8
-rw-r--r--irsndmain.c2
-rw-r--r--main.c6
9 files changed, 161 insertions, 61 deletions
diff --git a/IR-Data/test-suite.sh b/IR-Data/test-suite.sh
index b4ed0ef..3ea37ca 100644
--- a/IR-Data/test-suite.sh
+++ b/IR-Data/test-suite.sh
@@ -51,7 +51,7 @@ for j in \
elta_radio.txt \
fdc.txt \
jvc.txt \
- jvc-rm-rk250-10kHz.txt \
+ jvc-rm-rk250-10kHz.txt \
nec-repetition.txt \
nec-skymaster-dt500.txt \
nec.txt \
@@ -72,23 +72,24 @@ do
echo -n "testing $j ... "
if tmpsrc/irmp-10kHz -v < $j | grep -q error
then
- tmpsrc/irmp-10kHz -v < $j | grep error
- echo "test failed"
- exit 1
+ tmpsrc/irmp-10kHz -v < $j | grep error
+ echo "test failed"
+ exit 1
else
- if tmpsrc/irmp-10kHz -v < $j | grep -q checked
- then
- echo "checked!"
- else
- echo "successful"
- fi
+ if tmpsrc/irmp-10kHz -v < $j | grep -q checked
+ then
+ echo "checked!"
+ else
+ echo "successful"
+ fi
fi
done
# t-home-mediareceiver-15kHz.txt (RUWIDO) conflicts with Denon
+# a1tvbox-15kHz.txt (A1TVBOX) conflicts with MERLIN
+# Siemens-Gigaset-M740AV-15kHz.txt (SIEMENS) conflicts with MERLIN
for j in \
- a1tvbox-15kHz.txt \
bo_beolink1000-15kHz.txt \
bose_wave_system_15khz.txt \
denon-15kHz.txt \
@@ -97,12 +98,12 @@ for j in \
irc-15kHz.txt \
kathrein-15kHz.txt \
lg-air-15kHz.txt \
+ merlin-15kHz.txt \
recs80-15kHz.txt \
saa3004-15kHz.txt \
samsung32-15kHz.txt \
samsung48-15kHz.txt \
sharp_15khz.txt \
- Siemens-Gigaset-M740AV-15kHz.txt \
thomson-mb100-15kHz.txt \
tp400vt-15kHz.txt \
universal-15kHz.txt \
@@ -111,21 +112,22 @@ do
echo -n "testing $j ... "
if tmpsrc/irmp-15kHz -v < $j | grep -q error
then
- tmpsrc/irmp-15kHz -v < $j | grep error
- echo "test failed"
- exit 1
+ tmpsrc/irmp-15kHz -v < $j | grep error
+ echo "test failed"
+ exit 1
else
- if tmpsrc/irmp-15kHz -v < $j | grep -q checked
- then
- echo "checked!"
- else
- echo "successful"
- fi
+ if tmpsrc/irmp-15kHz -v < $j | grep -q checked
+ then
+ echo "checked!"
+ else
+ echo "successful"
+ fi
fi
done
+# a1tvbox-15kHz.txt (A1TVBOX) conflicts with MERLIN
+
for j in \
- a1tvbox-20kHz.txt \
rc-car-20kHz.txt \
fdc-20kHz.txt \
fdc2-20kHz.txt \
@@ -136,16 +138,16 @@ do
echo -n "testing $j ... "
if tmpsrc/irmp-20kHz -v < $j | grep -q error
then
- tmpsrc/irmp-20kHz -v < $j | grep error
- echo "test failed"
- exit 1
+ tmpsrc/irmp-20kHz -v < $j | grep error
+ echo "test failed"
+ exit 1
else
- if tmpsrc/irmp-20kHz -v < $j | grep -q checked
- then
- echo "checked!"
- else
- echo "successful"
- fi
+ if tmpsrc/irmp-20kHz -v < $j | grep -q checked
+ then
+ echo "checked!"
+ else
+ echo "successful"
+ fi
fi
done
diff --git a/README.txt b/README.txt
index f9f66a2..ef88207 100644
--- a/README.txt
+++ b/README.txt
@@ -1,7 +1,7 @@
IRMP - Infrared Multi Protocol Decoder
--------------------------------------
-Version IRMP: 2.6.7 19.09.2014
+Version IRMP: 2.7.0 19.01.2015
Version IRSND: 2.6.4 15.09.2014
Dokumentation:
diff --git a/irmp.c b/irmp.c
index 03d198b..eaf7695 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.166 2014/09/19 13:26:00 fm Exp $
+ * $Id: irmp.c,v 1.168 2015/01/19 10:54:37 fm Exp $
*
* Supported AVR mikrocontrollers:
*
@@ -42,6 +42,7 @@
IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
IRMP_SUPPORT_IR60_PROTOCOL == 1 || \
IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1 || \
+ IRMP_SUPPORT_MERLIN_PROTOCOL == 1 || \
IRMP_SUPPORT_ORTEK_PROTOCOL == 1
# define IRMP_SUPPORT_MANCHESTER 1
#else
@@ -385,14 +386,23 @@
#define BOSE_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * BOSE_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
#define BOSE_FRAME_REPEAT_PAUSE_LEN_MAX (uint16_t)(F_INTERRUPTS * 100.0e-3 * MAX_TOLERANCE_20 + 0.5)
-#define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
-#define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
-#define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
-#define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
-#define A1TVBOX_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
-#define A1TVBOX_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
-#define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
-#define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define A1TVBOX_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define A1TVBOX_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define A1TVBOX_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define A1TVBOX_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define A1TVBOX_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define A1TVBOX_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define A1TVBOX_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define A1TVBOX_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * A1TVBOX_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+
+#define MERLIN_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define MERLIN_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define MERLIN_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define MERLIN_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_START_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define MERLIN_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define MERLIN_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
+#define MERLIN_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
+#define MERLIN_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MERLIN_BIT_PAUSE_TIME * MAX_TOLERANCE_05 + 0.5) + 1)
#define ORTEK_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define ORTEK_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * ORTEK_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
@@ -538,6 +548,7 @@ static const char proto_rcmm12[] PROGMEM = "RCMM12";
static const char proto_speaker[] PROGMEM = "SPEAKER";
static const char proto_lgair[] PROGMEM = "LGAIR";
static const char proto_samsung48[] PROGMEM = "SAMSG48";
+static const char proto_merlin[] PROGMEM = "MERLIN";
static const char proto_radio1[] PROGMEM = "RADIO1";
@@ -586,6 +597,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
proto_speaker,
proto_lgair,
proto_samsung48,
+ proto_merlin,
proto_radio1
};
@@ -610,7 +622,6 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM =
# include "stm32f4xx_usart.h"
#elif defined(ARM_STM32F10X)
# define STM32_UART_COM USART3 // UART3 on PB10
-# include "stm32f10x_usart.h"
#else
# if IRMP_EXT_LOGGING == 1 // use external logging
# include "irmpextlog.h"
@@ -1631,6 +1642,32 @@ static const PROGMEM IRMP_PARAMETER a1tvbox_param =
#endif
+#if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+
+static const PROGMEM IRMP_PARAMETER merlin_param =
+{
+ IRMP_MERLIN_PROTOCOL, // protocol: ir protocol
+
+ MERLIN_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
+ MERLIN_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
+ MERLIN_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
+ MERLIN_BIT_PAUSE_LEN_MAX, // pause_1_len_max: here: maximum length of short pause
+ 0, // pulse_0_len_min: here: not used
+ 0, // pulse_0_len_max: here: not used
+ 0, // pause_0_len_min: here: not used
+ 0, // pause_0_len_max: here: not used
+ MERLIN_ADDRESS_OFFSET, // address_offset: address offset
+ MERLIN_ADDRESS_OFFSET + MERLIN_ADDRESS_LEN, // address_end: end of address
+ MERLIN_COMMAND_OFFSET, // command_offset: command offset
+ MERLIN_COMMAND_OFFSET + MERLIN_COMMAND_LEN, // command_end: end of command
+ MERLIN_COMPLETE_DATA_LEN, // complete_len: complete length of frame
+ MERLIN_STOP_BIT, // stop_bit: flag: frame has stop bit
+ MERLIN_LSB, // lsb_first: flag: LSB first
+ MERLIN_FLAGS // flags: some flags
+};
+
+#endif
+
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
static const PROGMEM IRMP_PARAMETER ortek_param =
@@ -2922,6 +2959,22 @@ irmp_ISR (void)
else
#endif // IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
+#if IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+ if (irmp_pulse_time >= MERLIN_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= MERLIN_START_BIT_PULSE_LEN_MAX &&
+ irmp_pause_time >= MERLIN_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= MERLIN_START_BIT_PAUSE_LEN_MAX)
+ { // it's MERLIN
+#ifdef ANALYZE
+ ANALYZE_PRINTF ("protocol = MERLIN, start bit timings: pulse: %3d - %3d, pause: %3d - %3d\n",
+ MERLIN_START_BIT_PULSE_LEN_MIN, MERLIN_START_BIT_PULSE_LEN_MAX,
+ MERLIN_START_BIT_PAUSE_LEN_MIN, MERLIN_START_BIT_PAUSE_LEN_MAX);
+#endif // ANALYZE
+ irmp_param_p = (IRMP_PARAMETER *) &merlin_param;
+ last_pause = 0;
+ last_value = 1;
+ }
+ else
+#endif // IRMP_SUPPORT_MERLIN_PROTOCOL == 1
+
#if IRMP_SUPPORT_ORTEK_PROTOCOL == 1
if (irmp_pulse_time >= ORTEK_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= ORTEK_START_BIT_PULSE_LEN_MAX &&
irmp_pause_time >= ORTEK_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= ORTEK_START_BIT_PAUSE_LEN_MAX)
diff --git a/irmp.h b/irmp.h
index cda737c..c7de844 100644
--- a/irmp.h
+++ b/irmp.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.h,v 1.89 2014/09/15 10:27:38 fm Exp $
+ * $Id: irmp.h,v 1.90 2015/01/19 10:54:37 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,11 +61,34 @@
# define sei() IntMasterEnable()
#endif
-#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_RUWIDO_PROTOCOL == 1
-# warning DENON protocol conflicts wih RUWIDO, please enable only one of both protocols
+#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && (IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1)
+# warning DENON protocol conflicts wih RUWIDO/SIEMENS, please enable only one of both protocols
# warning RUWIDO protocol disabled
+# warning SIEMENS protocol disabled
+# warning DENON protocol stays enabled
# undef IRMP_SUPPORT_RUWIDO_PROTOCOL
# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0
+# undef IRMP_SUPPORT_SIEMENS_PROTOCOL
+# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0
+#endif
+
+#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && (IRMP_SUPPORT_RUWIDO_PROTOCOL == 1 || IRMP_SUPPORT_SIEMENS_PROTOCOL == 1)
+# warning MERLIN protocol conflicts wih RUWIDO/SIEMENS, please enable only one of both protocols
+# warning RUWIDO protocol disabled
+# warning SIEMENS protocol disabled
+# warning MERLIN protocol stays enabled
+# undef IRMP_SUPPORT_RUWIDO_PROTOCOL
+# define IRMP_SUPPORT_RUWIDO_PROTOCOL 0
+# undef IRMP_SUPPORT_SIEMENS_PROTOCOL
+# define IRMP_SUPPORT_SIEMENS_PROTOCOL 0
+#endif
+
+#if IRMP_SUPPORT_DENON_PROTOCOL == 1 && IRMP_SUPPORT_A1TVBOX_PROTOCOL == 1
+# warning MERLIN protocol conflicts wih A1TVBOX, please enable only one of both protocols
+# warning A1TVBOX protocol disabled
+# warning MERLIN protocol stays enabled
+# undef IRMP_SUPPORT_A1TVBOX_PROTOCOL
+# define IRMP_SUPPORT_A1TVBOX_PROTOCOL 0
#endif
#if IRMP_SUPPORT_RC6_PROTOCOL == 1 && IRMP_SUPPORT_ROOMBA_PROTOCOL == 1
@@ -171,16 +194,16 @@
#define IRMP_FLAG_REPETITION 0x01
extern void irmp_init (void);
-extern uint8_t irmp_get_data (IRMP_DATA *);
-extern uint8_t irmp_is_busy (void);
-extern uint8_t irmp_ISR (void);
+extern uint_fast8_t irmp_get_data (IRMP_DATA *);
+extern uint_fast8_t irmp_is_busy (void);
+extern uint_fast8_t irmp_ISR (void);
#if IRMP_PROTOCOL_NAMES == 1
extern const char * const irmp_protocol_names[IRMP_N_PROTOCOLS + 1] PROGMEM;
#endif
#if IRMP_USE_CALLBACK == 1
-extern void irmp_set_callback_ptr (void (*cb)(uint8_t));
+extern void irmp_set_callback_ptr (void (*cb)(uint_fast8_t));
#endif // IRMP_USE_CALLBACK == 1
#endif /* _IRMP_H_ */
diff --git a/irmpconfig.h b/irmpconfig.h
index 6239e83..73b06db 100644
--- a/irmpconfig.h
+++ b/irmpconfig.h
@@ -6,7 +6,7 @@
* Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
* Extensions for PIC 12F1820 W.Strobl 2014-07-20
*
- * $Id: irmpconfig.h,v 1.121 2014/09/15 12:36:28 fm Exp $
+ * $Id: irmpconfig.h,v 1.123 2015/01/19 10:54:37 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -90,6 +90,7 @@
#define IRMP_SUPPORT_RCMM_PROTOCOL 0 // RCMM 12,24, or 32 >= 20000 ~150 bytes
#define IRMP_SUPPORT_LGAIR_PROTOCOL 0 // LG Air Condition >= 10000 ~300 bytes
#define IRMP_SUPPORT_SAMSUNG48_PROTOCOL 0 // Samsung48 >= 10000 ~100 bytes (SAMSUNG must be enabled!)
+#define IRMP_SUPPORT_MERLIN_PROTOCOL 0 // Merlin >= 15000 (better 20000) ~300 bytes
#define IRMP_SUPPORT_RADIO1_PROTOCOL 0 // RADIO, e.g. TEVION >= 10000 ~250 bytes (experimental)
/*---------------------------------------------------------------------------------------------------------------------------------------------------
diff --git a/irmpprotocols.h b/irmpprotocols.h
index 381fe0d..c04fd43 100644
--- a/irmpprotocols.h
+++ b/irmpprotocols.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2013-2014 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmpprotocols.h,v 1.28 2014/09/15 12:36:28 fm Exp $
+ * $Id: irmpprotocols.h,v 1.29 2015/01/19 10:54:37 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -66,10 +66,11 @@
#define IRMP_SPEAKER_PROTOCOL 39 // Another loudspeaker protocol, similar to Nubert
#define IRMP_LGAIR_PROTOCOL 40 // LG air conditioner
#define IRMP_SAMSUNG48_PROTOCOL 41 // air conditioner with SAMSUNG protocol (48 bits)
+#define IRMP_MERLIN_PROTOCOL 42 // Merlin (Pollin 620 185)
-#define IRMP_RADIO1_PROTOCOL 42 // Radio protocol (experimental status), do not use it yet!
+#define IRMP_RADIO1_PROTOCOL 43 // Radio protocol (experimental status), do not use it yet!
-#define IRMP_N_PROTOCOLS 42 // number of supported protocols
+#define IRMP_N_PROTOCOLS 43 // number of supported protocols
/*---------------------------------------------------------------------------------------------------------------------------------------------------
* timing constants:
@@ -681,6 +682,26 @@ typedef uint8_t PAUSE_LEN;
#define A1TVBOX_FRAME_REPEAT_PAUSE_TIME 50.0e-3 // 50 msec pause between frames, don't know if it is correct
/*---------------------------------------------------------------------------------------------------------------------------------------------------
+ * MERLIN:
+ * See notes for A1TVBOX
+ *---------------------------------------------------------------------------------------------------------------------------------------------------
+ */
+#define MERLIN_START_BIT_PULSE_TIME 210.0e-6 // 300 usec pulse
+#define MERLIN_START_BIT_PAUSE_TIME 420.0e-6 // 340 usec pause
+#define MERLIN_BIT_PULSE_TIME 210.0e-6 // 250 usec pulse
+#define MERLIN_BIT_PAUSE_TIME 210.0e-6 // 150 usec pulse
+#define MERLIN_STOP_BIT 0 // has no stop bit
+#define MERLIN_LSB 0 // MSB...LSB
+#define MERLIN_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1 ) // flags
+#define MERLIN_FRAMES 1 // MERLIN sends each frame 1 times
+#define MERLIN_ADDRESS_OFFSET 1 // skip 1 bits
+#define MERLIN_ADDRESS_LEN 8 // read 8 address bits
+#define MERLIN_COMMAND_OFFSET 8 // skip 9 bits (start bit + address)
+#define MERLIN_COMMAND_LEN 10 // read 8 command bits
+#define MERLIN_COMPLETE_DATA_LEN 19 // complete length incl. start bit
+#define MERLIN_FRAME_REPEAT_PAUSE_TIME 50.0e-3 // 50 msec pause between frames, don't know if it is correct
+
+/*---------------------------------------------------------------------------------------------------------------------------------------------------
* ORTEK (Hama): 6 address bits + 2 frame type bits + 6 command bits + 1 parity bit + 1 unknown bit + "1" + "0"
*---------------------------------------------------------------------------------------------------------------------------------------------------
*/
diff --git a/irmpsystem.h b/irmpsystem.h
index d19a0a7..2c31a72 100644
--- a/irmpsystem.h
+++ b/irmpsystem.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmpsystem.h,v 1.14 2014/09/15 10:27:38 fm Exp $
+ * $Id: irmpsystem.h,v 1.15 2015/01/19 10:54:37 fm Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@
# include <stm32f4xx.h>
# define ARM_STM32
# define ARM_STM32F4XX
-#elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)
+#elif defined(TARGET_IS_BLIZZARD_RA2) // TI Stellaris (tested on Stellaris Launchpad with Code Composer Studio)
# define STELLARIS_ARM_CORTEX_M4
# define F_CPU (SysCtlClockGet())
#elif defined(unix) || defined(WIN32) || defined(__APPLE__) // Unix/Linux or Windows or Apple
@@ -128,9 +128,9 @@ typedef unsigned short uint16_t;
# define FALSE 0
#endif
-typedef struct
+typedef struct __attribute__ ((__packed__))
{
- uint8_t protocol; // protocol, i.e. NEC_PROTOCOL
+ uint8_t protocol; // protocol, e.g. NEC_PROTOCOL
uint16_t address; // address
uint16_t command; // command
uint8_t flags; // flags, e.g. repetition
diff --git a/irsndmain.c b/irsndmain.c
index ee6f660..6d8ed6f 100644
--- a/irsndmain.c
+++ b/irsndmain.c
@@ -15,7 +15,7 @@
#include "irsnd.h"
#ifndef F_CPU
-# error F_CPU unkown
+# error F_CPU unknown
#endif
void
diff --git a/main.c b/main.c
index ed0c2f7..1d5ddd5 100644
--- a/main.c
+++ b/main.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2014 Frank Meyer - frank(at)fli4l.de
*
- * $Id: main.c,v 1.21 2014/09/17 09:44:47 fm Exp $
+ * $Id: main.c,v 1.23 2014/11/17 11:56:19 fm Exp $
*
* This demo module is runnable on AVRs and LM4F120 Launchpad (ARM Cortex M4)
*
@@ -20,7 +20,7 @@
#include "irmp.h"
#ifndef F_CPU
-#error F_CPU unkown
+#error F_CPU unknown
#endif
/*---------------------------------------------------------------------------------------------------------------------------------------------------
@@ -51,7 +51,7 @@
#define UART0_TXEN_BIT_VALUE (1<<TXEN0)
#define UART0_UDR UDR0
#define UART0_U2X U2X0
-
+
#else
#define UART0_UBRRH UBRRH