X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp.git/blobdiff_plain/fa09ce10c2ae1f28febb317b0c84596423852e28..f71bec53129472a38453877af44cc3d85acaded2:/irsnd.h?ds=sidebyside diff --git a/irsnd.h b/irsnd.h index 5d2abb8..91d8810 100644 --- a/irsnd.h +++ b/irsnd.h @@ -1,11 +1,9 @@ -/*--------------------------------------------------------------------------------------------------------------------------------------------------- + /*--------------------------------------------------------------------------------------------------------------------------------------------------- * irsnd.h * - * Copyright (c) 2010-2012 Frank Meyer - frank(at)fli4l.de + * Copyright (c) 2010-2015 Frank Meyer - frank(at)fli4l.de * - * $Id: irsnd.h,v 1.14 2012/12/12 15:44:53 fm Exp $ - * - * ATMEGA88 @ 8 MHz + * $Id: irsnd.h,v 1.21 2015/01/26 13:09:28 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 @@ -50,31 +48,46 @@ # endif #elif defined(PIC_C18) -// Do not change lines below until you have a different HW. Example is for 18F2550/18F4550 -// setup macro for PWM used PWM module -# if IRSND_OCx == IRSND_PIC_CCP2 -# define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2 -# define SetDCPWM(x) SetDCPWM2(x) -# define ClosePWM ClosePWM2 -# define OpenPWM(x) OpenPWM2(x) -# endif -# if IRSND_OCx == IRSND_PIC_CCP1 -# define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1 -# define SetDCPWM(x) SetDCPWM1(x) -# define ClosePWM ClosePWM1 -# define OpenPWM(x) OpenPWM1(x) -# endif -//Setup macro for OpenTimer with defined Pre_Scaler -# if Pre_Scaler == 1 -# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_1); -# elif Pre_Scaler == 4 -# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_4); -# elif Pre_Scaler == 16 -# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_16); -# else -# error Incorrect value for Pre_Scaler -# endif -#endif // ARM_STM32 + +# if defined(__12F1840) + // Do not change lines below unless you have a different HW. This example is for 12F1840 + // setup macro for PWM used PWM module + + //~ # define PWMon() TMR2=0,IRSND_PIN=1 + //~ # define PWMoff() CCP1CON &=(~0b1100) + //~ # define PWMon() TMR2ON=1 + //~ # define PWMoff() TMR2ON=0 + #if defined(IRSND_DEBUG) + #define PWMon() LATA0=1 + #define PWMoff() LATA0=0 + #define IRSND_PIN LATA0 + #else + # define PWMon() TMR2=0,CCP1CON |=0b1100 + # define PWMoff() CCP1CON &=(~0b1100) + # define IRSND_PIN RA2 + #endif + +#else + // Do not change lines below until you have a different HW. Example is for 18F2550/18F4550 + // setup macro for PWM used PWM module + # if IRSND_OCx == IRSND_PIC_CCP2 + # define PWMon() TMR2=0,CCP2CON |=0b1100 + # define PWMoff() CCP2CON &=(~0b1100) + # define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2 + # define SetDCPWM(x) SetDCPWM2(x) + # define ClosePWM ClosePWM2 + # define OpenPWM(x) OpenPWM2(x) + # endif + # if IRSND_OCx == IRSND_PIC_CCP1 + # define PWMon() TMR2=0,CCP1CON |=0b1100 + # define PWMoff() CCP1CON &=(~0b1100) + # define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1 + # define SetDCPWM(x) SetDCPWM1(x) + # define ClosePWM ClosePWM1 + # define OpenPWM(x) OpenPWM1(x) + # endif +# endif +# endif // PIC_C18 #if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000 # warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000) @@ -88,14 +101,14 @@ # define IRSND_SUPPORT_A1TVBOX_PROTOCOL 0 #endif -#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 20000 -# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 20000) +#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000) # undef IRSND_SUPPORT_RECS80_PROTOCOL # define IRSND_SUPPORT_RECS80_PROTOCOL 0 #endif -#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 20000 -# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 20000) +#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000 +# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000) # undef IRSND_SUPPORT_RECS80EXT_PROTOCOL # define IRSND_SUPPORT_RECS80EXT_PROTOCOL 0 #endif