diff 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
line wrap: on
line diff
--- a/projects/tank_wars/main.cpp	Fri Jan 23 15:35:10 2015 +0000
+++ b/projects/tank_wars/main.cpp	Sat Feb 07 16:41:56 2015 +0000
@@ -82,8 +82,9 @@
 		return -1;
 	}
 
-	// Set up interrupt handler to catch Control-C
+	// Set up interrupt handler to catch Control-C and SIGTERM
 	signal(SIGINT, interrupt_handler);
+	signal(SIGTERM, interrupt_handler);
 
 	// Run until told to stop
 	while(!gShouldStop) {