spin.c | raw changeset files shortlog |
1.1 --- a/spin.c Sun Nov 24 19:01:08 2013 +0000 1.2 +++ b/spin.c Sun Nov 24 19:28:06 2013 +0000 1.3 @@ -25,6 +25,12 @@ 1.4 exit(1); 1.5 } 1.6 1.7 +void lcd_shutdown(int signum) 1.8 +{ 1.9 + LCD_off(); 1.10 + shutdown(signum); 1.11 +} 1.12 + 1.13 /** 1.14 * Show a pattern on the screen. 1.15 */ 1.16 @@ -60,6 +66,8 @@ 1.17 spi_init(); 1.18 LCD_init(); 1.19 1.20 + signal(SIGINT, lcd_shutdown); 1.21 + 1.22 printf("Updating...\n"); 1.23 pattern(); 1.24 1.25 @@ -75,6 +83,8 @@ 1.26 state = (state + 1) % 4; 1.27 } 1.28 1.29 + LCD_off(); 1.30 + 1.31 printf("Closing...\n"); 1.32 ubb_close(0); 1.33 return 0;