From 801f6de596f9d80fee2d31c786a29f7566c4e2e6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 21 Feb 2012 19:03:24 +0100 Subject: [PATCH] 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: https://github.com/neutrino-images/ni-libstb-hal/commit/96db6f12bfd512e5f91890a0f3a2089aedb7bd65 Author: Stefan Seyfried Date: 2012-02-21 (Tue, 21 Feb 2012) ------------------ This commit was generated by Migit --- libspark/irmp.c | 153 +++++++++++++++++++++++++++++++++--------- libspark/irmp.h | 28 ++++++-- libspark/irmpconfig.h | 28 +++++--- 3 files changed, 164 insertions(+), 45 deletions(-) diff --git a/libspark/irmp.c b/libspark/irmp.c index 2278a4b..b7a4f67 100644 --- a/libspark/irmp.c +++ b/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 @@ -788,7 +802,7 @@ irmp_protocol_names[IRMP_N_PROTOCOLS + 1] = #define UART0_TXEN_BIT_VALUE (1<>= 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,23 +1868,29 @@ 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_param.protocol == IRMP_KASEIKYO_PROTOCOL && irmp_bit < KASEIKYO_COMPLETE_DATA_LEN) - { - if (value) + if (irmp_bit >= 20 && irmp_bit < 24) { - xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8); + irmp_tmp_command |= (((uint16_t) (value)) << (irmp_bit - 8)); // store 4 system bits (genre 1) in upper nibble with LSB first } - else + else if (irmp_bit >= 24 && irmp_bit < 28) { - xor_check[irmp_bit / 8] &= ~(1 << (irmp_bit % 8)); + genre2 |= (((uint8_t) (value)) << (irmp_bit - 20)); // store 4 system bits (genre 2) in upper nibble with LSB first + } + + if (irmp_bit < KASEIKYO_COMPLETE_DATA_LEN) + { + if (value) + { + xor_check[irmp_bit / 8] |= 1 << (irmp_bit % 8); + } + else + { + 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) diff --git a/libspark/irmp.h b/libspark/irmp.h index 0d21302..1e3852b 100644 --- a/libspark/irmp.h +++ b/libspark/irmp.h @@ -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 diff --git a/libspark/irmpconfig.h b/libspark/irmpconfig.h index ebc3908..10b34b7 100644 --- a/libspark/irmpconfig.h +++ b/libspark/irmpconfig.h @@ -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! *---------------------------------------------------------------------------------------------------------------------------------------------------