comparison projects/basic/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 09f03ac40fcc
children ad5cd8dd99b3
comparison
equal deleted inserted replaced
14:06f93bef7dd2 15:901d205d1a3c
75 if(BeagleRT_startAudio()) { 75 if(BeagleRT_startAudio()) {
76 cout << "Error: unable to start real-time audio" << endl; 76 cout << "Error: unable to start real-time audio" << endl;
77 return -1; 77 return -1;
78 } 78 }
79 79
80 // Set up interrupt handler to catch Control-C 80 // Set up interrupt handler to catch Control-C and SIGTERM
81 signal(SIGINT, interrupt_handler); 81 signal(SIGINT, interrupt_handler);
82 signal(SIGTERM, interrupt_handler);
82 83
83 // Run until told to stop 84 // Run until told to stop
84 while(!gShouldStop) { 85 while(!gShouldStop) {
85 usleep(100000); 86 usleep(100000);
86 } 87 }