File tree Expand file tree Collapse file tree 1 file changed +19
-27
lines changed Expand file tree Collapse file tree 1 file changed +19
-27
lines changed Original file line number Diff line number Diff line change @@ -1109,35 +1109,27 @@ linked LIRC file.
1109
1109
void IRsend::sendSharp (unsigned long data, int nbits) {
1110
1110
unsigned long invertdata = data ^ SHARP_TOGGLE_MASK;
1111
1111
enableIROut (38 );
1112
- for (int i = 0 ; i < nbits; i++) {
1113
- if (data & 0x4000 ) {
1114
- mark (SHARP_BIT_MARK);
1115
- space (SHARP_ONE_SPACE);
1116
- }
1117
- else {
1118
- mark (SHARP_BIT_MARK);
1119
- space (SHARP_ZERO_SPACE);
1120
- }
1121
- data <<= 1 ;
1122
- }
1123
-
1124
- mark (SHARP_BIT_MARK);
1125
- space (SHARP_ZERO_SPACE);
1126
- delay (46 );
1127
- for (int i = 0 ; i < nbits; i++) {
1128
- if (invertdata & 0x4000 ) {
1129
- mark (SHARP_BIT_MARK);
1130
- space (SHARP_ONE_SPACE);
1131
- }
1132
- else {
1133
- mark (SHARP_BIT_MARK);
1134
- space (SHARP_ZERO_SPACE);
1112
+
1113
+ // Sending codes in bursts of 3 (normal, inverted, normal) makes transmission
1114
+ // much more reliable. That's the exact behaviour of CD-S6470 remote control.
1115
+ for (int n = 0 ; n < 3 ; n++) {
1116
+ for (int i = 1 << (nbits-1 ); i > 0 ; i>>=1 ) {
1117
+ if (data & i) {
1118
+ mark (SHARP_BIT_MARK);
1119
+ space (SHARP_ONE_SPACE);
1120
+ }
1121
+ else {
1122
+ mark (SHARP_BIT_MARK);
1123
+ space (SHARP_ZERO_SPACE);
1124
+ }
1135
1125
}
1136
- invertdata <<= 1 ;
1126
+
1127
+ mark (SHARP_BIT_MARK);
1128
+ space (SHARP_ZERO_SPACE);
1129
+ delay (40 );
1130
+
1131
+ data = data ^ SHARP_TOGGLE_MASK;
1137
1132
}
1138
- mark (SHARP_BIT_MARK);
1139
- space (SHARP_ZERO_SPACE);
1140
- delay (46 );
1141
1133
}
1142
1134
1143
1135
void IRsend::sendDISH (unsigned long data, int nbits)
You can’t perform that action at this time.
0 commit comments