summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorukw2010-05-17 10:34:46 +0000
committerukw2010-05-17 10:34:46 +0000
commit5b437ff65b0f7ae2ba7b361737296ce9d886a113 (patch)
tree1a0483dc9269219d3a488ace6da33f44970dcd72
parentaab53843cc17bcd872a97ba7792e0f783cef0d9d (diff)
downloadirmp-5b437ff65b0f7ae2ba7b361737296ce9d886a113.zip
Version 1.3.1: corrected command bitmask for SAMSUNG32 protocol, added GRUNDIG protocol to IRSND.
git-svn-id: svn://mikrocontroller.net/irmp@13 aeb2e35e-bfc4-4214-b83c-9e8de998ed28
-rw-r--r--irmp.c24
-rw-r--r--irmp.exebin22016 -> 22016 bytes
-rw-r--r--irmp.h14
-rw-r--r--irsnd.c203
-rw-r--r--irsnd.exebin12288 -> 12800 bytes
-rw-r--r--irsndconfig.h3
6 files changed, 209 insertions, 35 deletions
diff --git a/irmp.c b/irmp.c
index 7c1225f..f4e2ef7 100644
--- a/irmp.c
+++ b/irmp.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.c,v 1.24 2010/05/16 21:58:13 fm Exp $
+ * $Id: irmp.c,v 1.25 2010/05/17 10:31:43 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -363,12 +363,12 @@ typedef unsigned int16 uint16_t;
#define SAMSUNG_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PULSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
#define SAMSUNG_START_BIT_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MIN_TOLERANCE_10 + 0.5) - 1)
#define SAMSUNG_START_BIT_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_START_BIT_PAUSE_TIME * MAX_TOLERANCE_10 + 0.5) + 1)
-#define SAMSUNG_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
-#define SAMSUNG_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
-#define SAMSUNG_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
-#define SAMSUNG_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
-#define SAMSUNG_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_50 + 0.5) - 1)
-#define SAMSUNG_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_50 + 0.5) + 1)
+#define SAMSUNG_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNG_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_PULSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define SAMSUNG_1_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNG_1_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
+#define SAMSUNG_0_PAUSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MIN_TOLERANCE_30 + 0.5) - 1)
+#define SAMSUNG_0_PAUSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME * MAX_TOLERANCE_30 + 0.5) + 1)
#define MATSUSHITA_START_BIT_PULSE_LEN_MIN ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MIN_TOLERANCE_20 + 0.5) - 1)
#define MATSUSHITA_START_BIT_PULSE_LEN_MAX ((uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME * MAX_TOLERANCE_20 + 0.5) + 1)
@@ -1763,6 +1763,11 @@ irmp_ISR (void)
}
else if (irmp_pulse_time >= SAMSUNG_PULSE_LEN_MIN && irmp_pulse_time <= SAMSUNG_PULSE_LEN_MAX)
{
+ irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;
+ irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;
+ irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;
+ irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;
+
if (irmp_pause_time >= SAMSUNG_1_PAUSE_LEN_MIN && irmp_pause_time <= SAMSUNG_1_PAUSE_LEN_MAX)
{
DEBUG_PUTCHAR ('1');
@@ -1779,11 +1784,6 @@ irmp_ISR (void)
}
DEBUG_PRINTF ("Switching to SAMSUNG32 protocol\n");
-
- irmp_param.protocol = IRMP_SAMSUNG32_PROTOCOL;
- irmp_param.command_offset = SAMSUNG32_COMMAND_OFFSET;
- irmp_param.command_end = SAMSUNG32_COMMAND_OFFSET + SAMSUNG32_COMMAND_LEN;
- irmp_param.complete_len = SAMSUNG32_COMPLETE_DATA_LEN;
}
else
{ // timing incorrect!
diff --git a/irmp.exe b/irmp.exe
index 93e51e7..9dc5f4b 100644
--- a/irmp.exe
+++ b/irmp.exe
Binary files differ
diff --git a/irmp.h b/irmp.h
index 6f718f8..4233a6f 100644
--- a/irmp.h
+++ b/irmp.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2009-2010 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irmp.h,v 1.14 2010/05/15 17:13:07 fm Exp $
+ * $Id: irmp.h,v 1.15 2010/05/17 10:31:43 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -47,8 +47,8 @@ extern "C"
#define SIRCS_1_PULSE_TIME 1200.0e-6 // 1200 usec pulse
#define SIRCS_0_PULSE_TIME 600.0e-6 // 600 usec pulse
#define SIRCS_PAUSE_TIME 600.0e-6 // 600 usec pause
-#define SIRCS_REPETITION_TIME 45.0e-3 // repetition after 45ms
-#define SIRCS_REPETITION_CNT 3 // SIRCS repeats each frame 3 times
+#define SIRCS_REPETITION_CNT 3 // SIRCS sends each frame 3 times
+#define SIRCS_REPETITION_TIME 25.0e-3 // repetition after 25ms
#define SIRCS_ADDRESS_OFFSET 15 // skip 15 bits
#define SIRCS_ADDRESS_LEN 5 // read up to 5 address bits
#define SIRCS_COMMAND_OFFSET 0 // skip 0 bits
@@ -90,6 +90,8 @@ extern "C"
#define SAMSUNG32_COMMAND_OFFSET 16 // skip 16 bits
#define SAMSUNG32_COMMAND_LEN 16 // read 16 command bits
#define SAMSUNG32_COMPLETE_DATA_LEN 32 // complete length
+#define SAMSUNG32_REPETITION_CNT 2 // SAMSUNG32 sends each frame 2 times
+#define SAMSUNG32_REPETITION_TIME 47.0e-3 // repetition after 47 ms
#define MATSUSHITA_START_BIT_PULSE_TIME 3488.0e-6 // 3488 usec pulse
#define MATSUSHITA_START_BIT_PAUSE_TIME 3488.0e-6 // 3488 usec pause
@@ -142,6 +144,7 @@ extern "C"
#define DENON_PULSE_TIME 275.0e-6 // 275 usec pulse
#define DENON_1_PAUSE_TIME 1900.0e-6 // 1900 usec pause
#define DENON_0_PAUSE_TIME 1050.0e-6 // 1050 usec pause
+#define DENON_REPETITION_CNT 2 // DENON sends each frame 2 times
#define DENON_REPETITION_TIME 65.0e-3 // inverted repetition after 65ms
#define DENON_ADDRESS_OFFSET 0 // skip 0 bits
#define DENON_ADDRESS_LEN 5 // read 5 address bits
@@ -183,6 +186,7 @@ extern "C"
#define NUBERT_1_PAUSE_TIME 340.0e-6 // 340 usec pause
#define NUBERT_0_PULSE_TIME 500.0e-6 // 500 usec pulse
#define NUBERT_0_PAUSE_TIME 1300.0e-6 // 1300 usec pause
+#define NUBERT_REPETITION_CNT 2 // Nubert sends 2 frames
#define NUBERT_REPETITION_TIME 35.0e-3 // repetition after 35ms
#define NUBERT_ADDRESS_OFFSET 0 // skip 0 bits
#define NUBERT_ADDRESS_LEN 0 // read 0 address bits
@@ -215,6 +219,8 @@ extern "C"
#define GRUNDIG_BIT_TIME 528.0e-6 // 528 usec pulse/pause
#define GRUNDIG_PRE_PAUSE_TIME 2639.0e-6 // 2639 usec pause after pre bit
+#define GRUNDIG_REPETITION_CNT 2 // SIRCS sends each frame 3 times
+#define GRUNDIG_REPETITION_TIME 20.0e-3 // repetition after 20ms
#define GRUNDIG_ADDRESS_OFFSET 0 // skip 2 bits (2nd start + 1 toggle)
#define GRUNDIG_ADDRESS_LEN 0 // read 5 address bits
#define GRUNDIG_COMMAND_OFFSET 1 // skip 2 bits (1 start bit)
@@ -223,7 +229,7 @@ extern "C"
#define GRUNDIG_STOP_BIT 0 // has no stop bit
#define GRUNDIG_LSB 1 // MSB...LSB
-#define AUTO_REPETITION_TIME 50.0e-3 // SIRCS or SAMSUNG32: automatic repetition after 45-50ms
+#define AUTO_REPETITION_TIME 50.0e-3 // SIRCS/SAMSUNG32/NUBERT: automatic repetition after 45-50ms
#define TRUE 1
#define FALSE 0
diff --git a/irsnd.c b/irsnd.c
index fb0ac47..eb3e29f 100644
--- a/irsnd.c
+++ b/irsnd.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de
*
- * $Id: irsnd.c,v 1.9 2010/04/28 14:58:59 fm Exp $
+ * $Id: irsnd.c,v 1.10 2010/05/17 10:31:43 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
@@ -56,7 +56,7 @@ typedef unsigned short uint16_t;
#define SIRCS_1_PULSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_1_PULSE_TIME + 0.5)
#define SIRCS_0_PULSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_0_PULSE_TIME + 0.5)
#define SIRCS_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SIRCS_PAUSE_TIME + 0.5)
-#define SIRCS_REPETITION_LEN (uint16_t)(F_INTERRUPTS * SIRCS_REPETITION_TIME + 0.5) // use uint16_t!
+#define SIRCS_REPETITION_LEN (uint16_t)(F_INTERRUPTS * SIRCS_REPETITION_TIME + 0.5) // use uint16_t!
#define NEC_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * NEC_START_BIT_PULSE_TIME + 0.5)
#define NEC_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * NEC_START_BIT_PAUSE_TIME + 0.5)
@@ -70,6 +70,8 @@ typedef unsigned short uint16_t;
#define SAMSUNG_1_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_1_PAUSE_TIME + 0.5)
#define SAMSUNG_0_PAUSE_LEN (uint8_t)(F_INTERRUPTS * SAMSUNG_0_PAUSE_TIME + 0.5)
+#define SAMSUNG32_REPETITION_LEN (uint16_t)(F_INTERRUPTS * SAMSUNG32_REPETITION_TIME + 0.5) // use uint16_t!
+
#define MATSUSHITA_START_BIT_PULSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PULSE_TIME + 0.5)
#define MATSUSHITA_START_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_START_BIT_PAUSE_TIME + 0.5)
#define MATSUSHITA_PULSE_LEN (uint8_t)(F_INTERRUPTS * MATSUSHITA_PULSE_TIME + 0.5)
@@ -121,6 +123,10 @@ typedef unsigned short uint16_t;
#define BANG_OLUFSEN_R_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_R_PAUSE_TIME + 0.5)
#define BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN (uint8_t)(F_INTERRUPTS * BANG_OLUFSEN_TRAILER_BIT_PAUSE_TIME + 0.5)
+#define GRUNDIG_PRE_PAUSE_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_PRE_PAUSE_TIME + 0.5)
+#define GRUNDIG_BIT_LEN (uint8_t)(F_INTERRUPTS * GRUNDIG_BIT_TIME + 0.5)
+#define GRUNDIG_REPETITION_LEN (uint16_t)(F_INTERRUPTS * GRUNDIG_REPETITION_TIME + 0.5) // use uint16_t!
+
#define IRSND_FREQ_32_KHZ (uint8_t) ((F_CPU / 32000 / 2) - 1)
#define IRSND_FREQ_36_KHZ (uint8_t) ((F_CPU / 36000 / 2) - 1)
#define IRSND_FREQ_38_KHZ (uint8_t) ((F_CPU / 38000 / 2) - 1)
@@ -408,6 +414,20 @@ irsnd_send_data (IRMP_DATA * irmp_data_p)
break;
}
#endif
+#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1
+ case IRMP_GRUNDIG_PROTOCOL:
+ {
+ command = bitsrevervse (irmp_data_p->command, GRUNDIG_COMMAND_LEN);
+
+ irsnd_buffer[0] = 0xFF; // S1111111
+ irsnd_buffer[1] = 0xC0; // 11000000
+ irsnd_buffer[2] = 0x80 | (command >> 2); // SCCCCCCC
+ irsnd_buffer[3] = (command << 6) & 0xC0; // CC000000
+
+ irsnd_busy = TRUE;
+ break;
+ }
+#endif
default:
{
break;
@@ -437,8 +457,8 @@ irsnd_ISR (void)
static uint8_t has_stop_bit;
static uint8_t new_frame = TRUE;
static uint8_t complete_data_len;
- static uint8_t n_frames; // number of repetitions
- static uint8_t frame_counter; // repetition counter
+ static uint8_t n_frames; // number of repetitions
+ static uint8_t frame_counter; // repetition counter
static uint16_t repetition_pause; // pause before repetition, uint16_t!
static uint16_t repetition_pause_counter; // pause before repetition, uint16_t!
#if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1
@@ -464,6 +484,11 @@ irsnd_ISR (void)
current_bit = 16;
complete_data_len = 2 * DENON_COMPLETE_DATA_LEN + 1;
}
+ else if (irsnd_protocol == IRMP_GRUNDIG_PROTOCOL)
+ {
+ current_bit = 15;
+ complete_data_len = 16 + GRUNDIG_COMPLETE_DATA_LEN;
+ }
}
else
{
@@ -498,8 +523,8 @@ irsnd_ISR (void)
pause_0_len = SIRCS_PAUSE_LEN;
has_stop_bit = SIRCS_STOP_BIT;
complete_data_len = SIRCS_MINIMUM_DATA_LEN;
- n_frames = SIRCS_REPETITION_CNT;
- repetition_pause = SIRCS_REPETITION_LEN; // 45 ms pause
+ n_frames = SIRCS_REPETITION_CNT; // 3 frames
+ repetition_pause = SIRCS_REPETITION_LEN; // 25ms pause
irsnd_set_freq (IRSND_FREQ_40_KHZ);
break;
}
@@ -515,7 +540,8 @@ irsnd_ISR (void)
pause_0_len = NEC_0_PAUSE_LEN;
has_stop_bit = NEC_STOP_BIT;
complete_data_len = NEC_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_38_KHZ);
break;
}
@@ -531,7 +557,8 @@ irsnd_ISR (void)
pause_0_len = SAMSUNG_0_PAUSE_LEN;
has_stop_bit = SAMSUNG_STOP_BIT;
complete_data_len = SAMSUNG_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_38_KHZ);
break;
}
@@ -546,7 +573,8 @@ irsnd_ISR (void)
pause_0_len = SAMSUNG_0_PAUSE_LEN;
has_stop_bit = SAMSUNG_STOP_BIT;
complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = SAMSUNG32_REPETITION_CNT; // 2 frames
+ repetition_pause = SAMSUNG32_REPETITION_LEN; // 47 ms pause
irsnd_set_freq (IRSND_FREQ_38_KHZ);
break;
}
@@ -562,7 +590,8 @@ irsnd_ISR (void)
pause_0_len = MATSUSHITA_0_PAUSE_LEN;
has_stop_bit = MATSUSHITA_STOP_BIT;
complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_36_KHZ);
break;
}
@@ -578,7 +607,8 @@ irsnd_ISR (void)
pause_0_len = RECS80_0_PAUSE_LEN;
has_stop_bit = RECS80_STOP_BIT;
complete_data_len = RECS80_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_38_KHZ);
break;
}
@@ -594,7 +624,8 @@ irsnd_ISR (void)
pause_0_len = RECS80EXT_0_PAUSE_LEN;
has_stop_bit = RECS80EXT_STOP_BIT;
complete_data_len = RECS80EXT_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_38_KHZ);
break;
}
@@ -610,7 +641,8 @@ irsnd_ISR (void)
pause_0_len = RC5_BIT_LEN;
has_stop_bit = RC5_STOP_BIT;
complete_data_len = RC5_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
irsnd_set_freq (IRSND_FREQ_36_KHZ);
break;
}
@@ -626,8 +658,8 @@ irsnd_ISR (void)
pause_0_len = DENON_0_PAUSE_LEN;
has_stop_bit = DENON_STOP_BIT;
complete_data_len = DENON_COMPLETE_DATA_LEN;
- n_frames = 2;
- repetition_pause = DENON_REPETITION_LEN; // 65 ms pause after 1st frame (15 bits)
+ n_frames = DENON_REPETITION_CNT; // 2 frames, 2nd with inverted command
+ repetition_pause = DENON_REPETITION_LEN; // 65 ms pause after 1st frame
irsnd_set_freq (IRSND_FREQ_32_KHZ);
break;
}
@@ -643,8 +675,8 @@ irsnd_ISR (void)
pause_0_len = NUBERT_0_PAUSE_LEN;
has_stop_bit = NUBERT_STOP_BIT;
complete_data_len = NUBERT_COMPLETE_DATA_LEN;
- n_frames = 2;
- repetition_pause = NUBERT_REPETITION_LEN; // 35 ms pause
+ n_frames = NUBERT_REPETITION_CNT; // 2 frames
+ repetition_pause = NUBERT_REPETITION_LEN; // 35 ms pause
irsnd_set_freq (IRSND_FREQ_36_KHZ);
break;
}
@@ -660,12 +692,30 @@ irsnd_ISR (void)
pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN;
has_stop_bit = BANG_OLUFSEN_STOP_BIT;
complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN;
- n_frames = 1;
+ n_frames = 1; // 1 frame
+ repetition_pause = 0;
last_bit_value = 0;
irsnd_set_freq (IRSND_FREQ_455_KHZ);
break;
}
#endif
+#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1
+ case IRMP_GRUNDIG_PROTOCOL:
+ {
+ startbit_pulse_len = GRUNDIG_BIT_LEN;
+ startbit_pause_len = GRUNDIG_PRE_PAUSE_LEN;
+ pulse_1_len = GRUNDIG_BIT_LEN;
+ pause_1_len = GRUNDIG_BIT_LEN;
+ pulse_0_len = GRUNDIG_BIT_LEN;
+ pause_0_len = GRUNDIG_BIT_LEN;
+ has_stop_bit = GRUNDIG_STOP_BIT;
+ complete_data_len = GRUNDIG_COMPLETE_DATA_LEN;
+ n_frames = GRUNDIG_REPETITION_CNT; // 2 frames
+ repetition_pause = GRUNDIG_REPETITION_LEN; // 20msec pause
+ irsnd_set_freq (IRSND_FREQ_36_KHZ);
+ break;
+ }
+#endif
default:
{
irsnd_busy = FALSE;
@@ -929,6 +979,123 @@ irsnd_ISR (void)
break;
}
#endif // IRSND_SUPPORT_RC5_PROTOCOL
+
+#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1
+ case IRMP_GRUNDIG_PROTOCOL:
+ {
+ uint8_t next_bit = FALSE;
+
+ if (current_bit == 0xFF || current_bit == 15) // start bit of 1st or 2nd frame
+ {
+ if (pulse_counter == 0)
+ {
+ pulse_len = startbit_pulse_len;
+ pause_len = startbit_pause_len;
+ }
+
+ if (pulse_counter < pulse_len)
+ {
+ if (pulse_counter == 0)
+ {
+ irsnd_on ();
+ }
+ pulse_counter++;
+ }
+ else if (pause_counter < pause_len)
+ {
+ if (pause_counter == 0)
+ {
+ irsnd_off ();
+ }
+ pause_counter++;
+ }
+ else
+ {
+ current_bit++;
+ pulse_counter = 0;
+ pause_counter = 0;
+ }
+ }
+ else // send n'th bit
+ {
+ uint8_t first_pulse;
+
+ first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE;
+
+ if (first_pulse)
+ {
+ if (pulse_counter < GRUNDIG_BIT_LEN)
+ {
+ if (pulse_counter == 0)
+ {
+ irsnd_on ();
+ }
+ pulse_counter++;
+ }
+ else if (pause_counter < GRUNDIG_BIT_LEN)
+ {
+ if (pause_counter == 0)
+ {
+ irsnd_off ();
+ }
+ pause_counter++;
+ }
+ else
+ {
+ next_bit = TRUE;
+ }
+ }
+ else
+ {
+ if (pause_counter < GRUNDIG_BIT_LEN)
+ {
+ if (pause_counter == 0)
+ {
+ irsnd_off ();
+ }
+ pause_counter++;
+ }
+ else if (pulse_counter < GRUNDIG_BIT_LEN)
+ {
+ if (pulse_counter == 0)
+ {
+ irsnd_on ();
+ }
+ pulse_counter++;
+ }
+ else
+ {
+ next_bit = TRUE;
+ }
+ }
+
+ if (next_bit)
+ {
+ current_bit++;
+
+ if (current_bit >= complete_data_len)
+ {
+ current_bit = 0xFF;
+ frame_counter++;
+
+ if (frame_counter == n_frames)
+ {
+ irsnd_busy = FALSE;
+ frame_counter = 0;
+ }
+
+ new_frame = TRUE;
+ irsnd_off ();
+ }
+
+ pulse_counter = 0;
+ pause_counter = 0;
+ }
+ }
+ break;
+ }
+#endif // IRSND_SUPPORT_GRUNDIG_PROTOCOL
+
default:
{
irsnd_busy = FALSE;
diff --git a/irsnd.exe b/irsnd.exe
index bec88b3..5bce0d7 100644
--- a/irsnd.exe
+++ b/irsnd.exe
Binary files differ
diff --git a/irsndconfig.h b/irsndconfig.h
index 597a1a9..81772bf 100644
--- a/irsndconfig.h
+++ b/irsndconfig.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de
*
- * $Id$
+ * $Id: irsndconfig.h,v 1.2 2010/05/17 10:31:43 fm Exp $
*
* ATMEGA88 @ 8 MHz
*
@@ -33,6 +33,7 @@
#define IRSND_SUPPORT_RECS80EXT_PROTOCOL 1 // flag: support RECS80EXT uses ~100 bytes
#define IRSND_SUPPORT_NUBERT_PROTOCOL 1 // flag: support NUBERT uses ~100 bytes
#define IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL 1 // flag: support Bang&Olufsen uses ~250 bytes
+#define IRSND_SUPPORT_GRUNDIG_PROTOCOL 1 // flag: support Grundig uses ~250 bytes
/*---------------------------------------------------------------------------------------------------------------------------------------------------