mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
spark: update IRMP code from upstream
This updates the IRMP code to version Version 2.1.1 (SVN rev 89).
Important changes are:
* added GRUNDIG2 protocol
* fixed bug when switching from nec42 to nec protocol
* corrected timing for samsung/samsung32 protocol
* added genre bits for kaseikyo
Especially the NEC protocol fix affects us since it changes the
decoded address!
Origin commit data
------------------
Branch: master
Commit: 96db6f12bf
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-02-21 (Tue, 21 Feb 2012)
------------------
This commit was generated by Migit
This commit is contained in:
135
libspark/irmp.c
135
libspark/irmp.c
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
|
||||
*
|
||||
* $Id: irmp.c,v 1.110 2011/09/22 10:19:44 fm Exp $
|
||||
* $Id: irmp.c,v 1.115 2012/02/21 08:41:46 fm Exp $
|
||||
*
|
||||
* ATMEGA88 @ 8 MHz
|
||||
*
|
||||
@@ -381,6 +381,7 @@ typedef unsigned int16 uint16_t;
|
||||
IRMP_SUPPORT_RC6_PROTOCOL == 1 || \
|
||||
IRMP_SUPPORT_GRUNDIG_NOKIA_IR60_PROTOCOL == 1 || \
|
||||
IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1 || \
|
||||
IRMP_SUPPORT_GRUNDIG2_PROTOCOL == 1 || \
|
||||
IRMP_SUPPORT_IR60_PROTOCOL
|
||||
#define IRMP_SUPPORT_MANCHESTER 1
|
||||
#else
|
||||
@@ -607,6 +608,15 @@ typedef unsigned int16 uint16_t;
|
||||
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
|
||||
#define SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
|
||||
|
||||
#define GRUNDIG2_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG2_START_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
|
||||
#define GRUNDIG2_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG2_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
|
||||
#define GRUNDIG2_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG2_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
|
||||
#define GRUNDIG2_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG2_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
|
||||
#define GRUNDIG2_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG2_BIT_PULSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
|
||||
#define GRUNDIG2_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG2_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
|
||||
#define GRUNDIG2_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * GRUNDIG2_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
|
||||
#define GRUNDIG2_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * GRUNDIG2_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
|
||||
|
||||
#define FDC_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1) // 5%: avoid conflict with NETBOX
|
||||
#define FDC_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PULSE_TIME * MAX_TOLERANCE_05 + 0.5))
|
||||
#define FDC_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * FDC_START_BIT_PAUSE_TIME * MIN_TOLERANCE_05 + 0.5) - 1)
|
||||
@@ -706,9 +716,9 @@ typedef unsigned int16 uint16_t;
|
||||
#endif
|
||||
#define ANALYZE_PRINTF(...) { if (verbose) { printf (__VA_ARGS__); } }
|
||||
#define ANALYZE_NEWLINE() { if (verbose) { putchar ('\n'); } }
|
||||
static int silent = TRUE;
|
||||
static int silent;
|
||||
static int time_counter;
|
||||
static int verbose = FALSE;
|
||||
static int verbose;
|
||||
#else
|
||||
#define ANALYZE_PUTCHAR(a)
|
||||
#define ANALYZE_ONLY_NORMAL_PUTCHAR(a)
|
||||
@@ -766,7 +776,11 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
|
||||
* Logging
|
||||
*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#if IRMP_LOGGING == 1
|
||||
#if IRMP_LOGGING == 1 // logging via UART
|
||||
|
||||
#if IRMP_EXT_LOGGING == 1 // use external logging
|
||||
#include "irmpextlog.h"
|
||||
#else // normal UART log (IRMP_EXT_LOGGING == 0)
|
||||
#define BAUD 9600L
|
||||
#include <util/setbaud.h>
|
||||
|
||||
@@ -808,7 +822,8 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
|
||||
#define UART0_UDR UDR
|
||||
#define UART0_U2X U2X
|
||||
|
||||
#endif
|
||||
#endif //UBRR0H
|
||||
#endif //IRMP_EXT_LOGGING
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
* Initialize UART
|
||||
@@ -818,6 +833,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] =
|
||||
void
|
||||
irmp_uart_init (void)
|
||||
{
|
||||
#if (IRMP_EXT_LOGGING == 0) // use UART
|
||||
UART0_UBRRH = UBRRH_VALUE; // set baud rate
|
||||
UART0_UBRRL = UBRRL_VALUE;
|
||||
|
||||
@@ -829,6 +845,9 @@ irmp_uart_init (void)
|
||||
|
||||
UART0_UCSRC = UART0_UCSZ1_BIT_VALUE | UART0_UCSZ0_BIT_VALUE | UART0_URSEL_BIT_VALUE;
|
||||
UART0_UCSRB |= UART0_TXEN_BIT_VALUE; // enable UART TX
|
||||
#else // other log method
|
||||
initextlog();
|
||||
#endif //IRMP_EXT_LOGGING
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -840,12 +859,16 @@ irmp_uart_init (void)
|
||||
void
|
||||
irmp_uart_putc (unsigned char ch)
|
||||
{
|
||||
#if (IRMP_EXT_LOGGING == 0)
|
||||
while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE))
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
UART0_UDR = ch;
|
||||
#else
|
||||
sendextlog(ch); //Use external log
|
||||
#endif
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -928,7 +951,7 @@ irmp_log (uint8_t val)
|
||||
|
||||
#else
|
||||
#define irmp_log(val)
|
||||
#endif
|
||||
#endif //IRMP_LOGGING
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -1351,6 +1374,31 @@ static const PROGMEM IRMP_PARAMETER ruwido_param =
|
||||
|
||||
#endif
|
||||
|
||||
#if IRMP_SUPPORT_GRUNDIG2_PROTOCOL == 1
|
||||
|
||||
static const PROGMEM IRMP_PARAMETER grundig2_param =
|
||||
{
|
||||
IRMP_GRUNDIG2_PROTOCOL, // protocol: ir protocol
|
||||
GRUNDIG2_BIT_PULSE_LEN_MIN, // pulse_1_len_min: here: minimum length of short pulse
|
||||
GRUNDIG2_BIT_PULSE_LEN_MAX, // pulse_1_len_max: here: maximum length of short pulse
|
||||
GRUNDIG2_BIT_PAUSE_LEN_MIN, // pause_1_len_min: here: minimum length of short pause
|
||||
GRUNDIG2_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
|
||||
GRUNDIG2_ADDRESS_OFFSET, // address_offset: address offset
|
||||
GRUNDIG2_ADDRESS_OFFSET + GRUNDIG2_ADDRESS_LEN, // address_end: end of address
|
||||
GRUNDIG2_COMMAND_OFFSET, // command_offset: command offset
|
||||
GRUNDIG2_COMMAND_OFFSET + GRUNDIG2_COMMAND_LEN, // command_end: end of command
|
||||
GRUNDIG2_COMPLETE_DATA_LEN, // complete_len: complete length of frame
|
||||
GRUNDIG2_STOP_BIT, // stop_bit: flag: frame has stop bit
|
||||
GRUNDIG2_LSB, // lsb_first: flag: LSB first
|
||||
GRUNDIG2_FLAGS // flags: some flags
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if IRMP_SUPPORT_FDC_PROTOCOL == 1
|
||||
|
||||
static const PROGMEM IRMP_PARAMETER fdc_param =
|
||||
@@ -1619,6 +1667,15 @@ irmp_get_data (IRMP_DATA * irmp_data_p)
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if IRMP_SUPPORT_GRUNDIG2_PROTOCOL == 1
|
||||
case IRMP_GRUNDIG2_PROTOCOL:
|
||||
if (irmp_command & 0x0001)
|
||||
{
|
||||
irmp_command >>= 1;
|
||||
rtc = TRUE;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if IRMP_SUPPORT_KATHREIN_PROTOCOL == 1
|
||||
case IRMP_KATHREIN_PROTOCOL:
|
||||
if (irmp_command != 0x0000)
|
||||
@@ -1748,6 +1805,7 @@ static uint16_t irmp_tmp_id;
|
||||
#endif
|
||||
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
|
||||
static uint8_t xor_check[6]; // check kaseikyo "parity" bits
|
||||
static uint8_t genre2; // save genre2 bits here, later copied to MSB in flags
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1810,12 +1868,18 @@ irmp_store_bit (uint8_t value)
|
||||
#endif
|
||||
|
||||
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
|
||||
else if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && irmp_bit >= 20 && irmp_bit < 24)
|
||||
else if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL)
|
||||
{
|
||||
irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - 8)); // store 4 system bits in upper nibble with LSB first
|
||||
if (irmp_bit >= 20 && irmp_bit < 24)
|
||||
{
|
||||
irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first
|
||||
}
|
||||
else if (irmp_bit >= 24 && irmp_bit < 28)
|
||||
{
|
||||
genre2 |= (((uint8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first
|
||||
}
|
||||
|
||||
if (irmp_param.protocol == IRMP_KASEIKYO_PROTOCOL && irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)
|
||||
if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
@@ -1826,7 +1890,7 @@ irmp_store_bit (uint8_t value)
|
||||
xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
irmp_bit++;
|
||||
@@ -1926,7 +1990,7 @@ irmp_ISR (uint8_t x42)
|
||||
#ifdef ANALYZE
|
||||
if (! irmp_pulse_time)
|
||||
{
|
||||
ANALYZE_PRINTF("%8d [starting pulse]\n", time_counter);
|
||||
ANALYZE_PRINTF("%8.3fms [starting pulse]\n", (double) (time_counter * 1000) / F_INTERRUPTS);
|
||||
}
|
||||
#endif
|
||||
irmp_pulse_time++; // increment counter
|
||||
@@ -1940,6 +2004,9 @@ irmp_ISR (uint8_t x42)
|
||||
wait_for_space = 0;
|
||||
irmp_tmp_command = 0;
|
||||
irmp_tmp_address = 0;
|
||||
#if IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
|
||||
genre2 = 0;
|
||||
#endif
|
||||
|
||||
#if IRMP_SUPPORT_RC5_PROTOCOL == 1 && (IRMP_SUPPORT_FDC_PROTOCOL == 1 || IRMP_SUPPORT_RCCAR_PROTOCOL == 1) || IRMP_SUPPORT_NEC42_PROTOCOL == 1
|
||||
irmp_tmp_command2 = 0;
|
||||
@@ -1984,7 +2051,7 @@ irmp_ISR (uint8_t x42)
|
||||
else
|
||||
#endif // IRMP_SUPPORT_JVC_PROTOCOL == 1
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d error 1: pause after start bit pulse %d too long: %d\n", time_counter, irmp_pulse_time, irmp_pause_time);
|
||||
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);
|
||||
ANALYZE_ONLY_NORMAL_PUTCHAR ('\n');
|
||||
}
|
||||
// irmp_busy_flag = FALSE;
|
||||
@@ -2001,7 +2068,7 @@ irmp_ISR (uint8_t x42)
|
||||
irmp_param2.protocol = 0;
|
||||
#endif
|
||||
|
||||
ANALYZE_PRINTF ("%8d [start-bit: pulse = %2d, pause = %2d]\n", time_counter, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [start-bit: pulse = %2d, pause = %2d]\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_pulse_time, irmp_pause_time);
|
||||
|
||||
#if IRMP_SUPPORT_SIRCS_PROTOCOL == 1
|
||||
if (irmp_pulse_time >= SIRCS_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= SIRCS_START_BIT_PULSE_LEN_MAX &&
|
||||
@@ -2326,6 +2393,22 @@ irmp_ISR (uint8_t x42)
|
||||
else
|
||||
#endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
|
||||
|
||||
#if IRMP_SUPPORT_GRUNDIG2_PROTOCOL == 1
|
||||
if ((irmp_pulse_time >= GRUNDIG2_START_BIT_PULSE_LEN_MIN && irmp_pulse_time <= GRUNDIG2_START_BIT_PULSE_LEN_MAX) &&
|
||||
(irmp_pause_time >= GRUNDIG2_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= GRUNDIG2_START_BIT_PAUSE_LEN_MAX))
|
||||
{ // it's GRUNDIG2
|
||||
ANALYZE_PRINTF ("protocol = GRUNDIG2, start bit timings: pulse: %3d - %3d or %3d - %3d, pause: %3d - %3d or %3d - %3d\n",
|
||||
GRUNDIG2_START_BIT_PULSE_LEN_MIN, GRUNDIG2_START_BIT_PULSE_LEN_MAX,
|
||||
2 * GRUNDIG2_START_BIT_PULSE_LEN_MIN, 2 * GRUNDIG2_START_BIT_PULSE_LEN_MAX,
|
||||
GRUNDIG2_START_BIT_PAUSE_LEN_MIN, GRUNDIG2_START_BIT_PAUSE_LEN_MAX,
|
||||
2 * GRUNDIG2_START_BIT_PAUSE_LEN_MIN, 2 * GRUNDIG2_START_BIT_PAUSE_LEN_MAX);
|
||||
irmp_param_p = (IRMP_PARAMETER *) &grundig2_param;
|
||||
last_pause = irmp_pause_time;
|
||||
last_value = 1;
|
||||
}
|
||||
else
|
||||
#endif // IRMP_SUPPORT_SIEMENS_OR_RUWIDO_PROTOCOL == 1
|
||||
|
||||
#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 &&
|
||||
irmp_pause_time >= FDC_START_BIT_PAUSE_LEN_MIN && irmp_pause_time <= FDC_START_BIT_PAUSE_LEN_MAX)
|
||||
@@ -2465,14 +2548,14 @@ irmp_ISR (uint8_t x42)
|
||||
{
|
||||
if (irmp_pause_time > irmp_param.pulse_1_len_max && irmp_pause_time <= 2 * irmp_param.pulse_1_len_max)
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '0' : '1');
|
||||
ANALYZE_NEWLINE ();
|
||||
irmp_store_bit ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? 0 : 1);
|
||||
}
|
||||
else if (! last_value) // && irmp_pause_time >= irmp_param.pause_1_len_min && irmp_pause_time <= irmp_param.pause_1_len_max)
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
|
||||
ANALYZE_PUTCHAR ((irmp_param.flags & IRMP_PARAM_FLAG_1ST_PULSE_IS_1) ? '1' : '0');
|
||||
ANALYZE_NEWLINE ();
|
||||
@@ -2494,7 +2577,7 @@ irmp_ISR (uint8_t x42)
|
||||
#if IRMP_SUPPORT_DENON_PROTOCOL == 1
|
||||
if (irmp_param.protocol == IRMP_DENON_PROTOCOL)
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
|
||||
if (irmp_pause_time >= DENON_1_PAUSE_LEN_MIN && irmp_pause_time <= DENON_1_PAUSE_LEN_MAX)
|
||||
{ // pause timings correct for "1"?
|
||||
@@ -2514,7 +2597,7 @@ irmp_ISR (uint8_t x42)
|
||||
#if IRMP_SUPPORT_THOMSON_PROTOCOL == 1
|
||||
if (irmp_param.protocol == IRMP_THOMSON_PROTOCOL)
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
|
||||
if (irmp_pause_time >= THOMSON_1_PAUSE_LEN_MIN && irmp_pause_time <= THOMSON_1_PAUSE_LEN_MAX)
|
||||
{ // pause timings correct for "1"?
|
||||
@@ -2715,7 +2798,7 @@ irmp_ISR (uint8_t x42)
|
||||
// 0123456789ABC0123456789ABC0123456701234567
|
||||
// NEC42: AAAAAAAAAAAAAaaaaaaaaaaaaaCCCCCCCCcccccccc
|
||||
// NEC: AAAAAAAAaaaaaaaaCCCCCCCCcccccccc
|
||||
irmp_tmp_address |= (irmp_tmp_address2 & 0x0007) << 12;
|
||||
irmp_tmp_address |= (irmp_tmp_address2 & 0x0007) << 13; // fm 2012-02-13: 12 -> 13
|
||||
irmp_tmp_command = (irmp_tmp_address2 >> 3) | (irmp_tmp_command << 10);
|
||||
}
|
||||
#endif // IRMP_SUPPORT_NEC_PROTOCOL == 1
|
||||
@@ -2755,7 +2838,7 @@ irmp_ISR (uint8_t x42)
|
||||
|
||||
if (got_light)
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d [bit %2d: pulse = %3d, pause = %3d] ", time_counter, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
ANALYZE_PRINTF ("%8.3fms [bit %2d: pulse = %3d, pause = %3d] ", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit, irmp_pulse_time, irmp_pause_time);
|
||||
|
||||
#if IRMP_SUPPORT_MANCHESTER == 1
|
||||
if ((irmp_param.flags & IRMP_PARAM_FLAG_IS_MANCHESTER)) // Manchester
|
||||
@@ -3264,7 +3347,7 @@ irmp_ISR (uint8_t x42)
|
||||
#endif
|
||||
|
||||
{
|
||||
ANALYZE_PRINTF ("%8d code detected, length = %d\n", time_counter, irmp_bit);
|
||||
ANALYZE_PRINTF ("%8.3fms code detected, length = %d\n", (double) (time_counter * 1000) / F_INTERRUPTS, irmp_bit);
|
||||
irmp_ir_detected = TRUE;
|
||||
|
||||
#if IRMP_SUPPORT_DENON_PROTOCOL == 1
|
||||
@@ -3348,6 +3431,8 @@ irmp_ISR (uint8_t x42)
|
||||
ANALYZE_PRINTF ("error 4: wrong XOR check for data bits: 0x%02x 0x%02x\n", xor, xor_check[5]);
|
||||
irmp_ir_detected = FALSE;
|
||||
}
|
||||
|
||||
irmp_flags |= genre2; // write the genre2 bits into MSB of the flag byte
|
||||
}
|
||||
#endif // IRMP_SUPPORT_KASEIKYO_PROTOCOL == 1
|
||||
|
||||
@@ -3562,6 +3647,14 @@ print_timings (void)
|
||||
2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PULSE_LEN_MAX,
|
||||
2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MIN, 2 * SIEMENS_OR_RUWIDO_BIT_PAUSE_LEN_MAX);
|
||||
|
||||
printf ("GRUNDIG2 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
|
||||
GRUNDIG2_START_BIT_PULSE_LEN_MIN, GRUNDIG2_START_BIT_PULSE_LEN_MAX,
|
||||
GRUNDIG2_START_BIT_PAUSE_LEN_MIN, GRUNDIG2_START_BIT_PAUSE_LEN_MAX,
|
||||
GRUNDIG2_BIT_PULSE_LEN_MIN, GRUNDIG2_BIT_PULSE_LEN_MAX,
|
||||
GRUNDIG2_BIT_PAUSE_LEN_MIN, GRUNDIG2_BIT_PAUSE_LEN_MAX,
|
||||
2 * GRUNDIG2_BIT_PULSE_LEN_MIN, 2 * GRUNDIG2_BIT_PULSE_LEN_MAX,
|
||||
2 * GRUNDIG2_BIT_PAUSE_LEN_MIN, 2 * GRUNDIG2_BIT_PAUSE_LEN_MAX);
|
||||
|
||||
printf ("FDC 1 %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d %3d - %3d\n",
|
||||
FDC_START_BIT_PULSE_LEN_MIN, FDC_START_BIT_PULSE_LEN_MAX, FDC_START_BIT_PAUSE_LEN_MIN, FDC_START_BIT_PAUSE_LEN_MAX,
|
||||
FDC_PULSE_LEN_MIN, FDC_PULSE_LEN_MAX, FDC_0_PAUSE_LEN_MIN, FDC_0_PAUSE_LEN_MAX,
|
||||
@@ -3821,7 +3914,7 @@ next_tick (void)
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
printf ("%8d ", time_counter);
|
||||
printf ("%8.3fms ", (double) (time_counter * 1000) / F_INTERRUPTS);
|
||||
}
|
||||
|
||||
if (irmp_data.protocol == IRMP_FDC_PROTOCOL && (key = get_fdc_key (irmp_data.command)) != 0)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
|
||||
*
|
||||
* $Id: irmp.h,v 1.67 2011/09/22 10:19:44 fm Exp $
|
||||
* $Id: irmp.h,v 1.70 2012/02/21 08:41:46 fm Exp $
|
||||
*
|
||||
* ATMEGA88 @ 8 MHz
|
||||
*
|
||||
@@ -79,8 +79,9 @@ typedef uint8_t PAUSE_LEN;
|
||||
#define IRMP_NEC42_PROTOCOL 28 // NEC with 42 bits
|
||||
#define IRMP_LEGO_PROTOCOL 29 // LEGO Power Functions RC
|
||||
#define IRMP_THOMSON_PROTOCOL 30 // Thomson
|
||||
#define IRMP_GRUNDIG2_PROTOCOL 31 // Grundig, e.g. TP400
|
||||
|
||||
#define IRMP_N_PROTOCOLS 30 // number of supported protocols
|
||||
#define IRMP_N_PROTOCOLS 31 // number of supported protocols
|
||||
|
||||
// some flags of struct IRMP_PARAMETER:
|
||||
#define IRMP_PARAM_FLAG_IS_MANCHESTER 0x01
|
||||
@@ -136,8 +137,9 @@ typedef uint8_t PAUSE_LEN;
|
||||
#define SAMSUNG_START_BIT_PULSE_TIME 4500.0e-6 // 4500 usec pulse
|
||||
#define SAMSUNG_START_BIT_PAUSE_TIME 4500.0e-6 // 4500 usec pause
|
||||
#define SAMSUNG_PULSE_TIME 550.0e-6 // 550 usec pulse
|
||||
#define SAMSUNG_1_PAUSE_TIME 1450.0e-6 // 1450 usec pause
|
||||
#define SAMSUNG_0_PAUSE_TIME 450.0e-6 // 450 usec pause
|
||||
#define SAMSUNG_1_PAUSE_TIME 1650.0e-6 // 1650 usec pause
|
||||
#define SAMSUNG_0_PAUSE_TIME 550.0e-6 // 550 usec pause
|
||||
|
||||
#define SAMSUNG_FRAME_REPEAT_PAUSE_TIME 25.0e-3 // frame repeat after 25ms
|
||||
#define SAMSUNG_ADDRESS_OFFSET 0 // skip 0 bits
|
||||
#define SAMSUNG_ADDRESS_LEN 16 // read 16 address bits
|
||||
@@ -153,9 +155,9 @@ typedef uint8_t PAUSE_LEN;
|
||||
#define SAMSUNG32_COMMAND_OFFSET 16 // skip 16 bits
|
||||
#define SAMSUNG32_COMMAND_LEN 16 // read 16 command bits
|
||||
#define SAMSUNG32_COMPLETE_DATA_LEN 32 // complete length
|
||||
#define SAMSUNG32_FRAMES 2 // SAMSUNG32 sends each frame 2 times
|
||||
#define SAMSUNG32_FRAMES 1 // SAMSUNG32 sends each frame 1 times
|
||||
#define SAMSUNG32_AUTO_REPETITION_PAUSE_TIME 47.0e-3 // repetition after 47 ms
|
||||
#define SAMSUNG32_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 40ms
|
||||
#define SAMSUNG32_FRAME_REPEAT_PAUSE_TIME 47.0e-3 // frame repeat after 47ms
|
||||
|
||||
#define MATSUSHITA_START_BIT_PULSE_TIME 3488.0e-6 // 3488 usec pulse
|
||||
#define MATSUSHITA_START_BIT_PAUSE_TIME 3488.0e-6 // 3488 usec pause
|
||||
@@ -480,6 +482,20 @@ typedef uint8_t PAUSE_LEN;
|
||||
#define THOMSON_LSB 0 // MSB...LSB
|
||||
#define THOMSON_FLAGS 0 // flags
|
||||
|
||||
#define GRUNDIG2_START_BIT_PULSE_TIME 550.0e-6 // 550 usec pulse
|
||||
#define GRUNDIG2_START_BIT_PAUSE_TIME 2700.0e-6 // 2700 usec pause
|
||||
#define GRUNDIG2_BIT_PULSE_TIME 550.0e-6 // 550 usec short pulse
|
||||
#define GRUNDIG2_BIT_PAUSE_TIME 550.0e-6 // 550 usec short pause
|
||||
#define GRUNDIG2_FRAME_REPEAT_PAUSE_TIME 100.0e-3 // frame repeat after 100ms
|
||||
#define GRUNDIG2_STOP_BIT 0 // has no stop bit
|
||||
#define GRUNDIG2_LSB 1 // MSB...LSB
|
||||
#define GRUNDIG2_FLAGS (IRMP_PARAM_FLAG_IS_MANCHESTER | IRMP_PARAM_FLAG_1ST_PULSE_IS_1) // flags
|
||||
#define GRUNDIG2_ADDRESS_OFFSET 0 // skip 0 bits
|
||||
#define GRUNDIG2_ADDRESS_LEN 0 // read 0 bits
|
||||
#define GRUNDIG2_COMMAND_OFFSET 0 // skip 0 bits
|
||||
#define GRUNDIG2_COMMAND_LEN 7 // read 6 + 1 command bits, last bit is always 1
|
||||
#define GRUNDIG2_COMPLETE_DATA_LEN 7 // complete length
|
||||
|
||||
#define AUTO_FRAME_REPETITION_TIME 80.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 25-50ms
|
||||
// KASEIKYO: automatic repetition after 75ms
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2009-2011 Frank Meyer - frank(at)fli4l.de
|
||||
*
|
||||
* $Id: irmpconfig.h,v 1.77 2011/09/22 10:36:22 fm Exp $
|
||||
* $Id: irmpconfig.h,v 1.80 2012/02/21 08:41:46 fm Exp $
|
||||
*
|
||||
* ATMEGA88 @ 8 MHz
|
||||
*
|
||||
@@ -51,17 +51,18 @@
|
||||
#define IRMP_SUPPORT_DENON_PROTOCOL 1 // DENON, Sharp >= 10000 ~250 bytes
|
||||
|
||||
// more protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
|
||||
#define IRMP_SUPPORT_RC5_PROTOCOL 1 // RC5 >= 10000 ~250 bytes
|
||||
#define IRMP_SUPPORT_RC6_PROTOCOL 1 // RC6 & RC6A >= 10000 ~250 bytes
|
||||
#define IRMP_SUPPORT_JVC_PROTOCOL 1 // JVC >= 10000 ~150 bytes
|
||||
#define IRMP_SUPPORT_NEC16_PROTOCOL 1 // NEC16 >= 10000 ~100 bytes
|
||||
#define IRMP_SUPPORT_NEC42_PROTOCOL 1 // NEC42 >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_IR60_PROTOCOL 1 // IR60 (SAB2008) >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_GRUNDIG_PROTOCOL 1 // Grundig >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_RC5_PROTOCOL 0 // RC5 >= 10000 ~250 bytes
|
||||
#define IRMP_SUPPORT_RC6_PROTOCOL 0 // RC6 & RC6A >= 10000 ~250 bytes
|
||||
#define IRMP_SUPPORT_JVC_PROTOCOL 0 // JVC >= 10000 ~150 bytes
|
||||
#define IRMP_SUPPORT_NEC16_PROTOCOL 0 // NEC16 >= 10000 ~100 bytes
|
||||
#define IRMP_SUPPORT_NEC42_PROTOCOL 0 // NEC42 >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_IR60_PROTOCOL 0 // IR60 (SAB2008) >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_GRUNDIG_PROTOCOL 0 // Grundig >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_SIEMENS_PROTOCOL 0 // Siemens Gigaset >= 15000 ~550 bytes
|
||||
#define IRMP_SUPPORT_NOKIA_PROTOCOL 1 // Nokia >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_NOKIA_PROTOCOL 0 // Nokia >= 10000 ~300 bytes
|
||||
|
||||
// exotic protocols, enable here! Enable Remarks F_INTERRUPTS Program Space
|
||||
#define IRMP_SUPPORT_GRUNDIG2_PROTOCOL 0 // Grundig TP400 >= 10000 ~300 bytes
|
||||
#define IRMP_SUPPORT_KATHREIN_PROTOCOL 0 // Kathrein >= 10000 ~200 bytes
|
||||
#define IRMP_SUPPORT_NUBERT_PROTOCOL 0 // NUBERT >= 10000 ~50 bytes
|
||||
#define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang & Olufsen >= 10000 ~200 bytes
|
||||
@@ -110,6 +111,15 @@
|
||||
#define IRMP_LOGGING 0 // 1: log IR signal (scan), 0: do not (default)
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
* Use external logging routines
|
||||
* If you enable external logging, you have also to enable IRMP_LOGGING above
|
||||
*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef IRMP_EXT_LOGGING
|
||||
#define IRMP_EXT_LOGGING 0 // 1:log, 0: do not log ;
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
* Set IRMP_PROTOCOL_NAMES to 1 if want to access protocol names (for logging etc), costs ~300 bytes RAM!
|
||||
*---------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user