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