Skip to content

Commit 3772f00

Browse files
committed
daemon, RCSwitch: set high priority scheduling
decrease PulseLength a bit, since scheduling improved
1 parent d388fc2 commit 3772f00

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

daemon.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ RCSwitch mySwitch;
4242
int main(int argc, char* argv[]) {
4343
/**
4444
* Setup wiringPi and RCSwitch
45+
* set high priority scheduling
4546
*/
4647
if (wiringPiSetup () == -1)
4748
return 1;
49+
piHiPri(20);
4850
mySwitch = RCSwitch();
49-
mySwitch.setPulseLength(270);
51+
mySwitch.setPulseLength(300);
5052
usleep(50000);
5153
mySwitch.enableTransmit(0);
5254

send.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ int main(int argc, char *argv[]) {
2020
int command = atoi(argv[3]);
2121

2222
if (wiringPiSetup () == -1) return 1;
23+
piHiPri(20);
2324
printf("sending systemCode[%s] unitCode[%i] command[%i]\n", systemCode, unitCode, command);
2425
RCSwitch mySwitch = RCSwitch();
25-
mySwitch.setPulseLength(270);
26+
mySwitch.setPulseLength(300);
2627
mySwitch.enableTransmit(PIN);
2728

2829
switch(command) {

0 commit comments

Comments
 (0)