3,7 → 3,7 |
* |
* Copyright (c) 2010 Frank Meyer - frank(at)fli4l.de |
* |
* $Id: irsnd.c,v 1.26 2010/11/09 21:14:31 fm Exp $ |
* $Id: irsnd.c,v 1.29 2011/01/18 13:02:15 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 |
315,6 → 315,10 |
} |
|
|
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
static uint8_t sircs_additional_bitlen; |
#endif // IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
|
uint8_t |
irsnd_send_data (IRMP_DATA * irmp_data_p, uint8_t do_wait) |
{ |
327,6 → 331,9 |
#if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
static uint8_t toggle_bit_rc5; |
#endif |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
static uint8_t toggle_bit_rc6; |
#endif |
uint16_t address; |
uint16_t command; |
|
350,10 → 357,33 |
#if IRSND_SUPPORT_SIRCS_PROTOCOL == 1 |
case IRMP_SIRCS_PROTOCOL: |
{ |
command = bitsrevervse (irmp_data_p->command, SIRCS_MINIMUM_DATA_LEN); |
uint8_t sircs_additional_command_len; |
uint8_t sircs_additional_address_len; |
|
irsnd_buffer[0] = (command & 0x0FF0) >> 4; // CCCCCCCC |
irsnd_buffer[1] = (command & 0x000F) << 4; // CCCC0000 |
sircs_additional_bitlen = (irmp_data_p->address & 0xFF00) >> 8; // additional bitlen |
|
if (sircs_additional_bitlen > 15 - SIRCS_MINIMUM_DATA_LEN) |
{ |
sircs_additional_command_len = 15 - SIRCS_MINIMUM_DATA_LEN; |
sircs_additional_address_len = sircs_additional_bitlen - (15 - SIRCS_MINIMUM_DATA_LEN); |
} |
else |
{ |
sircs_additional_command_len = sircs_additional_bitlen; |
sircs_additional_address_len = 0; |
} |
|
command = bitsrevervse (irmp_data_p->command, 15); |
|
irsnd_buffer[0] = (command & 0x7F80) >> 7; // CCCCCCCC |
irsnd_buffer[1] = (command & 0x007F) << 1; // CCCC**** |
|
if (sircs_additional_address_len > 0) |
{ |
address = bitsrevervse (irmp_data_p->address, 5); |
irsnd_buffer[1] |= (address & 0x0010) >> 4; |
irsnd_buffer[2] = (address & 0x000F) << 4; |
} |
irsnd_busy = TRUE; |
break; |
} |
495,6 → 525,32 |
break; |
} |
#endif |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
case IRMP_RC6_PROTOCOL: |
{ |
toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08; |
|
irsnd_buffer[0] = 0x80 | toggle_bit_rc6 | ((irmp_data_p->address & 0x00E0) >> 5); // 1MMMTAAA, MMM = 000 |
irsnd_buffer[1] = ((irmp_data_p->address & 0x001F) << 3) | ((irmp_data_p->command & 0xE0) >> 5); // AAAAACCC |
irsnd_buffer[2] = (irmp_data_p->command & 0x1F) << 3; // CCCCC |
irsnd_busy = TRUE; |
break; |
} |
#endif |
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
case IRMP_RC6A_PROTOCOL: |
{ |
toggle_bit_rc6 = toggle_bit_rc6 ? 0x00 : 0x08; |
|
irsnd_buffer[0] = 0x80 | 0x60 | ((irmp_data_p->address & 0x3000) >> 12); // 1MMMT0AA, MMM = 110 |
irsnd_buffer[1] = ((irmp_data_p->address & 0x0FFF) >> 4) ; // AAAAAAAA |
irsnd_buffer[2] = ((irmp_data_p->address & 0x000F) << 4) | ((irmp_data_p->command & 0xF000) >> 12) | toggle_bit_rc6; // AAAACCCC |
irsnd_buffer[3] = (irmp_data_p->command & 0x0FF0) >> 4; // CCCCCCCC |
irsnd_buffer[4] = (irmp_data_p->command & 0x000F) << 4; // CCCC |
irsnd_busy = TRUE; |
break; |
} |
#endif |
#if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
case IRMP_DENON_PROTOCOL: |
{ |
739,13 → 795,13 |
case IRMP_SIRCS_PROTOCOL: |
{ |
startbit_pulse_len = SIRCS_START_BIT_PULSE_LEN; |
startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN; |
startbit_pause_len = SIRCS_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = SIRCS_1_PULSE_LEN; |
pause_1_len = SIRCS_PAUSE_LEN; |
pause_1_len = SIRCS_PAUSE_LEN - 1; |
pulse_0_len = SIRCS_0_PULSE_LEN; |
pause_0_len = SIRCS_PAUSE_LEN; |
pause_0_len = SIRCS_PAUSE_LEN - 1; |
has_stop_bit = SIRCS_STOP_BIT; |
complete_data_len = SIRCS_MINIMUM_DATA_LEN; |
complete_data_len = SIRCS_MINIMUM_DATA_LEN + sircs_additional_bitlen; |
n_auto_repetitions = (repeat_counter == 0) ? SIRCS_FRAMES : 1; // 3 frames auto repetition if first frame |
auto_repetition_pause_len = SIRCS_AUTO_REPETITION_PAUSE_LEN; // 25ms pause |
repeat_frame_pause_len = SIRCS_FRAME_REPEAT_PAUSE_LEN; |
760,19 → 816,19 |
|
if (repeat_counter > 0) |
{ |
startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN; |
startbit_pause_len = NEC_REPEAT_START_BIT_PAUSE_LEN - 1; |
complete_data_len = 0; |
} |
else |
{ |
startbit_pause_len = NEC_START_BIT_PAUSE_LEN; |
startbit_pause_len = NEC_START_BIT_PAUSE_LEN - 1; |
complete_data_len = NEC_COMPLETE_DATA_LEN; |
} |
|
pulse_1_len = NEC_PULSE_LEN; |
pause_1_len = NEC_1_PAUSE_LEN; |
pause_1_len = NEC_1_PAUSE_LEN - 1; |
pulse_0_len = NEC_PULSE_LEN; |
pause_0_len = NEC_0_PAUSE_LEN; |
pause_0_len = NEC_0_PAUSE_LEN - 1; |
has_stop_bit = NEC_STOP_BIT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
785,11 → 841,11 |
case IRMP_SAMSUNG_PROTOCOL: |
{ |
startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = SAMSUNG_PULSE_LEN; |
pause_1_len = SAMSUNG_1_PAUSE_LEN; |
pause_1_len = SAMSUNG_1_PAUSE_LEN - 1; |
pulse_0_len = SAMSUNG_PULSE_LEN; |
pause_0_len = SAMSUNG_0_PAUSE_LEN; |
pause_0_len = SAMSUNG_0_PAUSE_LEN - 1; |
has_stop_bit = SAMSUNG_STOP_BIT; |
complete_data_len = SAMSUNG_COMPLETE_DATA_LEN; |
n_auto_repetitions = 1; // 1 frame |
802,11 → 858,11 |
case IRMP_SAMSUNG32_PROTOCOL: |
{ |
startbit_pulse_len = SAMSUNG_START_BIT_PULSE_LEN; |
startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
startbit_pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = SAMSUNG_PULSE_LEN; |
pause_1_len = SAMSUNG_1_PAUSE_LEN; |
pause_1_len = SAMSUNG_1_PAUSE_LEN - 1; |
pulse_0_len = SAMSUNG_PULSE_LEN; |
pause_0_len = SAMSUNG_0_PAUSE_LEN; |
pause_0_len = SAMSUNG_0_PAUSE_LEN - 1; |
has_stop_bit = SAMSUNG_STOP_BIT; |
complete_data_len = SAMSUNG32_COMPLETE_DATA_LEN; |
n_auto_repetitions = SAMSUNG32_FRAMES; // 2 frames |
820,11 → 876,11 |
case IRMP_MATSUSHITA_PROTOCOL: |
{ |
startbit_pulse_len = MATSUSHITA_START_BIT_PULSE_LEN; |
startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN; |
startbit_pause_len = MATSUSHITA_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = MATSUSHITA_PULSE_LEN; |
pause_1_len = MATSUSHITA_1_PAUSE_LEN; |
pause_1_len = MATSUSHITA_1_PAUSE_LEN - 1; |
pulse_0_len = MATSUSHITA_PULSE_LEN; |
pause_0_len = MATSUSHITA_0_PAUSE_LEN; |
pause_0_len = MATSUSHITA_0_PAUSE_LEN - 1; |
has_stop_bit = MATSUSHITA_STOP_BIT; |
complete_data_len = MATSUSHITA_COMPLETE_DATA_LEN; |
n_auto_repetitions = 1; // 1 frame |
838,11 → 894,11 |
case IRMP_KASEIKYO_PROTOCOL: |
{ |
startbit_pulse_len = KASEIKYO_START_BIT_PULSE_LEN; |
startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN; |
startbit_pause_len = KASEIKYO_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = KASEIKYO_PULSE_LEN; |
pause_1_len = KASEIKYO_1_PAUSE_LEN; |
pause_1_len = KASEIKYO_1_PAUSE_LEN - 1; |
pulse_0_len = KASEIKYO_PULSE_LEN; |
pause_0_len = KASEIKYO_0_PAUSE_LEN; |
pause_0_len = KASEIKYO_0_PAUSE_LEN - 1; |
has_stop_bit = KASEIKYO_STOP_BIT; |
complete_data_len = KASEIKYO_COMPLETE_DATA_LEN; |
n_auto_repetitions = (repeat_counter == 0) ? KASEIKYO_FRAMES : 1; // 2 frames auto repetition if first frame |
856,11 → 912,11 |
case IRMP_RECS80_PROTOCOL: |
{ |
startbit_pulse_len = RECS80_START_BIT_PULSE_LEN; |
startbit_pause_len = RECS80_START_BIT_PAUSE_LEN; |
startbit_pause_len = RECS80_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = RECS80_PULSE_LEN; |
pause_1_len = RECS80_1_PAUSE_LEN; |
pause_1_len = RECS80_1_PAUSE_LEN - 1; |
pulse_0_len = RECS80_PULSE_LEN; |
pause_0_len = RECS80_0_PAUSE_LEN; |
pause_0_len = RECS80_0_PAUSE_LEN - 1; |
has_stop_bit = RECS80_STOP_BIT; |
complete_data_len = RECS80_COMPLETE_DATA_LEN; |
n_auto_repetitions = 1; // 1 frame |
874,11 → 930,11 |
case IRMP_RECS80EXT_PROTOCOL: |
{ |
startbit_pulse_len = RECS80EXT_START_BIT_PULSE_LEN; |
startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN; |
startbit_pause_len = RECS80EXT_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = RECS80EXT_PULSE_LEN; |
pause_1_len = RECS80EXT_1_PAUSE_LEN; |
pause_1_len = RECS80EXT_1_PAUSE_LEN - 1; |
pulse_0_len = RECS80EXT_PULSE_LEN; |
pause_0_len = RECS80EXT_0_PAUSE_LEN; |
pause_0_len = RECS80EXT_0_PAUSE_LEN - 1; |
has_stop_bit = RECS80EXT_STOP_BIT; |
complete_data_len = RECS80EXT_COMPLETE_DATA_LEN; |
n_auto_repetitions = 1; // 1 frame |
904,6 → 960,38 |
break; |
} |
#endif |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
case IRMP_RC6_PROTOCOL: |
{ |
startbit_pulse_len = RC6_START_BIT_PULSE_LEN; |
startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1; |
pulse_len = RC6_BIT_LEN; |
pause_len = RC6_BIT_LEN; |
has_stop_bit = RC6_STOP_BIT; |
complete_data_len = RC6_COMPLETE_DATA_LEN_SHORT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN; |
irsnd_set_freq (IRSND_FREQ_36_KHZ); |
break; |
} |
#endif |
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
case IRMP_RC6A_PROTOCOL: |
{ |
startbit_pulse_len = RC6_START_BIT_PULSE_LEN; |
startbit_pause_len = RC6_START_BIT_PAUSE_LEN - 1; |
pulse_len = RC6_BIT_LEN; |
pause_len = RC6_BIT_LEN; |
has_stop_bit = RC6_STOP_BIT; |
complete_data_len = RC6_COMPLETE_DATA_LEN_LONG; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
repeat_frame_pause_len = RC6_FRAME_REPEAT_PAUSE_LEN; |
irsnd_set_freq (IRSND_FREQ_36_KHZ); |
break; |
} |
#endif |
#if IRSND_SUPPORT_DENON_PROTOCOL == 1 |
case IRMP_DENON_PROTOCOL: |
{ |
910,15 → 998,15 |
startbit_pulse_len = 0x00; |
startbit_pause_len = 0x00; |
pulse_1_len = DENON_PULSE_LEN; |
pause_1_len = DENON_1_PAUSE_LEN; |
pause_1_len = DENON_1_PAUSE_LEN - 1; |
pulse_0_len = DENON_PULSE_LEN; |
pause_0_len = DENON_0_PAUSE_LEN; |
pause_0_len = DENON_0_PAUSE_LEN - 1; |
has_stop_bit = DENON_STOP_BIT; |
complete_data_len = DENON_COMPLETE_DATA_LEN; |
n_auto_repetitions = DENON_FRAMES; // 2 frames, 2nd with inverted command |
auto_repetition_pause_len = DENON_AUTO_REPETITION_PAUSE_LEN; // 65 ms pause after 1st frame |
repeat_frame_pause_len = DENON_FRAME_REPEAT_PAUSE_LEN; |
irsnd_set_freq (IRSND_FREQ_32_KHZ); |
irsnd_set_freq (IRSND_FREQ_38_KHZ); // in theory 32kHz, in practice 38kHz |
break; |
} |
#endif |
926,11 → 1014,11 |
case IRMP_NUBERT_PROTOCOL: |
{ |
startbit_pulse_len = NUBERT_START_BIT_PULSE_LEN; |
startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN; |
startbit_pause_len = NUBERT_START_BIT_PAUSE_LEN - 1; |
pulse_1_len = NUBERT_1_PULSE_LEN; |
pause_1_len = NUBERT_1_PAUSE_LEN; |
pause_1_len = NUBERT_1_PAUSE_LEN - 1; |
pulse_0_len = NUBERT_0_PULSE_LEN; |
pause_0_len = NUBERT_0_PAUSE_LEN; |
pause_0_len = NUBERT_0_PAUSE_LEN - 1; |
has_stop_bit = NUBERT_STOP_BIT; |
complete_data_len = NUBERT_COMPLETE_DATA_LEN; |
n_auto_repetitions = NUBERT_FRAMES; // 2 frames |
944,11 → 1032,11 |
case IRMP_BANG_OLUFSEN_PROTOCOL: |
{ |
startbit_pulse_len = BANG_OLUFSEN_START_BIT1_PULSE_LEN; |
startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN; |
startbit_pause_len = BANG_OLUFSEN_START_BIT1_PAUSE_LEN - 1; |
pulse_1_len = BANG_OLUFSEN_PULSE_LEN; |
pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN; |
pause_1_len = BANG_OLUFSEN_1_PAUSE_LEN - 1; |
pulse_0_len = BANG_OLUFSEN_PULSE_LEN; |
pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN; |
pause_0_len = BANG_OLUFSEN_0_PAUSE_LEN - 1; |
has_stop_bit = BANG_OLUFSEN_STOP_BIT; |
complete_data_len = BANG_OLUFSEN_COMPLETE_DATA_LEN; |
n_auto_repetitions = 1; // 1 frame |
963,7 → 1051,7 |
case IRMP_GRUNDIG_PROTOCOL: |
{ |
startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; |
startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1; |
pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
980,7 → 1068,7 |
case IRMP_NOKIA_PROTOCOL: |
{ |
startbit_pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN; |
startbit_pause_len = GRUNDIG_OR_NOKIA_PRE_PAUSE_LEN - 1; |
pulse_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
pause_len = GRUNDIG_OR_NOKIA_BIT_LEN; |
has_stop_bit = GRUNDIG_OR_NOKIA_STOP_BIT; |
1012,12 → 1100,12 |
case IRMP_FDC_PROTOCOL: |
{ |
startbit_pulse_len = FDC_START_BIT_PULSE_LEN; |
startbit_pause_len = FDC_START_BIT_PAUSE_LEN; |
startbit_pause_len = FDC_START_BIT_PAUSE_LEN - 1; |
complete_data_len = FDC_COMPLETE_DATA_LEN; |
pulse_1_len = FDC_PULSE_LEN; |
pause_1_len = FDC_1_PAUSE_LEN; |
pause_1_len = FDC_1_PAUSE_LEN - 1; |
pulse_0_len = FDC_PULSE_LEN; |
pause_0_len = FDC_0_PAUSE_LEN; |
pause_0_len = FDC_0_PAUSE_LEN - 1; |
has_stop_bit = FDC_STOP_BIT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
1030,12 → 1118,12 |
case IRMP_RCCAR_PROTOCOL: |
{ |
startbit_pulse_len = RCCAR_START_BIT_PULSE_LEN; |
startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN; |
startbit_pause_len = RCCAR_START_BIT_PAUSE_LEN - 1; |
complete_data_len = RCCAR_COMPLETE_DATA_LEN; |
pulse_1_len = RCCAR_PULSE_LEN; |
pause_1_len = RCCAR_1_PAUSE_LEN; |
pause_1_len = RCCAR_1_PAUSE_LEN - 1; |
pulse_0_len = RCCAR_PULSE_LEN; |
pause_0_len = RCCAR_0_PAUSE_LEN; |
pause_0_len = RCCAR_0_PAUSE_LEN - 1; |
has_stop_bit = RCCAR_STOP_BIT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
1053,12 → 1141,12 |
} |
|
startbit_pulse_len = JVC_START_BIT_PULSE_LEN; |
startbit_pause_len = JVC_START_BIT_PAUSE_LEN; |
startbit_pause_len = JVC_START_BIT_PAUSE_LEN - 1; |
complete_data_len = JVC_COMPLETE_DATA_LEN; |
pulse_1_len = JVC_PULSE_LEN; |
pause_1_len = JVC_1_PAUSE_LEN; |
pause_1_len = JVC_1_PAUSE_LEN - 1; |
pulse_0_len = JVC_PULSE_LEN; |
pause_0_len = JVC_0_PAUSE_LEN; |
pause_0_len = JVC_0_PAUSE_LEN - 1; |
has_stop_bit = JVC_STOP_BIT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
1072,12 → 1160,12 |
case IRMP_NIKON_PROTOCOL: |
{ |
startbit_pulse_len = NIKON_START_BIT_PULSE_LEN; |
startbit_pause_len = 271; // NIKON_START_BIT_PAUSE_LEN; |
startbit_pause_len = 271 - 1; // NIKON_START_BIT_PAUSE_LEN; |
complete_data_len = NIKON_COMPLETE_DATA_LEN; |
pulse_1_len = NIKON_PULSE_LEN; |
pause_1_len = NIKON_1_PAUSE_LEN; |
pause_1_len = NIKON_1_PAUSE_LEN - 1; |
pulse_0_len = NIKON_PULSE_LEN; |
pause_0_len = NIKON_0_PAUSE_LEN; |
pause_0_len = NIKON_0_PAUSE_LEN - 1; |
has_stop_bit = NIKON_STOP_BIT; |
n_auto_repetitions = 1; // 1 frame |
auto_repetition_pause_len = 0; |
1168,12 → 1256,12 |
{ |
pulse_len = SAMSUNG_PULSE_LEN; |
pause_len = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? |
SAMSUNG_1_PAUSE_LEN : SAMSUNG_0_PAUSE_LEN; |
(SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1); |
} |
else if (current_bit == SAMSUNG_ADDRESS_LEN) // send SYNC bit (16th bit) |
{ |
pulse_len = SAMSUNG_PULSE_LEN; |
pause_len = SAMSUNG_START_BIT_PAUSE_LEN; |
pause_len = SAMSUNG_START_BIT_PAUSE_LEN - 1; |
} |
else if (current_bit < SAMSUNG_COMPLETE_DATA_LEN) // send n'th bit |
{ |
1181,7 → 1269,7 |
|
pulse_len = SAMSUNG_PULSE_LEN; |
pause_len = (irsnd_buffer[cur_bit / 8] & (1<<(7-(cur_bit % 8)))) ? |
SAMSUNG_1_PAUSE_LEN : SAMSUNG_0_PAUSE_LEN; |
(SAMSUNG_1_PAUSE_LEN - 1) : (SAMSUNG_0_PAUSE_LEN - 1); |
} |
} |
else |
1193,22 → 1281,22 |
if (current_bit == 0) // send 2nd start bit |
{ |
pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1; |
} |
else if (current_bit == 1) // send 3rd start bit |
{ |
pulse_len = BANG_OLUFSEN_START_BIT3_PULSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT3_PAUSE_LEN - 1; |
} |
else if (current_bit == 2) // send 4th start bit |
{ |
pulse_len = BANG_OLUFSEN_START_BIT2_PULSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN; |
pause_len = BANG_OLUFSEN_START_BIT2_PAUSE_LEN - 1; |
} |
else if (current_bit == 19) // send trailer bit |
{ |
pulse_len = BANG_OLUFSEN_PULSE_LEN; |
pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN; |
pause_len = BANG_OLUFSEN_TRAILER_BIT_PAUSE_LEN - 1; |
} |
else if (current_bit < BANG_OLUFSEN_COMPLETE_DATA_LEN) // send n'th bit |
{ |
1217,11 → 1305,11 |
|
if (cur_bit_value == last_bit_value) |
{ |
pause_len = BANG_OLUFSEN_R_PAUSE_LEN; |
pause_len = BANG_OLUFSEN_R_PAUSE_LEN - 1; |
} |
else |
{ |
pause_len = cur_bit_value ? BANG_OLUFSEN_1_PAUSE_LEN : BANG_OLUFSEN_0_PAUSE_LEN; |
pause_len = cur_bit_value ? (BANG_OLUFSEN_1_PAUSE_LEN - 1) : (BANG_OLUFSEN_0_PAUSE_LEN - 1); |
last_bit_value = cur_bit_value; |
} |
} |
1297,6 → 1385,12 |
#if IRSND_SUPPORT_RC5_PROTOCOL == 1 |
case IRMP_RC5_PROTOCOL: |
#endif |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 |
case IRMP_RC6_PROTOCOL: |
#endif |
#if IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
case IRMP_RC6A_PROTOCOL: |
#endif |
#if IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 |
case IRMP_SIEMENS_PROTOCOL: |
#endif |
1307,7 → 1401,8 |
case IRMP_NOKIA_PROTOCOL: |
#endif |
|
#if IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
#if IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || \ |
IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
{ |
if (pulse_counter == pulse_len && pause_counter == pause_len) |
{ |
1374,15 → 1469,51 |
first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
} |
} |
else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_SIEMENS_PROTOCOL) |
else // if (irsnd_protocol == IRMP_RC5_PROTOCOL || irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL || |
// irsnd_protocol == IRMP_SIEMENS_PROTOCOL) |
#endif |
{ |
if (current_bit == 0xFF) // 1 start bit |
{ |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL) |
{ |
pulse_len = startbit_pulse_len; |
pause_len = startbit_pause_len; |
} |
#endif |
first_pulse = TRUE; |
} |
else // send n'th bit |
{ |
#if IRSND_SUPPORT_RC6_PROTOCOL == 1 || IRSND_SUPPORT_RC6A_PROTOCOL == 1 |
if (irsnd_protocol == IRMP_RC6_PROTOCOL || irsnd_protocol == IRMP_RC6A_PROTOCOL) |
{ |
pulse_len = RC6_BIT_LEN; |
pause_len = RC6_BIT_LEN; |
|
if (irsnd_protocol == IRMP_RC6_PROTOCOL) |
{ |
if (current_bit == 4) // toggle bit (double len) |
{ |
pulse_len = 2 * RC6_BIT_LEN; |
pause_len = 2 * RC6_BIT_LEN; |
} |
} |
else // if (irsnd_protocol == IRMP_RC6A_PROTOCOL) |
{ |
if (current_bit == 4) // toggle bit (double len) |
{ |
pulse_len = 2 * RC6_BIT_LEN + RC6_BIT_LEN; // hack! |
pause_len = 2 * RC6_BIT_LEN; |
} |
else if (current_bit == 5) // toggle bit (double len) |
{ |
pause_len = 2 * RC6_BIT_LEN; |
} |
} |
} |
#endif |
first_pulse = (irsnd_buffer[current_bit / 8] & (1<<(7-(current_bit % 8)))) ? TRUE : FALSE; |
} |
|
1433,7 → 1564,8 |
} |
break; |
} |
#endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
#endif // IRSND_SUPPORT_RC5_PROTOCOL == 1 || IRSND_SUPPORT_RC6_PROTOCOL == 1 || || IRSND_SUPPORT_RC6A_PROTOCOL == 1 || IRSND_SUPPORT_SIEMENS_PROTOCOL == 1 || |
// IRSND_SUPPORT_GRUNDIG_PROTOCOL == 1 || IRSND_SUPPORT_NOKIA_PROTOCOL == 1 |
|
default: |
{ |