Mercurial > hg > beaglert
comparison projects/basic_analog_output/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 | a6d223473ea2 |
comparison
equal
deleted
inserted
replaced
14:06f93bef7dd2 | 15:901d205d1a3c |
---|---|
82 if(BeagleRT_startAudio()) { | 82 if(BeagleRT_startAudio()) { |
83 cout << "Error: unable to start real-time audio" << endl; | 83 cout << "Error: unable to start real-time audio" << endl; |
84 return -1; | 84 return -1; |
85 } | 85 } |
86 | 86 |
87 // Set up interrupt handler to catch Control-C | 87 // Set up interrupt handler to catch Control-C and SIGTERM |
88 signal(SIGINT, interrupt_handler); | 88 signal(SIGINT, interrupt_handler); |
89 signal(SIGTERM, interrupt_handler); | |
89 | 90 |
90 // Run until told to stop | 91 // Run until told to stop |
91 while(!gShouldStop) { | 92 while(!gShouldStop) { |
92 usleep(100000); | 93 usleep(100000); |
93 } | 94 } |