Wer kann mir hier weiterhelfen? bei folgend aufgeführtem Kode erhalte ich die Fehlermeldung: ../Entprellen-embedded.c:19: error: expected identifier or '(' before '=' token Code:
1 | #include <avr/io.h> |
2 | #include <avr/interrupt.h> |
3 | #include <stdbool.h> |
4 | |
5 | #define forever true
|
6 | #define OFF false
|
7 | #define ON true
|
8 | |
9 | typedef int time_t; |
10 | typedef bool ioSwitch; |
11 | |
12 | |
13 | //-------------------------------------------------------------------------
|
14 | // Get Debounced Switch State
|
15 | bool IsSwitchStateChanged (void) |
16 | //-------------------------------------------------------------------------
|
17 | {
|
18 | static bool oldState = OFF; |
19 | ioSwitch = IO_SWITCH; // grab Value from I/O |
20 | |
21 | If (ioSwitch != oldState) // if ioSwitch state has changed, do something |
22 | {
|
23 | DebounceSwitch (); |
24 | oldState = ioSwitch; // save state for next comparison |
25 | return true; // ioSwitch state HAS changed |
26 | }
|
27 | return false; // ioSwitch state HAS NOT changed |
28 | }
|