-/*---------------------------------------------------------------------------------------------------------------------------------------------------\r
+ /*---------------------------------------------------------------------------------------------------------------------------------------------------\r
* irsnd.h\r
*\r
- * Copyright (c) 2010-2013 Frank Meyer - frank(at)fli4l.de\r
+ * Copyright (c) 2010-2014 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irsnd.h,v 1.15 2013/01/17 07:33:13 fm Exp $\r
- *\r
- * ATMEGA88 @ 8 MHz\r
+ * $Id: irsnd.h,v 1.20 2014/09/15 10:27:38 fm Exp $\r
*\r
* This program is free software; you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
# endif\r
\r
#elif defined(PIC_C18)\r
-// Do not change lines below until you have a different HW. Example is for 18F2550/18F4550\r
-// setup macro for PWM used PWM module\r
-# if IRSND_OCx == IRSND_PIC_CCP2 \r
-# define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2\r
-# define SetDCPWM(x) SetDCPWM2(x) \r
-# define ClosePWM ClosePWM2\r
-# define OpenPWM(x) OpenPWM2(x) \r
-# endif\r
-# if IRSND_OCx == IRSND_PIC_CCP1 \r
-# define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1\r
-# define SetDCPWM(x) SetDCPWM1(x)\r
-# define ClosePWM ClosePWM1\r
-# define OpenPWM(x) OpenPWM1(x)\r
-# endif\r
-//Setup macro for OpenTimer with defined Pre_Scaler\r
-# if Pre_Scaler == 1\r
-# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_1); \r
-# elif Pre_Scaler == 4\r
-# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_4); \r
-# elif Pre_Scaler == 16\r
-# define OpenTimer OpenTimer2(TIMER_INT_OFF & T2_PS_1_16); \r
-# else\r
-# error Incorrect value for Pre_Scaler\r
-# endif\r
-#endif // ARM_STM32\r
+\r
+# if defined(__12F1840)\r
+ // Do not change lines below unless you have a different HW. This example is for 12F1840\r
+ // setup macro for PWM used PWM module\r
+ \r
+ //~ # define PWMon() TMR2=0,IRSND_PIN=1\r
+ //~ # define PWMoff() CCP1CON &=(~0b1100)\r
+ //~ # define PWMon() TMR2ON=1\r
+ //~ # define PWMoff() TMR2ON=0\r
+ #if defined(IRSND_DEBUG) \r
+ #define PWMon() LATA0=1\r
+ #define PWMoff() LATA0=0\r
+ #define IRSND_PIN LATA0\r
+ #else\r
+ # define PWMon() TMR2=0,CCP1CON |=0b1100\r
+ # define PWMoff() CCP1CON &=(~0b1100)\r
+ # define IRSND_PIN RA2\r
+ #endif\r
+\r
+#else\r
+ // Do not change lines below until you have a different HW. Example is for 18F2550/18F4550\r
+ // setup macro for PWM used PWM module\r
+ # if IRSND_OCx == IRSND_PIC_CCP2 \r
+ # define PWMon() TMR2=0,CCP2CON |=0b1100\r
+ # define PWMoff() CCP2CON &=(~0b1100)\r
+ # define IRSND_PIN TRISCbits.TRISC1 // RC1 = PWM2\r
+ # define SetDCPWM(x) SetDCPWM2(x) \r
+ # define ClosePWM ClosePWM2\r
+ # define OpenPWM(x) OpenPWM2(x) \r
+ # endif\r
+ # if IRSND_OCx == IRSND_PIC_CCP1 \r
+ # define PWMon() TMR2=0,CCP1CON |=0b1100\r
+ # define PWMoff() CCP1CON &=(~0b1100)\r
+ # define IRSND_PIN TRISCbits.TRISC2 // RC2 = PWM1\r
+ # define SetDCPWM(x) SetDCPWM1(x)\r
+ # define ClosePWM ClosePWM1\r
+ # define OpenPWM(x) OpenPWM1(x)\r
+ # endif \r
+# endif\r
+# endif // PIC_C18\r
\r
#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
# warning F_INTERRUPTS too low, SIEMENS protocol disabled (should be at least 15000)\r
# define IRSND_SUPPORT_A1TVBOX_PROTOCOL 0\r
#endif\r
\r
-#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 20000\r
-# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 20000)\r
+#if IRSND_SUPPORT_RECS80_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
+# warning F_INTERRUPTS too low, RECS80 protocol disabled (should be at least 15000)\r
# undef IRSND_SUPPORT_RECS80_PROTOCOL\r
# define IRSND_SUPPORT_RECS80_PROTOCOL 0\r
#endif\r
\r
-#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 20000\r
-# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 20000)\r
+#if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 && F_INTERRUPTS < 15000\r
+# warning F_INTERRUPTS too low, RECS80EXT protocol disabled (should be at least 15000)\r
# undef IRSND_SUPPORT_RECS80EXT_PROTOCOL\r
# define IRSND_SUPPORT_RECS80EXT_PROTOCOL 0\r
#endif\r