Mercurial > hg > beaglert
comparison projects/filter_IIR/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 | 323a4eb9b7c0 |
children | a6d223473ea2 |
comparison
equal
deleted
inserted
replaced
14:06f93bef7dd2 | 15:901d205d1a3c |
---|---|
162 if(BeagleRT_startAudio()) { | 162 if(BeagleRT_startAudio()) { |
163 cout << "Error: unable to start real-time audio" << endl; | 163 cout << "Error: unable to start real-time audio" << endl; |
164 return -1; | 164 return -1; |
165 } | 165 } |
166 | 166 |
167 // Set up interrupt handler to catch Control-C | 167 // Set up interrupt handler to catch Control-C and SIGTERM |
168 signal(SIGINT, interrupt_handler); | 168 signal(SIGINT, interrupt_handler); |
169 signal(SIGTERM, interrupt_handler); | |
169 | 170 |
170 // Run until told to stop | 171 // Run until told to stop |
171 while(!gShouldStop) { | 172 while(!gShouldStop) { |
172 usleep(100000); | 173 usleep(100000); |
173 } | 174 } |