Rev 1437 | Rev 2039 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1437 | Rev 1866 | ||
---|---|---|---|
1 | /**************************************************************************** |
1 | /**************************************************************************** |
2 | * Copyright (C) 2009-2012 by Claas Anders "CaScAdE" Rathje * |
2 | * Copyright (C) 2009-2013 by Claas Anders "CaScAdE" Rathje * |
3 | * admiralcascade@gmail.com * |
3 | * admiralcascade@gmail.com * |
4 | * Project-URL: http://www.mylifesucks.de/oss/c-osd/ * |
4 | * Project-URL: http://www.mylifesucks.de/oss/c-osd/ * |
5 | * * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License. * |
8 | * the Free Software Foundation; either version 2 of the License. * |
9 | * * |
9 | * * |
10 | * This program is distributed in the hope that it will be useful, * |
10 | * This program is distributed in the hope that it will be useful, * |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
13 | * GNU General Public License for more details. * |
13 | * GNU General Public License for more details. * |
14 | * * |
14 | * * |
15 | * You should have received a copy of the GNU General Public License * |
15 | * You should have received a copy of the GNU General Public License * |
16 | * along with this program; if not, write to the * |
16 | * along with this program; if not, write to the * |
17 | * Free Software Foundation, Inc., * |
17 | * Free Software Foundation, Inc., * |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 | ****************************************************************************/ |
19 | ****************************************************************************/ |
20 | 20 | ||
21 | #include "main.h" |
21 | #include "main.h" |
22 | #include <avr/io.h> |
22 | #include <avr/io.h> |
23 | #include <util/delay.h> |
23 | #include <util/delay.h> |
24 | 24 | ||
25 | /* ########################################################################## |
25 | /* ########################################################################## |
26 | * debounce buttons |
26 | * debounce buttons |
27 | * ##########################################################################*/ |
27 | * ##########################################################################*/ |
28 | int s1_pressed() { |
28 | int s1_pressed() { |
29 | if (S1_PRESSED) { |
29 | if (S1_PRESSED) { |
30 | _delay_ms(25); |
30 | _delay_ms(25); |
31 | if (S1_PRESSED) return 1; |
31 | if (S1_PRESSED) return 1; |
32 | } |
32 | } |
33 | return 0; |
33 | return 0; |
34 | } |
34 | } |
35 | 35 | ||
36 | int s2_pressed() { |
36 | int s2_pressed() { |
37 | if (S2_PRESSED) { |
37 | if (S2_PRESSED) { |
38 | _delay_ms(25); |
38 | _delay_ms(25); |
39 | if (S2_PRESSED) return 1; |
39 | if (S2_PRESSED) return 1; |
40 | } |
40 | } |
41 | return 0; |
41 | return 0; |
42 | } |
42 | } |
43 | 43 |