+\r
+#if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1\r
+ case IRMP_GRUNDIG_PROTOCOL:\r
+ {\r
+ uint8_t next_bit = FALSE;\r
+\r
+ if (current_bit == 0xFF || current_bit == 15) // start bit of 1st or 2nd frame\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ pulse_len = startbit_pulse_len;\r
+ pause_len = startbit_pause_len;\r
+ }\r
+\r
+ if (pulse_counter < pulse_len)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ else if (pause_counter < pause_len)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ else\r
+ {\r
+ current_bit++;\r
+ pulse_counter = 0;\r
+ pause_counter = 0;\r
+ }\r
+ }\r
+ else // send n'th bit\r
+ {\r
+ uint8_t first_pulse;\r
+\r
+ first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE;\r
+\r
+ if (first_pulse)\r
+ {\r
+ if (pulse_counter < GRUNDIG_BIT_LEN)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ else if (pause_counter < GRUNDIG_BIT_LEN)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ else\r
+ {\r
+ next_bit = TRUE;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if (pause_counter < GRUNDIG_BIT_LEN)\r
+ {\r
+ if (pause_counter == 0)\r
+ {\r
+ irsnd_off ();\r
+ }\r
+ pause_counter++;\r
+ }\r
+ else if (pulse_counter < GRUNDIG_BIT_LEN)\r
+ {\r
+ if (pulse_counter == 0)\r
+ {\r
+ irsnd_on ();\r
+ }\r
+ pulse_counter++;\r
+ }\r
+ else\r
+ {\r
+ next_bit = TRUE;\r
+ }\r
+ }\r
+\r
+ if (next_bit)\r
+ {\r
+ current_bit++;\r
+\r
+ if (current_bit >= complete_data_len)\r
+ {\r
+ current_bit = 0xFF;\r
+ frame_counter++;\r
+\r
+ if (frame_counter == n_frames)\r
+ {\r
+ irsnd_busy = FALSE;\r
+ frame_counter = 0;\r
+ }\r
+\r
+ new_frame = TRUE;\r
+ irsnd_off ();\r
+ }\r
+\r
+ pulse_counter = 0;\r
+ pause_counter = 0;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+#endif // IRSND_SUPPORT_GRUNDIG_PROTOCOL\r
+\r