From: ukw Date: Thu, 28 May 2015 06:51:05 +0000 (+0000) Subject: Version 2.9.1: added IRMP logging for XMEGA, corrected timings for FAN protocol X-Git-Tag: irmp-libopencm3-pre-1~29 X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/commitdiff_plain/458a6d64e3f8847f7daa9b513875d1c7d32ed4cc Version 2.9.1: added IRMP logging for XMEGA, corrected timings for FAN protocol git-svn-id: svn://mikrocontroller.net/irmp@160 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- diff --git a/README.txt b/README.txt index e93a5f2..3fd8ebb 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ IRMP - Infrared Multi Protocol Decoder -------------------------------------- -Version IRMP: 2.9.0 27.05.2015 -Version IRSND: 2.9.0 27.05.2015 +Version IRMP: 2.9.1 28.05.2015 +Version IRSND: 2.9.1 28.05.2015 Dokumentation: diff --git a/irmp.c b/irmp.c index 49748e1..a75e8d7 100644 --- a/irmp.c +++ b/irmp.c @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.c,v 1.172 2015/05/27 09:33:14 fm Exp $ + * $Id: irmp.c,v 1.174 2015/05/28 06:48:19 fm Exp $ * * Supported AVR mikrocontrollers: * @@ -783,6 +783,19 @@ irmp_uart_init (void) // UART enable USART_Cmd(STM32_UART_COM, ENABLE); + +#elif defined (__AVR_XMEGA__) + + PMIC.CTRL |= PMIC_HILVLEN_bm; + + USARTC1.BAUDCTRLB = 0; + USARTC1.BAUDCTRLA = F_CPU /153600-1; + USARTC1.CTRLA = USART_RXCINTLVL_HI_gc; // High Level (Empfangen) + USARTC1.CTRLB = USART_TXEN_bm | USART_RXEN_bm; //Aktiviert Senden und Empfangen + USARTC1.CTRLC = USART_CHSIZE_8BIT_gc; //Größe der Zeichen: 8 Bit + PORTC.DIR |= (1<<7); //TXD als Ausgang setzen + PORTC.DIR &= ~(1<<6); + #else #if (IRMP_EXT_LOGGING == 0) // use UART @@ -831,14 +844,19 @@ irmp_uart_putc (unsigned char ch) #else #if (IRMP_EXT_LOGGING == 0) - + + # if defined (__AVR_XMEGA__) + while (!(USARTC1.STATUS & USART_DREIF_bm)); + USARTC1.DATA = ch; + + # else //AVR_MEGA while (!(UART0_UCSRA & UART0_UDRE_BIT_VALUE)) { ; } UART0_UDR = ch; - + #endif //__AVR_XMEGA__ #else sendextlog(ch); // use external log @@ -3349,12 +3367,16 @@ irmp_ISR (void) { // yes, break and close this frame if (irmp_pulse_time <= FAN_0_PULSE_LEN_MAX && irmp_pause_time >= FAN_0_PAUSE_LEN_MIN) { +#ifdef ANALYZE ANALYZE_PRINTF ("Generating virtual stop bit\n"); +#endif // ANALYZE got_light = TRUE; // this is a lie, but helps (generates stop bit) } else if (irmp_pulse_time >= FAN_1_PULSE_LEN_MIN && irmp_pause_time >= FAN_1_PAUSE_LEN_MIN) { +#ifdef ANALYZE ANALYZE_PRINTF ("Generating virtual stop bit\n"); +#endif // ANALYZE got_light = TRUE; // this is a lie, but helps (generates stop bit) } } diff --git a/irmpconfig.h b/irmpconfig.h index c334e23..3f87fd7 100644 --- a/irmpconfig.h +++ b/irmpconfig.h @@ -6,7 +6,7 @@ * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * Extensions for PIC 12F1820 W.Strobl 2014-07-20 * - * $Id: irmpconfig.h,v 1.129 2015/05/27 09:35:42 fm Exp $ + * $Id: irmpconfig.h,v 1.130 2015/05/28 06:46:49 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 @@ -72,7 +72,7 @@ #define IRMP_SUPPORT_BOSE_PROTOCOL 0 // BOSE >= 10000 ~150 bytes #define IRMP_SUPPORT_KATHREIN_PROTOCOL 0 // Kathrein >= 10000 ~200 bytes #define IRMP_SUPPORT_NUBERT_PROTOCOL 0 // NUBERT >= 10000 ~50 bytes -#define IRMP_SUPPORT_FAN_PROTOCOL 0 // FAN (ventilator) >= 10000 ~50 bytes +#define IRMP_SUPPORT_FAN_PROTOCOL 1 // FAN (ventilator) >= 10000 ~50 bytes #define IRMP_SUPPORT_SPEAKER_PROTOCOL 0 // SPEAKER (~NUBERT) >= 10000 ~50 bytes #define IRMP_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang & Olufsen >= 10000 ~200 bytes #define IRMP_SUPPORT_RECS80_PROTOCOL 0 // RECS80 (SAA3004) >= 15000 ~50 bytes diff --git a/irmpprotocols.h b/irmpprotocols.h index 8b566fe..33de666 100644 --- a/irmpprotocols.h +++ b/irmpprotocols.h @@ -5,7 +5,7 @@ * * Copyright (c) 2013-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmpprotocols.h,v 1.33 2015/05/27 09:33:14 fm Exp $ + * $Id: irmpprotocols.h,v 1.34 2015/05/28 06:46:49 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 @@ -362,15 +362,15 @@ typedef uint8_t PAUSE_LEN; * - has NO frame repetition *--------------------------------------------------------------------------------------------------------------------------------------------------- */ -#define FAN_START_BIT_PULSE_TIME 1340.0e-6 // 1340 usec pulse -#define FAN_START_BIT_PAUSE_TIME 340.0e-6 // 340 usec pause -#define FAN_1_PULSE_TIME 1340.0e-6 // 1340 usec pulse -#define FAN_1_PAUSE_TIME 340.0e-6 // 340 usec pause -#define FAN_0_PULSE_TIME 500.0e-6 // 500 usec pulse -#define FAN_0_PAUSE_TIME 1300.0e-6 // 1300 usec pause +#define FAN_START_BIT_PULSE_TIME 1280.0e-6 // 1280 usec pulse +#define FAN_START_BIT_PAUSE_TIME 380.0e-6 // 380 usec pause +#define FAN_1_PULSE_TIME 1280.0e-6 // 1280 usec pulse +#define FAN_1_PAUSE_TIME 380.0e-6 // 380 usec pause +#define FAN_0_PULSE_TIME 380.0e-6 // 380 usec pulse +#define FAN_0_PAUSE_TIME 1280.0e-6 // 1280 usec pause #define FAN_FRAMES 1 // FAN sends only 1 frame (NUBERT sends 2) -#define FAN_AUTO_REPETITION_PAUSE_TIME 35.0e-3 // auto repetition after 35ms -#define FAN_FRAME_REPEAT_PAUSE_TIME 35.0e-3 // frame repeat after 45ms +#define FAN_AUTO_REPETITION_PAUSE_TIME 6.6e-3 // auto repetition after 6.6ms +#define FAN_FRAME_REPEAT_PAUSE_TIME 6.6e-3 // frame repeat after 6.6ms #define FAN_ADDRESS_OFFSET 0 // skip 0 bits #define FAN_ADDRESS_LEN 0 // read 0 address bits #define FAN_COMMAND_OFFSET 0 // skip 0 bits diff --git a/irsndconfig.h b/irsndconfig.h index bb349a9..a42eacd 100644 --- a/irsndconfig.h +++ b/irsndconfig.h @@ -5,7 +5,7 @@ * * Copyright (c) 2010-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irsndconfig.h,v 1.70 2015/05/27 09:35:43 fm Exp $ + * $Id: irsndconfig.h,v 1.71 2015/05/28 06:46:49 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 @@ -62,7 +62,7 @@ // exotic protocols, enable here! Enable Remarks F_INTERRUPTS Program Space #define IRSND_SUPPORT_KATHREIN_PROTOCOL 0 // Kathrein >= 10000 DON'T CHANGE, NOT SUPPORTED YET! #define IRSND_SUPPORT_NUBERT_PROTOCOL 0 // NUBERT >= 10000 ~100 bytes -#define IRSND_SUPPORT_FAN_PROTOCOL 0 // FAN (ventilator) >= 10000 ~100 bytes +#define IRSND_SUPPORT_FAN_PROTOCOL 1 // FAN (ventilator) >= 10000 ~100 bytes #define IRSND_SUPPORT_SPEAKER_PROTOCOL 0 // SPEAKER >= 10000 ~100 bytes #define IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL 0 // Bang&Olufsen >= 10000 ~250 bytes #define IRSND_SUPPORT_RECS80_PROTOCOL 0 // RECS80 >= 15000 ~100 bytes