From 22a5040e891c8139aaf40cd93ebc0533a82190a2 Mon Sep 17 00:00:00 2001 From: ukw Date: Thu, 7 May 2015 06:53:55 +0000 Subject: [PATCH] Version 2.8.2: corrections of AVR XMEGA port git-svn-id: svn://mikrocontroller.net/irmp@156 aeb2e35e-bfc4-4214-b83c-9e8de998ed28 --- irmp.h | 6 +++--- irsnd.c | 50 ++++++++++++++++++++++++++++++-------------------- irsndconfig.h | 8 ++++---- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/irmp.h b/irmp.h index f662fe1..74a54f3 100644 --- a/irmp.h +++ b/irmp.h @@ -3,7 +3,7 @@ * * Copyright (c) 2009-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irmp.h,v 1.93 2015/02/26 15:42:53 fm Exp $ + * $Id: irmp.h,v 1.94 2015/05/07 06:51:10 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 @@ -25,8 +25,8 @@ # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) # define IRMP_PORT_PRE CONCAT(PORT, IRMP_PORT_LETTER) -# define IRMP_DDR_PRE CONCAT(DDR, IRMP_PORT_LETTER) -# define IRMP_PIN_PRE CONCAT(PIN, IRMP_PORT_LETTER) +# define IRMP_DDR_PRE CONCAT(PORT, IRMP_PORT_LETTER) +# define IRMP_PIN_PRE CONCAT(PORT, IRMP_PORT_LETTER) # define IRMP_PORT IRMP_PORT_PRE.OUT # define IRMP_DDR IRMP_DDR_PRE.DIR # define IRMP_PIN IRMP_PIN_PRE.IN diff --git a/irsnd.c b/irsnd.c index af08908..a45fc42 100644 --- a/irsnd.c +++ b/irsnd.c @@ -13,7 +13,7 @@ * ATmega164, ATmega324, ATmega644, ATmega644P, ATmega1284, ATmega1284P * ATmega88, ATmega88P, ATmega168, ATmega168P, ATmega328P * - * $Id: irsnd.c,v 1.85 2015/04/23 12:46:13 fm Exp $ + * $Id: irsnd.c,v 1.86 2015/05/07 06:51:10 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 @@ -146,17 +146,6 @@ # endif // IRSND_OCx #elif defined (__AVR_ATxmega128A1U__) // ATxmega128A1U -# if (XMEGA_Timer_NR == 1) -# define IRSND_PORT_PRE PORTC -# elif (XMEGA_Timer_NR == 2) -# define IRSND_PORT_PRE PORTD -# elif (XMEGA_Timer_NR == 3) -# define IRSND_PORT_PRE PORTE -# elif (XMEGA_Timer_NR == 4) -# define IRSND_PORT_PRE PORTF -# else -# warning wrong XMEGA_Timer_NR, choose correct value in irsndconfig.h -# endif # if IRSND_OCx == IRSND_XMEGA_OC0A # define IRSND_BIT_NUMBER 0 # elif IRSND_OCx == IRSND_XMEGA_OC0B @@ -187,10 +176,9 @@ # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) # define IRSND_PORT IRSND_PORT_PRE.OUT -# define IRSND_DDR IRSND_DDR_PRE.DIR -# define IRSND_PIN IRSND_PIN_PRE.IN +# define IRSND_DDR IRSND_PORT_PRE.DIR +# define IRSND_PIN IRSND_PORT_PRE.IN # define IRSND_BIT IRSND_BIT_NUMBER - #elif defined(ATMEL_AVR) # define _CONCAT(a,b) a##b # define CONCAT(a,b) _CONCAT(a,b) @@ -471,14 +459,18 @@ irsnd_on (void) TIM_Cmd(IRSND_TIMER, ENABLE); // enable counter # elif defined (__AVR_XMEGA__) -# if ( (IRSND_OCx == IRSND_XMEGA_OC0A) | (IRSND_OCx == IRSND_XMEGA_OC1A) ) // use OC0A or OC1A +# if (IRSND_OCx == IRSND_XMEGA_OC0A) // use OC0A XMEGA_Timer.CTRLB |= (1<