*\r
* Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de\r
*\r
- * $Id: irsnd.c,v 1.29 2011/01/18 13:02:15 fm Exp $\r
+ * $Id: irsnd.c,v 1.32 2011/02/22 17:05:57 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
#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME + 0.5)\r
#define BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * BANG_OLUFSEN_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t!\r
\r
-#define GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_PRE_PAUSE_TIME + 0.5)\r
-#define GRUNDIG_OR_NOKIA_BIT_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_BIT_TIME + 0.5)\r
+#define GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_PRE_PAUSE_TIME + 0.5)\r
+#define GRUNDIG_NOKIA_IR60_BIT_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_BIT_TIME + 0.5)\r
#define GRUNDIG_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t!\r
#define NOKIA_AUTO_REPETITION_PAUSE_LEN (uint16_t)(F_INTERRUPTS * NOKIA_AUTO_REPETITION_PAUSE_TIME + 0.5) // use uint16_t!\r
-#define GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t!\r
+#define GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t!\r
\r
-#define SIEMENS_START_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME + 0.5)\r
-#define SIEMENS_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_BIT_TIME + 0.5)\r
-#define SIEMENS_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIEMENS_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t!\r
+#define SIEMENS_START_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_START_BIT_PULSE_TIME + 0.5)\r
+#define SIEMENS_BIT_LEN (uint8_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_BIT_PULSE_TIME + 0.5)\r
+#define SIEMENS_FRAME_REPEAT_PAUSE_LEN (uint16_t)(F_INTERRUPTS * SIEMENS_OR_RUWIDO_FRAME_REPEAT_PAUSE_TIME + 0.5) // use uint16_t!\r
\r
#define IRSND_FREQ_32_KHZ (uint8_t) ((F_CPU / 32000 / 2) - 1)\r
#define IRSND_FREQ_36_KHZ (uint8_t) ((F_CPU / 36000 / 2) - 1)\r
#if IRSND_SUPPORT_RC5_PROTOCOL == 1\r
static uint8_t toggle_bit_rc5;\r
#endif\r
-#if IRSND_SUPPORT_RC5_PROTOCOL == 1\r
+#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1\r
static uint8_t toggle_bit_rc6;\r
#endif\r
uint16_t address;\r
n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command\r
auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame\r
repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN;\r
- irsnd_set_freq (IRSND_FREQ_38_KHZ); // in theory 32kHz, in practice 38kHz\r
+ irsnd_set_freq (IRSND_FREQ_36_KHZ); // in theory 32kHz, in practice 36kHz is better\r
break;\r
}\r
#endif\r
#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
case IRMP_GRUNDIG_PROTOCOL:\r
{\r
- startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1;\r
- pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- pause_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT;\r
+ startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
complete_data_len = GRUNDIG_COMPLETE_DATA_LEN;\r
n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames\r
auto_repetition_pause_len = GRUNDIG_AUTO_REPETITION_PAUSE_LEN; // 20m sec pause\r
- repeat_frame_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
\r
break;\r
#if IRSND_SUPPORT_NOKIA_PROTOCOL == 1\r
case IRMP_NOKIA_PROTOCOL:\r
{\r
- startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1;\r
- pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- pause_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT;\r
+ startbit_pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ startbit_pause_len = GRUNDIG_NOKIA_IR60_PRE_PAUSE_LEN - 1;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ has_stop_bit = GRUNDIG_NOKIA_IR60_STOP_BIT;\r
complete_data_len = NOKIA_COMPLETE_DATA_LEN;\r
n_auto_repetitions = NOKIA_FRAMES; // 2 frames\r
auto_repetition_pause_len = NOKIA_AUTO_REPETITION_PAUSE_LEN; // 20 msec pause\r
- repeat_frame_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
+ repeat_frame_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN; // 117 msec pause\r
irsnd_set_freq (IRSND_FREQ_38_KHZ);\r
break;\r
}\r
startbit_pause_len = SIEMENS_BIT_LEN;\r
pulse_len = SIEMENS_BIT_LEN;\r
pause_len = SIEMENS_BIT_LEN;\r
- has_stop_bit = SIEMENS_STOP_BIT;\r
+ has_stop_bit = SIEMENS_OR_RUWIDO_STOP_BIT;\r
complete_data_len = SIEMENS_COMPLETE_DATA_LEN - 1;\r
n_auto_repetitions = 1; // 1 frame\r
auto_repetition_pause_len = 0;\r
\r
if (repeat_counter > 0)\r
{ // set 117 msec pause time\r
- auto_repetition_pause_len = GRUNDIG_OR_NOKIA_FRAME_REPEAT_PAUSE_LEN;\r
+ auto_repetition_pause_len = GRUNDIG_NOKIA_IR60_FRAME_REPEAT_PAUSE_LEN;\r
}\r
\r
if (repeat_counter < n_repeat_frames) // tricky: repeat n info frames per auto repetition before sending last stop frame\r
}\r
else // send n'th bit\r
{\r
- pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
- pause_len = GRUNDIG_OR_NOKIA_BIT_LEN;\r
+ pulse_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
+ pause_len = GRUNDIG_NOKIA_IR60_BIT_LEN;\r
first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE;\r
}\r
}\r