Rev 838 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 838 | Rev 903 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /*--------------------------------------------------------------------------------------------------------------------------------------------------- |
1 | /*--------------------------------------------------------------------------------------------------------------------------------------------------- |
2 | * @file irsnd.c |
2 | * @file irsnd.c |
3 | * |
3 | * |
4 | * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de |
4 | * Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de |
5 | * |
5 | * |
6 | * $Id: irsnd.c,v 1.26 2010/11/09 21:14:31 fm Exp $ |
6 | * $Id: irsnd.c,v 1.29 2011/01/18 13:02:15 fm Exp $ |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
Line 313... | Line 313... | ||
313 | } |
313 | } |
314 | return xx; |
314 | return xx; |
315 | } |
315 | } |
Line -... | Line 316... | ||
- | 316 | ||
- | 317 | ||
- | 318 | #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
|
- | 319 | static uint8_t sircs_additional_bitlen; |
|
316 | 320 | #endif // IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
|
317 | 321 | ||
318 | uint8_t |
322 | uint8_t |
319 | irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) |
323 | irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) |
320 | { |
324 | { |
Line 325... | Line 329... | ||
325 | static uint8_t toggle_bit_recs80ext; |
329 | static uint8_t toggle_bit_recs80ext; |
326 | #endif |
330 | #endif |
327 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
331 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
328 | static uint8_t toggle_bit_rc5; |
332 | static uint8_t toggle_bit_rc5; |
329 | #endif |
333 | #endif |
- | 334 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 335 | static uint8_t toggle_bit_rc6; |
|
- | 336 | #endif |
|
330 | uint16_t address; |
337 | uint16_t address; |
331 | uint16_t command; |
338 | uint16_t command; |
Line 332... | Line 339... | ||
332 | 339 | ||
333 | if (do_wait) |
340 | if (do_wait) |
Line 348... | Line 355... | ||
348 | switch (irsnd_protocol) |
355 | switch (irsnd_protocol) |
349 | { |
356 | { |
350 | #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
357 | #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
351 | case IRMP_SIRCS_PROTOCOL: |
358 | case IRMP_SIRCS_PROTOCOL: |
352 | { |
359 | { |
- | 360 | uint8_t sircs_additional_command_len; |
|
- | 361 | uint8_t sircs_additional_address_len; |
|
- | 362 | ||
- | 363 | sircs_additional_bitlen = (irmp_data_p->address & 0xFF00) >> 8; // additional bitlen |
|
- | 364 | ||
- | 365 | if (sircs_additional_bitlen > 15 - SIRCS_MINIMUM_DATA_LEN) |
|
- | 366 | { |
|
- | 367 | sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN; |
|
- | 368 | sircs_additional_address_len = sircs_additional_bitlen - (15 - SIRCS_MINIMUM_DATA_LEN); |
|
- | 369 | } |
|
- | 370 | else |
|
- | 371 | { |
|
- | 372 | sircs_additional_command_len = sircs_additional_bitlen; |
|
- | 373 | sircs_additional_address_len = 0; |
|
- | 374 | } |
|
- | 375 | ||
353 | command = bitsrevervse (irmp_data_p->command, SIRCS_MINIMUM_DATA_LEN); |
376 | command = bitsrevervse (irmp_data_p->command, 15); |
Line 354... | Line 377... | ||
354 | 377 | ||
355 | irsnd_buffer[0] = (command & 0x0FF0) >> 4; // CCCCCCCC |
378 | irsnd_buffer[0] = (command & 0x7F80) >> 7; // CCCCCCCC |
- | 379 | irsnd_buffer[1] = (command & 0x007F) << 1; // CCCC**** |
|
- | 380 | ||
- | 381 | if (sircs_additional_address_len > 0) |
|
- | 382 | { |
|
- | 383 | address = bitsrevervse (irmp_data_p->address, 5); |
|
- | 384 | irsnd_buffer[1] |= (address & 0x0010) >> 4; |
|
- | 385 | irsnd_buffer[2] = (address & 0x000F) << 4; |
|
356 | irsnd_buffer[1] = (command & 0x000F) << 4; // CCCC0000 |
386 | } |
357 | irsnd_busy = TRUE; |
387 | irsnd_busy = TRUE; |
358 | break; |
388 | break; |
359 | } |
389 | } |
360 | #endif |
390 | #endif |
Line 493... | Line 523... | ||
493 | irsnd_buffer[1] = (irmp_data_p->command & 0x1F) << 3; // CCCCC000 |
523 | irsnd_buffer[1] = (irmp_data_p->command & 0x1F) << 3; // CCCCC000 |
494 | irsnd_busy = TRUE; |
524 | irsnd_busy = TRUE; |
495 | break; |
525 | break; |
496 | } |
526 | } |
497 | #endif |
527 | #endif |
- | 528 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
|
- | 529 | case IRMP_RC6_PROTOCOL: |
|
- | 530 | { |
|
- | 531 | toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08; |
|
- | 532 | ||
- | 533 | irsnd_buffer[0] = 0x80 | toggle_bit_rc6 | ((irmp_data_p->address & 0x00E0) >> 5); // 1MMMTAAA, MMM = 000 |
|
- | 534 | irsnd_buffer[1] = ((irmp_data_p->address & 0x001F) << 3) | ((irmp_data_p->command & 0xE0) >> 5); // AAAAACCC |
|
- | 535 | irsnd_buffer[2] = (irmp_data_p->command & 0x1F) << 3; // CCCCC |
|
- | 536 | irsnd_busy = TRUE; |
|
- | 537 | break; |
|
- | 538 | } |
|
- | 539 | #endif |
|
- | 540 | #if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 541 | case IRMP_RC6A_PROTOCOL: |
|
- | 542 | { |
|
- | 543 | toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08; |
|
- | 544 | ||
- | 545 | irsnd_buffer[0] = 0x80 | 0x60 | ((irmp_data_p->address & 0x3000) >> 12); // 1MMMT0AA, MMM = 110 |
|
- | 546 | irsnd_buffer[1] = ((irmp_data_p->address & 0x0FFF) >> 4) ; // AAAAAAAA |
|
- | 547 | irsnd_buffer[2] = ((irmp_data_p->address & 0x000F) << 4) | ((irmp_data_p->command & 0xF000) >> 12) | toggle_bit_rc6; // AAAACCCC |
|
- | 548 | irsnd_buffer[3] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC |
|
- | 549 | irsnd_buffer[4] = (irmp_data_p->command & 0x000F) << 4; // CCCC |
|
- | 550 | irsnd_busy = TRUE; |
|
- | 551 | break; |
|
- | 552 | } |
|
- | 553 | #endif |
|
498 | #if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
554 | #if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
499 | case IRMP_DENON_PROTOCOL: |
555 | case IRMP_DENON_PROTOCOL: |
500 | { |
556 | { |
501 | irsnd_buffer[0] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x0380) >> 7); // AAAAACCC (1st frame) |
557 | irsnd_buffer[0] = ((irmp_data_p->address & 0x1F) << 3) | ((irmp_data_p->command & 0x0380) >> 7); // AAAAACCC (1st frame) |
502 | irsnd_buffer[1] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC |
558 | irsnd_buffer[1] = (irmp_data_p->command & 0x7F) << 1; // CCCCCCC |
Line 737... | Line 793... | ||
737 | { |
793 | { |
738 | #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
794 | #if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
739 | case IRMP_SIRCS_PROTOCOL: |
795 | case IRMP_SIRCS_PROTOCOL: |
740 | { |
796 | { |
741 | startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN; |
797 | startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN; |
742 | startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN; |
798 | startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN - 1; |
743 | pulse_1_len = SIRCS_1_PULSE_LEN; |
799 | pulse_1_len = SIRCS_1_PULSE_LEN; |
744 | pause_1_len = SIRCS_PAUSE_LEN; |
800 | pause_1_len = SIRCS_PAUSE_LEN - 1; |
745 | pulse_0_len = SIRCS_0_PULSE_LEN; |
801 | pulse_0_len = SIRCS_0_PULSE_LEN; |
746 | pause_0_len = SIRCS_PAUSE_LEN; |
802 | pause_0_len = SIRCS_PAUSE_LEN - 1; |
747 | has_stop_bit = SIRCS_STOP_BIT; |
803 | has_stop_bit = SIRCS_STOP_BIT; |
748 | complete_data_len = SIRCS_MINIMUM_DATA_LEN; |
804 | complete_data_len = SIRCS_MINIMUM_DATA_LEN + sircs_additional_bitlen; |
749 | n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame |
805 | n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame |
750 | auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause |
806 | auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause |
751 | repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN; |
807 | repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN; |
752 | irsnd_set_freq (IRSND_FREQ_40_KHZ); |
808 | irsnd_set_freq (IRSND_FREQ_40_KHZ); |
753 | break; |
809 | break; |
Line 758... | Line 814... | ||
758 | { |
814 | { |
759 | startbit_pulse_len = NEC_START_BIT_PULSE_LEN; |
815 | startbit_pulse_len = NEC_START_BIT_PULSE_LEN; |
Line 760... | Line 816... | ||
760 | 816 | ||
761 | if (repeat_counter > 0) |
817 | if (repeat_counter > 0) |
762 | { |
818 | { |
763 | startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN; |
819 | startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN - 1; |
764 | complete_data_len = 0; |
820 | complete_data_len = 0; |
765 | } |
821 | } |
766 | else |
822 | else |
767 | { |
823 | { |
768 | startbit_pause_len = NEC_START_BIT_PAUSE_LEN; |
824 | startbit_pause_len = NEC_START_BIT_PAUSE_LEN - 1; |
769 | complete_data_len = NEC_COMPLETE_DATA_LEN; |
825 | complete_data_len = NEC_COMPLETE_DATA_LEN; |
Line 770... | Line 826... | ||
770 | } |
826 | } |
771 | 827 | ||
772 | pulse_1_len = NEC_PULSE_LEN; |
828 | pulse_1_len = NEC_PULSE_LEN; |
773 | pause_1_len = NEC_1_PAUSE_LEN; |
829 | pause_1_len = NEC_1_PAUSE_LEN - 1; |
774 | pulse_0_len = NEC_PULSE_LEN; |
830 | pulse_0_len = NEC_PULSE_LEN; |
775 | pause_0_len = NEC_0_PAUSE_LEN; |
831 | pause_0_len = NEC_0_PAUSE_LEN - 1; |
776 | has_stop_bit = NEC_STOP_BIT; |
832 | has_stop_bit = NEC_STOP_BIT; |
777 | n_auto_repetitions = 1; // 1 frame |
833 | n_auto_repetitions = 1; // 1 frame |
778 | auto_repetition_pause_len = 0; |
834 | auto_repetition_pause_len = 0; |
Line 783... | Line 839... | ||
783 | #endif |
839 | #endif |
784 | #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 |
840 | #if IRSND_SUPPORT_SAMSUNG_PROTOCOL == 1 |
785 | case IRMP_SAMSUNG_PROTOCOL: |
841 | case IRMP_SAMSUNG_PROTOCOL: |
786 | { |
842 | { |
787 | startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
843 | startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
788 | startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
844 | startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
789 | pulse_1_len = SAMSUNG_PULSE_LEN; |
845 | pulse_1_len = SAMSUNG_PULSE_LEN; |
790 | pause_1_len = SAMSUNG_1_PAUSE_LEN; |
846 | pause_1_len = SAMSUNG_1_PAUSE_LEN - 1; |
791 | pulse_0_len = SAMSUNG_PULSE_LEN; |
847 | pulse_0_len = SAMSUNG_PULSE_LEN; |
792 | pause_0_len = SAMSUNG_0_PAUSE_LEN; |
848 | pause_0_len = SAMSUNG_0_PAUSE_LEN - 1; |
793 | has_stop_bit = SAMSUNG_STOP_BIT; |
849 | has_stop_bit = SAMSUNG_STOP_BIT; |
794 | complete_data_len = SAMSUNG_COMPLETE_DATA_LEN; |
850 | complete_data_len = SAMSUNG_COMPLETE_DATA_LEN; |
795 | n_auto_repetitions = 1; // 1 frame |
851 | n_auto_repetitions = 1; // 1 frame |
796 | auto_repetition_pause_len = 0; |
852 | auto_repetition_pause_len = 0; |
797 | repeat_frame_pause_len = SAMSUNG_FRAME_REPEAT_PAUSE_LEN; |
853 | repeat_frame_pause_len = SAMSUNG_FRAME_REPEAT_PAUSE_LEN; |
Line 800... | Line 856... | ||
800 | } |
856 | } |
Line 801... | Line 857... | ||
801 | 857 | ||
802 | case IRMP_SAMSUNG32_PROTOCOL: |
858 | case IRMP_SAMSUNG32_PROTOCOL: |
803 | { |
859 | { |
804 | startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
860 | startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
805 | startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
861 | startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
806 | pulse_1_len = SAMSUNG_PULSE_LEN; |
862 | pulse_1_len = SAMSUNG_PULSE_LEN; |
807 | pause_1_len = SAMSUNG_1_PAUSE_LEN; |
863 | pause_1_len = SAMSUNG_1_PAUSE_LEN - 1; |
808 | pulse_0_len = SAMSUNG_PULSE_LEN; |
864 | pulse_0_len = SAMSUNG_PULSE_LEN; |
809 | pause_0_len = SAMSUNG_0_PAUSE_LEN; |
865 | pause_0_len = SAMSUNG_0_PAUSE_LEN - 1; |
810 | has_stop_bit = SAMSUNG_STOP_BIT; |
866 | has_stop_bit = SAMSUNG_STOP_BIT; |
811 | complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN; |
867 | complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN; |
812 | n_auto_repetitions = SAMSUNG32_FRAMES; // 2 frames |
868 | n_auto_repetitions = SAMSUNG32_FRAMES; // 2 frames |
813 | auto_repetition_pause_len = SAMSUNG32_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause |
869 | auto_repetition_pause_len = SAMSUNG32_AUTO_REPETITION_PAUSE_LEN; // 47 ms pause |
Line 818... | Line 874... | ||
818 | #endif |
874 | #endif |
819 | #if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 |
875 | #if IRSND_SUPPORT_MATSUSHITA_PROTOCOL == 1 |
820 | case IRMP_MATSUSHITA_PROTOCOL: |
876 | case IRMP_MATSUSHITA_PROTOCOL: |
821 | { |
877 | { |
822 | startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; |
878 | startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; |
823 | startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN; |
879 | startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN - 1; |
824 | pulse_1_len = MATSUSHITA_PULSE_LEN; |
880 | pulse_1_len = MATSUSHITA_PULSE_LEN; |
825 | pause_1_len = MATSUSHITA_1_PAUSE_LEN; |
881 | pause_1_len = MATSUSHITA_1_PAUSE_LEN - 1; |
826 | pulse_0_len = MATSUSHITA_PULSE_LEN; |
882 | pulse_0_len = MATSUSHITA_PULSE_LEN; |
827 | pause_0_len = MATSUSHITA_0_PAUSE_LEN; |
883 | pause_0_len = MATSUSHITA_0_PAUSE_LEN - 1; |
828 | has_stop_bit = MATSUSHITA_STOP_BIT; |
884 | has_stop_bit = MATSUSHITA_STOP_BIT; |
829 | complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN; |
885 | complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN; |
830 | n_auto_repetitions = 1; // 1 frame |
886 | n_auto_repetitions = 1; // 1 frame |
831 | auto_repetition_pause_len = 0; |
887 | auto_repetition_pause_len = 0; |
832 | repeat_frame_pause_len = MATSUSHITA_FRAME_REPEAT_PAUSE_LEN; |
888 | repeat_frame_pause_len = MATSUSHITA_FRAME_REPEAT_PAUSE_LEN; |
Line 836... | Line 892... | ||
836 | #endif |
892 | #endif |
837 | #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 |
893 | #if IRSND_SUPPORT_KASEIKYO_PROTOCOL == 1 |
838 | case IRMP_KASEIKYO_PROTOCOL: |
894 | case IRMP_KASEIKYO_PROTOCOL: |
839 | { |
895 | { |
840 | startbit_pulse_len = KASEIKYO_START_BIT_PULSE_LEN; |
896 | startbit_pulse_len = KASEIKYO_START_BIT_PULSE_LEN; |
841 | startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN; |
897 | startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN - 1; |
842 | pulse_1_len = KASEIKYO_PULSE_LEN; |
898 | pulse_1_len = KASEIKYO_PULSE_LEN; |
843 | pause_1_len = KASEIKYO_1_PAUSE_LEN; |
899 | pause_1_len = KASEIKYO_1_PAUSE_LEN - 1; |
844 | pulse_0_len = KASEIKYO_PULSE_LEN; |
900 | pulse_0_len = KASEIKYO_PULSE_LEN; |
845 | pause_0_len = KASEIKYO_0_PAUSE_LEN; |
901 | pause_0_len = KASEIKYO_0_PAUSE_LEN - 1; |
846 | has_stop_bit = KASEIKYO_STOP_BIT; |
902 | has_stop_bit = KASEIKYO_STOP_BIT; |
847 | complete_data_len = KASEIKYO_COMPLETE_DATA_LEN; |
903 | complete_data_len = KASEIKYO_COMPLETE_DATA_LEN; |
848 | n_auto_repetitions = (repeat_counter == 0) ? KASEIKYO_FRAMES : 1; // 2 frames auto repetition if first frame |
904 | n_auto_repetitions = (repeat_counter == 0) ? KASEIKYO_FRAMES : 1; // 2 frames auto repetition if first frame |
849 | auto_repetition_pause_len = KASEIKYO_AUTO_REPETITION_PAUSE_LEN; // 75 ms pause |
905 | auto_repetition_pause_len = KASEIKYO_AUTO_REPETITION_PAUSE_LEN; // 75 ms pause |
850 | repeat_frame_pause_len = KASEIKYO_FRAME_REPEAT_PAUSE_LEN; |
906 | repeat_frame_pause_len = KASEIKYO_FRAME_REPEAT_PAUSE_LEN; |
Line 854... | Line 910... | ||
854 | #endif |
910 | #endif |
855 | #if IRSND_SUPPORT_RECS80_PROTOCOL == 1 |
911 | #if IRSND_SUPPORT_RECS80_PROTOCOL == 1 |
856 | case IRMP_RECS80_PROTOCOL: |
912 | case IRMP_RECS80_PROTOCOL: |
857 | { |
913 | { |
858 | startbit_pulse_len = RECS80_START_BIT_PULSE_LEN; |
914 | startbit_pulse_len = RECS80_START_BIT_PULSE_LEN; |
859 | startbit_pause_len = RECS80_START_BIT_PAUSE_LEN; |
915 | startbit_pause_len = RECS80_START_BIT_PAUSE_LEN - 1; |
860 | pulse_1_len = RECS80_PULSE_LEN; |
916 | pulse_1_len = RECS80_PULSE_LEN; |
861 | pause_1_len = RECS80_1_PAUSE_LEN; |
917 | pause_1_len = RECS80_1_PAUSE_LEN - 1; |
862 | pulse_0_len = RECS80_PULSE_LEN; |
918 | pulse_0_len = RECS80_PULSE_LEN; |
863 | pause_0_len = RECS80_0_PAUSE_LEN; |
919 | pause_0_len = RECS80_0_PAUSE_LEN - 1; |
864 | has_stop_bit = RECS80_STOP_BIT; |
920 | has_stop_bit = RECS80_STOP_BIT; |
865 | complete_data_len = RECS80_COMPLETE_DATA_LEN; |
921 | complete_data_len = RECS80_COMPLETE_DATA_LEN; |
866 | n_auto_repetitions = 1; // 1 frame |
922 | n_auto_repetitions = 1; // 1 frame |
867 | auto_repetition_pause_len = 0; |
923 | auto_repetition_pause_len = 0; |
868 | repeat_frame_pause_len = RECS80_FRAME_REPEAT_PAUSE_LEN; |
924 | repeat_frame_pause_len = RECS80_FRAME_REPEAT_PAUSE_LEN; |
Line 872... | Line 928... | ||
872 | #endif |
928 | #endif |
873 | #if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 |
929 | #if IRSND_SUPPORT_RECS80EXT_PROTOCOL == 1 |
874 | case IRMP_RECS80EXT_PROTOCOL: |
930 | case IRMP_RECS80EXT_PROTOCOL: |
875 | { |
931 | { |
876 | startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN; |
932 | startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN; |
877 | startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN; |
933 | startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN - 1; |
878 | pulse_1_len = RECS80EXT_PULSE_LEN; |
934 | pulse_1_len = RECS80EXT_PULSE_LEN; |
879 | pause_1_len = RECS80EXT_1_PAUSE_LEN; |
935 | pause_1_len = RECS80EXT_1_PAUSE_LEN - 1; |
880 | pulse_0_len = RECS80EXT_PULSE_LEN; |
936 | pulse_0_len = RECS80EXT_PULSE_LEN; |
881 | pause_0_len = RECS80EXT_0_PAUSE_LEN; |
937 | pause_0_len = RECS80EXT_0_PAUSE_LEN - 1; |
882 | has_stop_bit = RECS80EXT_STOP_BIT; |
938 | has_stop_bit = RECS80EXT_STOP_BIT; |
883 | complete_data_len = RECS80EXT_COMPLETE_DATA_LEN; |
939 | complete_data_len = RECS80EXT_COMPLETE_DATA_LEN; |
884 | n_auto_repetitions = 1; // 1 frame |
940 | n_auto_repetitions = 1; // 1 frame |
885 | auto_repetition_pause_len = 0; |
941 | auto_repetition_pause_len = 0; |
886 | repeat_frame_pause_len = RECS80EXT_FRAME_REPEAT_PAUSE_LEN; |
942 | repeat_frame_pause_len = RECS80EXT_FRAME_REPEAT_PAUSE_LEN; |
Line 902... | Line 958... | ||
902 | repeat_frame_pause_len = RC5_FRAME_REPEAT_PAUSE_LEN; |
958 | repeat_frame_pause_len = RC5_FRAME_REPEAT_PAUSE_LEN; |
903 | irsnd_set_freq (IRSND_FREQ_36_KHZ); |
959 | irsnd_set_freq (IRSND_FREQ_36_KHZ); |
904 | break; |
960 | break; |
905 | } |
961 | } |
906 | #endif |
962 | #endif |
- | 963 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
|
- | 964 | case IRMP_RC6_PROTOCOL: |
|
- | 965 | { |
|
- | 966 | startbit_pulse_len = RC6_START_BIT_PULSE_LEN; |
|
- | 967 | startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1; |
|
- | 968 | pulse_len = RC6_BIT_LEN; |
|
- | 969 | pause_len = RC6_BIT_LEN; |
|
- | 970 | has_stop_bit = RC6_STOP_BIT; |
|
- | 971 | complete_data_len = RC6_COMPLETE_DATA_LEN_SHORT; |
|
- | 972 | n_auto_repetitions = 1; // 1 frame |
|
- | 973 | auto_repetition_pause_len = 0; |
|
- | 974 | repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN; |
|
- | 975 | irsnd_set_freq (IRSND_FREQ_36_KHZ); |
|
- | 976 | break; |
|
- | 977 | } |
|
- | 978 | #endif |
|
- | 979 | #if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 980 | case IRMP_RC6A_PROTOCOL: |
|
- | 981 | { |
|
- | 982 | startbit_pulse_len = RC6_START_BIT_PULSE_LEN; |
|
- | 983 | startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1; |
|
- | 984 | pulse_len = RC6_BIT_LEN; |
|
- | 985 | pause_len = RC6_BIT_LEN; |
|
- | 986 | has_stop_bit = RC6_STOP_BIT; |
|
- | 987 | complete_data_len = RC6_COMPLETE_DATA_LEN_LONG; |
|
- | 988 | n_auto_repetitions = 1; // 1 frame |
|
- | 989 | auto_repetition_pause_len = 0; |
|
- | 990 | repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN; |
|
- | 991 | irsnd_set_freq (IRSND_FREQ_36_KHZ); |
|
- | 992 | break; |
|
- | 993 | } |
|
- | 994 | #endif |
|
907 | #if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
995 | #if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
908 | case IRMP_DENON_PROTOCOL: |
996 | case IRMP_DENON_PROTOCOL: |
909 | { |
997 | { |
910 | startbit_pulse_len = 0x00; |
998 | startbit_pulse_len = 0x00; |
911 | startbit_pause_len = 0x00; |
999 | startbit_pause_len = 0x00; |
912 | pulse_1_len = DENON_PULSE_LEN; |
1000 | pulse_1_len = DENON_PULSE_LEN; |
913 | pause_1_len = DENON_1_PAUSE_LEN; |
1001 | pause_1_len = DENON_1_PAUSE_LEN - 1; |
914 | pulse_0_len = DENON_PULSE_LEN; |
1002 | pulse_0_len = DENON_PULSE_LEN; |
915 | pause_0_len = DENON_0_PAUSE_LEN; |
1003 | pause_0_len = DENON_0_PAUSE_LEN - 1; |
916 | has_stop_bit = DENON_STOP_BIT; |
1004 | has_stop_bit = DENON_STOP_BIT; |
917 | complete_data_len = DENON_COMPLETE_DATA_LEN; |
1005 | complete_data_len = DENON_COMPLETE_DATA_LEN; |
918 | n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command |
1006 | n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command |
919 | auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame |
1007 | auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame |
920 | repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN; |
1008 | repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN; |
921 | irsnd_set_freq (IRSND_FREQ_32_KHZ); |
1009 | irsnd_set_freq (IRSND_FREQ_38_KHZ); // in theory 32kHz, in practice 38kHz |
922 | break; |
1010 | break; |
923 | } |
1011 | } |
924 | #endif |
1012 | #endif |
925 | #if IRSND_SUPPORT_NUBERT_PROTOCOL == 1 |
1013 | #if IRSND_SUPPORT_NUBERT_PROTOCOL == 1 |
926 | case IRMP_NUBERT_PROTOCOL: |
1014 | case IRMP_NUBERT_PROTOCOL: |
927 | { |
1015 | { |
928 | startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN; |
1016 | startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN; |
929 | startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN; |
1017 | startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN - 1; |
930 | pulse_1_len = NUBERT_1_PULSE_LEN; |
1018 | pulse_1_len = NUBERT_1_PULSE_LEN; |
931 | pause_1_len = NUBERT_1_PAUSE_LEN; |
1019 | pause_1_len = NUBERT_1_PAUSE_LEN - 1; |
932 | pulse_0_len = NUBERT_0_PULSE_LEN; |
1020 | pulse_0_len = NUBERT_0_PULSE_LEN; |
933 | pause_0_len = NUBERT_0_PAUSE_LEN; |
1021 | pause_0_len = NUBERT_0_PAUSE_LEN - 1; |
934 | has_stop_bit = NUBERT_STOP_BIT; |
1022 | has_stop_bit = NUBERT_STOP_BIT; |
935 | complete_data_len = NUBERT_COMPLETE_DATA_LEN; |
1023 | complete_data_len = NUBERT_COMPLETE_DATA_LEN; |
936 | n_auto_repetitions = NUBERT_FRAMES; // 2 frames |
1024 | n_auto_repetitions = NUBERT_FRAMES; // 2 frames |
937 | auto_repetition_pause_len = NUBERT_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause |
1025 | auto_repetition_pause_len = NUBERT_AUTO_REPETITION_PAUSE_LEN; // 35 ms pause |
938 | repeat_frame_pause_len = NUBERT_FRAME_REPEAT_PAUSE_LEN; |
1026 | repeat_frame_pause_len = NUBERT_FRAME_REPEAT_PAUSE_LEN; |
Line 942... | Line 1030... | ||
942 | #endif |
1030 | #endif |
943 | #if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 |
1031 | #if IRSND_SUPPORT_BANG_OLUFSEN_PROTOCOL == 1 |
944 | case IRMP_BANG_OLUFSEN_PROTOCOL: |
1032 | case IRMP_BANG_OLUFSEN_PROTOCOL: |
945 | { |
1033 | { |
946 | startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN; |
1034 | startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN; |
947 | startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN; |
1035 | startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN - 1; |
948 | pulse_1_len = BANG_OLUFSEN_PULSE_LEN; |
1036 | pulse_1_len = BANG_OLUFSEN_PULSE_LEN; |
949 | pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN; |
1037 | pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN - 1; |
950 | pulse_0_len = BANG_OLUFSEN_PULSE_LEN; |
1038 | pulse_0_len = BANG_OLUFSEN_PULSE_LEN; |
951 | pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN; |
1039 | pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN - 1; |
952 | has_stop_bit = BANG_OLUFSEN_STOP_BIT; |
1040 | has_stop_bit = BANG_OLUFSEN_STOP_BIT; |
953 | complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN; |
1041 | complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN; |
954 | n_auto_repetitions = 1; // 1 frame |
1042 | n_auto_repetitions = 1; // 1 frame |
955 | auto_repetition_pause_len = 0; |
1043 | auto_repetition_pause_len = 0; |
956 | repeat_frame_pause_len = BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN; |
1044 | repeat_frame_pause_len = BANG_OLUFSEN_FRAME_REPEAT_PAUSE_LEN; |
Line 961... | Line 1049... | ||
961 | #endif |
1049 | #endif |
962 | #if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 |
1050 | #if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 |
963 | case IRMP_GRUNDIG_PROTOCOL: |
1051 | case IRMP_GRUNDIG_PROTOCOL: |
964 | { |
1052 | { |
965 | startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1053 | startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
966 | startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; |
1054 | startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1; |
967 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1055 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
968 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1056 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
969 | has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
1057 | has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
970 | complete_data_len = GRUNDIG_COMPLETE_DATA_LEN; |
1058 | complete_data_len = GRUNDIG_COMPLETE_DATA_LEN; |
971 | n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames |
1059 | n_auto_repetitions = GRUNDIG_FRAMES; // 2 frames |
Line 978... | Line 1066... | ||
978 | #endif |
1066 | #endif |
979 | #if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1067 | #if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
980 | case IRMP_NOKIA_PROTOCOL: |
1068 | case IRMP_NOKIA_PROTOCOL: |
981 | { |
1069 | { |
982 | startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1070 | startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
983 | startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; |
1071 | startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1; |
984 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1072 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
985 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1073 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
986 | has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
1074 | has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
987 | complete_data_len = NOKIA_COMPLETE_DATA_LEN; |
1075 | complete_data_len = NOKIA_COMPLETE_DATA_LEN; |
988 | n_auto_repetitions = NOKIA_FRAMES; // 2 frames |
1076 | n_auto_repetitions = NOKIA_FRAMES; // 2 frames |
Line 1010... | Line 1098... | ||
1010 | #endif |
1098 | #endif |
1011 | #if IRSND_SUPPORT_FDC_PROTOCOL == 1 |
1099 | #if IRSND_SUPPORT_FDC_PROTOCOL == 1 |
1012 | case IRMP_FDC_PROTOCOL: |
1100 | case IRMP_FDC_PROTOCOL: |
1013 | { |
1101 | { |
1014 | startbit_pulse_len = FDC_START_BIT_PULSE_LEN; |
1102 | startbit_pulse_len = FDC_START_BIT_PULSE_LEN; |
1015 | startbit_pause_len = FDC_START_BIT_PAUSE_LEN; |
1103 | startbit_pause_len = FDC_START_BIT_PAUSE_LEN - 1; |
1016 | complete_data_len = FDC_COMPLETE_DATA_LEN; |
1104 | complete_data_len = FDC_COMPLETE_DATA_LEN; |
1017 | pulse_1_len = FDC_PULSE_LEN; |
1105 | pulse_1_len = FDC_PULSE_LEN; |
1018 | pause_1_len = FDC_1_PAUSE_LEN; |
1106 | pause_1_len = FDC_1_PAUSE_LEN - 1; |
1019 | pulse_0_len = FDC_PULSE_LEN; |
1107 | pulse_0_len = FDC_PULSE_LEN; |
1020 | pause_0_len = FDC_0_PAUSE_LEN; |
1108 | pause_0_len = FDC_0_PAUSE_LEN - 1; |
1021 | has_stop_bit = FDC_STOP_BIT; |
1109 | has_stop_bit = FDC_STOP_BIT; |
1022 | n_auto_repetitions = 1; // 1 frame |
1110 | n_auto_repetitions = 1; // 1 frame |
1023 | auto_repetition_pause_len = 0; |
1111 | auto_repetition_pause_len = 0; |
1024 | repeat_frame_pause_len = FDC_FRAME_REPEAT_PAUSE_LEN; |
1112 | repeat_frame_pause_len = FDC_FRAME_REPEAT_PAUSE_LEN; |
1025 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
1113 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
Line 1028... | Line 1116... | ||
1028 | #endif |
1116 | #endif |
1029 | #if IRSND_SUPPORT_RCCAR_PROTOCOL == 1 |
1117 | #if IRSND_SUPPORT_RCCAR_PROTOCOL == 1 |
1030 | case IRMP_RCCAR_PROTOCOL: |
1118 | case IRMP_RCCAR_PROTOCOL: |
1031 | { |
1119 | { |
1032 | startbit_pulse_len = RCCAR_START_BIT_PULSE_LEN; |
1120 | startbit_pulse_len = RCCAR_START_BIT_PULSE_LEN; |
1033 | startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN; |
1121 | startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN - 1; |
1034 | complete_data_len = RCCAR_COMPLETE_DATA_LEN; |
1122 | complete_data_len = RCCAR_COMPLETE_DATA_LEN; |
1035 | pulse_1_len = RCCAR_PULSE_LEN; |
1123 | pulse_1_len = RCCAR_PULSE_LEN; |
1036 | pause_1_len = RCCAR_1_PAUSE_LEN; |
1124 | pause_1_len = RCCAR_1_PAUSE_LEN - 1; |
1037 | pulse_0_len = RCCAR_PULSE_LEN; |
1125 | pulse_0_len = RCCAR_PULSE_LEN; |
1038 | pause_0_len = RCCAR_0_PAUSE_LEN; |
1126 | pause_0_len = RCCAR_0_PAUSE_LEN - 1; |
1039 | has_stop_bit = RCCAR_STOP_BIT; |
1127 | has_stop_bit = RCCAR_STOP_BIT; |
1040 | n_auto_repetitions = 1; // 1 frame |
1128 | n_auto_repetitions = 1; // 1 frame |
1041 | auto_repetition_pause_len = 0; |
1129 | auto_repetition_pause_len = 0; |
1042 | repeat_frame_pause_len = RCCAR_FRAME_REPEAT_PAUSE_LEN; |
1130 | repeat_frame_pause_len = RCCAR_FRAME_REPEAT_PAUSE_LEN; |
1043 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
1131 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
Line 1051... | Line 1139... | ||
1051 | { |
1139 | { |
1052 | current_bit = 0; |
1140 | current_bit = 0; |
1053 | } |
1141 | } |
Line 1054... | Line 1142... | ||
1054 | 1142 | ||
1055 | startbit_pulse_len = JVC_START_BIT_PULSE_LEN; |
1143 | startbit_pulse_len = JVC_START_BIT_PULSE_LEN; |
1056 | startbit_pause_len = JVC_START_BIT_PAUSE_LEN; |
1144 | startbit_pause_len = JVC_START_BIT_PAUSE_LEN - 1; |
1057 | complete_data_len = JVC_COMPLETE_DATA_LEN; |
1145 | complete_data_len = JVC_COMPLETE_DATA_LEN; |
1058 | pulse_1_len = JVC_PULSE_LEN; |
1146 | pulse_1_len = JVC_PULSE_LEN; |
1059 | pause_1_len = JVC_1_PAUSE_LEN; |
1147 | pause_1_len = JVC_1_PAUSE_LEN - 1; |
1060 | pulse_0_len = JVC_PULSE_LEN; |
1148 | pulse_0_len = JVC_PULSE_LEN; |
1061 | pause_0_len = JVC_0_PAUSE_LEN; |
1149 | pause_0_len = JVC_0_PAUSE_LEN - 1; |
1062 | has_stop_bit = JVC_STOP_BIT; |
1150 | has_stop_bit = JVC_STOP_BIT; |
1063 | n_auto_repetitions = 1; // 1 frame |
1151 | n_auto_repetitions = 1; // 1 frame |
1064 | auto_repetition_pause_len = 0; |
1152 | auto_repetition_pause_len = 0; |
1065 | repeat_frame_pause_len = JVC_FRAME_REPEAT_PAUSE_LEN; |
1153 | repeat_frame_pause_len = JVC_FRAME_REPEAT_PAUSE_LEN; |
Line 1070... | Line 1158... | ||
1070 | #endif |
1158 | #endif |
1071 | #if IRSND_SUPPORT_NIKON_PROTOCOL == 1 |
1159 | #if IRSND_SUPPORT_NIKON_PROTOCOL == 1 |
1072 | case IRMP_NIKON_PROTOCOL: |
1160 | case IRMP_NIKON_PROTOCOL: |
1073 | { |
1161 | { |
1074 | startbit_pulse_len = NIKON_START_BIT_PULSE_LEN; |
1162 | startbit_pulse_len = NIKON_START_BIT_PULSE_LEN; |
1075 | startbit_pause_len = 271; // NIKON_START_BIT_PAUSE_LEN; |
1163 | startbit_pause_len = 271 - 1; // NIKON_START_BIT_PAUSE_LEN; |
1076 | complete_data_len = NIKON_COMPLETE_DATA_LEN; |
1164 | complete_data_len = NIKON_COMPLETE_DATA_LEN; |
1077 | pulse_1_len = NIKON_PULSE_LEN; |
1165 | pulse_1_len = NIKON_PULSE_LEN; |
1078 | pause_1_len = NIKON_1_PAUSE_LEN; |
1166 | pause_1_len = NIKON_1_PAUSE_LEN - 1; |
1079 | pulse_0_len = NIKON_PULSE_LEN; |
1167 | pulse_0_len = NIKON_PULSE_LEN; |
1080 | pause_0_len = NIKON_0_PAUSE_LEN; |
1168 | pause_0_len = NIKON_0_PAUSE_LEN - 1; |
1081 | has_stop_bit = NIKON_STOP_BIT; |
1169 | has_stop_bit = NIKON_STOP_BIT; |
1082 | n_auto_repetitions = 1; // 1 frame |
1170 | n_auto_repetitions = 1; // 1 frame |
1083 | auto_repetition_pause_len = 0; |
1171 | auto_repetition_pause_len = 0; |
1084 | repeat_frame_pause_len = NIKON_FRAME_REPEAT_PAUSE_LEN; |
1172 | repeat_frame_pause_len = NIKON_FRAME_REPEAT_PAUSE_LEN; |
1085 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
1173 | irsnd_set_freq (IRSND_FREQ_38_KHZ); |
Line 1166... | Line 1254... | ||
1166 | { |
1254 | { |
1167 | if (current_bit < SAMSUNG_ADDRESS_LEN) // send address bits |
1255 | if (current_bit < SAMSUNG_ADDRESS_LEN) // send address bits |
1168 | { |
1256 | { |
1169 | pulse_len = SAMSUNG_PULSE_LEN; |
1257 | pulse_len = SAMSUNG_PULSE_LEN; |
1170 | pause_len = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? |
1258 | pause_len = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? |
1171 | SAMSUNG_1_PAUSE_LEN : SAMSUNG_0_PAUSE_LEN; |
1259 | (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1); |
1172 | } |
1260 | } |
1173 | else if (current_bit == SAMSUNG_ADDRESS_LEN) // send SYNC bit (16th bit) |
1261 | else if (current_bit == SAMSUNG_ADDRESS_LEN) // send SYNC bit (16th bit) |
1174 | { |
1262 | { |
1175 | pulse_len = SAMSUNG_PULSE_LEN; |
1263 | pulse_len = SAMSUNG_PULSE_LEN; |
1176 | pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
1264 | pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
1177 | } |
1265 | } |
1178 | else if (current_bit < SAMSUNG_COMPLETE_DATA_LEN) // send n'th bit |
1266 | else if (current_bit < SAMSUNG_COMPLETE_DATA_LEN) // send n'th bit |
1179 | { |
1267 | { |
1180 | uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 ! |
1268 | uint8_t cur_bit = current_bit - 1; // sync skipped, offset = -1 ! |
Line 1181... | Line 1269... | ||
1181 | 1269 | ||
1182 | pulse_len = SAMSUNG_PULSE_LEN; |
1270 | pulse_len = SAMSUNG_PULSE_LEN; |
1183 | pause_len = (irsnd_buffer[cur_bit / 8] & (1<<(7-(cur_bit % 8)))) ? |
1271 | pause_len = (irsnd_buffer[cur_bit / 8] & (1<<(7-(cur_bit % 8)))) ? |
1184 | SAMSUNG_1_PAUSE_LEN : SAMSUNG_0_PAUSE_LEN; |
1272 | (SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1); |
1185 | } |
1273 | } |
1186 | } |
1274 | } |
1187 | else |
1275 | else |
Line 1191... | Line 1279... | ||
1191 | if (irsnd_protocol == IRMP_BANG_OLUFSEN_PROTOCOL) |
1279 | if (irsnd_protocol == IRMP_BANG_OLUFSEN_PROTOCOL) |
1192 | { |
1280 | { |
1193 | if (current_bit == 0) // send 2nd start bit |
1281 | if (current_bit == 0) // send 2nd start bit |
1194 | { |
1282 | { |
1195 | pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
1283 | pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
1196 | pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN; |
1284 | pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1; |
1197 | } |
1285 | } |
1198 | else if (current_bit == 1) // send 3rd start bit |
1286 | else if (current_bit == 1) // send 3rd start bit |
1199 | { |
1287 | { |
1200 | pulse_len = BANG_OLUFSEN_START_BIT3_PULSE_LEN; |
1288 | pulse_len = BANG_OLUFSEN_START_BIT3_PULSE_LEN; |
1201 | pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN; |
1289 | pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN - 1; |
1202 | } |
1290 | } |
1203 | else if (current_bit == 2) // send 4th start bit |
1291 | else if (current_bit == 2) // send 4th start bit |
1204 | { |
1292 | { |
1205 | pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
1293 | pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
1206 | pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN; |
1294 | pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1; |
1207 | } |
1295 | } |
1208 | else if (current_bit == 19) // send trailer bit |
1296 | else if (current_bit == 19) // send trailer bit |
1209 | { |
1297 | { |
1210 | pulse_len = BANG_OLUFSEN_PULSE_LEN; |
1298 | pulse_len = BANG_OLUFSEN_PULSE_LEN; |
1211 | pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN; |
1299 | pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN - 1; |
1212 | } |
1300 | } |
1213 | else if (current_bit < BANG_OLUFSEN_COMPLETE_DATA_LEN) // send n'th bit |
1301 | else if (current_bit < BANG_OLUFSEN_COMPLETE_DATA_LEN) // send n'th bit |
1214 | { |
1302 | { |
1215 | uint8_t cur_bit_value = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? 1 : 0; |
1303 | uint8_t cur_bit_value = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? 1 : 0; |
1216 | pulse_len = BANG_OLUFSEN_PULSE_LEN; |
1304 | pulse_len = BANG_OLUFSEN_PULSE_LEN; |
Line 1217... | Line 1305... | ||
1217 | 1305 | ||
1218 | if (cur_bit_value == last_bit_value) |
1306 | if (cur_bit_value == last_bit_value) |
1219 | { |
1307 | { |
1220 | pause_len = BANG_OLUFSEN_R_PAUSE_LEN; |
1308 | pause_len = BANG_OLUFSEN_R_PAUSE_LEN - 1; |
1221 | } |
1309 | } |
1222 | else |
1310 | else |
1223 | { |
1311 | { |
1224 | pause_len = cur_bit_value ? BANG_OLUFSEN_1_PAUSE_LEN : BANG_OLUFSEN_0_PAUSE_LEN; |
1312 | pause_len = cur_bit_value ? (BANG_OLUFSEN_1_PAUSE_LEN - 1) : (BANG_OLUFSEN_0_PAUSE_LEN - 1); |
1225 | last_bit_value = cur_bit_value; |
1313 | last_bit_value = cur_bit_value; |
1226 | } |
1314 | } |
1227 | } |
1315 | } |
1228 | } |
1316 | } |
Line 1295... | Line 1383... | ||
1295 | #endif |
1383 | #endif |
Line 1296... | Line 1384... | ||
1296 | 1384 | ||
1297 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
1385 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
1298 | case IRMP_RC5_PROTOCOL: |
1386 | case IRMP_RC5_PROTOCOL: |
- | 1387 | #endif |
|
- | 1388 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
|
- | 1389 | case IRMP_RC6_PROTOCOL: |
|
- | 1390 | #endif |
|
- | 1391 | #if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 1392 | case IRMP_RC6A_PROTOCOL: |
|
1299 | #endif |
1393 | #endif |
1300 | #if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 |
1394 | #if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 |
1301 | case IRMP_SIEMENS_PROTOCOL: |
1395 | case IRMP_SIEMENS_PROTOCOL: |
1302 | #endif |
1396 | #endif |
1303 | #if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 |
1397 | #if IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 |
1304 | case IRMP_GRUNDIG_PROTOCOL: |
1398 | case IRMP_GRUNDIG_PROTOCOL: |
1305 | #endif |
1399 | #endif |
1306 | #if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1400 | #if IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1307 | case IRMP_NOKIA_PROTOCOL: |
1401 | case IRMP_NOKIA_PROTOCOL: |
Line 1308... | Line 1402... | ||
1308 | #endif |
1402 | #endif |
- | 1403 | ||
1309 | 1404 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || \ |
|
1310 | #if IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1405 | IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1311 | { |
1406 | { |
1312 | if (pulse_counter == pulse_len && pause_counter == pause_len) |
1407 | if (pulse_counter == pulse_len && pause_counter == pause_len) |
Line 1372... | Line 1467... | ||
1372 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1467 | pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1373 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1468 | pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
1374 | first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
1469 | first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
1375 | } |
1470 | } |
1376 | } |
1471 | } |
1377 | else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_SIEMENS_PROTOCOL) |
1472 | else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL || |
- | 1473 | // irsnd_protocol == IRMP_SIEMENS_PROTOCOL) |
|
1378 | #endif |
1474 | #endif |
1379 | { |
1475 | { |
1380 | if (current_bit == 0xFF) // 1 start bit |
1476 | if (current_bit == 0xFF) // 1 start bit |
1381 | { |
1477 | { |
- | 1478 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 1479 | if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL) |
|
- | 1480 | { |
|
- | 1481 | pulse_len = startbit_pulse_len; |
|
- | 1482 | pause_len = startbit_pause_len; |
|
- | 1483 | } |
|
- | 1484 | #endif |
|
1382 | first_pulse = TRUE; |
1485 | first_pulse = TRUE; |
1383 | } |
1486 | } |
1384 | else // send n'th bit |
1487 | else // send n'th bit |
1385 | { |
1488 | { |
- | 1489 | #if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
|
- | 1490 | if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL) |
|
- | 1491 | { |
|
- | 1492 | pulse_len = RC6_BIT_LEN; |
|
- | 1493 | pause_len = RC6_BIT_LEN; |
|
- | 1494 | ||
- | 1495 | if (irsnd_protocol == IRMP_RC6_PROTOCOL) |
|
- | 1496 | { |
|
- | 1497 | if (current_bit == 4) // toggle bit (double len) |
|
- | 1498 | { |
|
- | 1499 | pulse_len = 2 * RC6_BIT_LEN; |
|
- | 1500 | pause_len = 2 * RC6_BIT_LEN; |
|
- | 1501 | } |
|
- | 1502 | } |
|
- | 1503 | else // if (irsnd_protocol == IRMP_RC6A_PROTOCOL) |
|
- | 1504 | { |
|
- | 1505 | if (current_bit == 4) // toggle bit (double len) |
|
- | 1506 | { |
|
- | 1507 | pulse_len = 2 * RC6_BIT_LEN + RC6_BIT_LEN; // hack! |
|
- | 1508 | pause_len = 2 * RC6_BIT_LEN; |
|
- | 1509 | } |
|
- | 1510 | else if (current_bit == 5) // toggle bit (double len) |
|
- | 1511 | { |
|
- | 1512 | pause_len = 2 * RC6_BIT_LEN; |
|
- | 1513 | } |
|
- | 1514 | } |
|
- | 1515 | } |
|
- | 1516 | #endif |
|
1386 | first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
1517 | first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
1387 | } |
1518 | } |
Line 1388... | Line 1519... | ||
1388 | 1519 | ||
1389 | if (irsnd_protocol == IRMP_RC5_PROTOCOL) |
1520 | if (irsnd_protocol == IRMP_RC5_PROTOCOL) |
Line 1431... | Line 1562... | ||
1431 | } |
1562 | } |
1432 | } |
1563 | } |
1433 | } |
1564 | } |
1434 | break; |
1565 | break; |
1435 | } |
1566 | } |
1436 | #endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
1567 | #endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_RC6_PROTOCOL == 1 || || IRSND_SUPPORT_RC6A_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || |
- | 1568 | // IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
|
Line 1437... | Line 1569... | ||
1437 | 1569 | ||
1438 | default: |
1570 | default: |
1439 | { |
1571 | { |
1440 | irsnd_busy = FALSE; |
1572 | irsnd_busy = FALSE; |