comparison projects/basic_passthru/main.cpp @ 15:901d205d1a3c

Updated to latest PRU library; external PRU file no longer needed. Also catch SIGTERM as well as SIGINT to clean up gracefully.
author andrewm
date Sat, 07 Feb 2015 16:41:56 +0000
parents 6adb088196a7
children a6d223473ea2
comparison
equal deleted inserted replaced
14:06f93bef7dd2 15:901d205d1a3c
69 if(BeagleRT_startAudio()) { 69 if(BeagleRT_startAudio()) {
70 cout << "Error: unable to start real-time audio" << endl; 70 cout << "Error: unable to start real-time audio" << endl;
71 return -1; 71 return -1;
72 } 72 }
73 73
74 // Set up interrupt handler to catch Control-C 74 // Set up interrupt handler to catch Control-C and SIGTERM
75 signal(SIGINT, interrupt_handler); 75 signal(SIGINT, interrupt_handler);
76 signal(SIGTERM, interrupt_handler);
76 77
77 // Run until told to stop 78 // Run until told to stop
78 while(!gShouldStop) { 79 while(!gShouldStop) {
79 usleep(100000); 80 usleep(100000);
80 } 81 }