Rev 1125 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1125 | Rev 1136 | ||
|---|---|---|---|
| Line 12... | Line 12... | ||
| 12 | 12 | ||
| 13 | /**@{*/ |
13 | /**@{*/ |
| 14 | 14 | ||
| 15 | #ifndef PCINT_H_ |
15 | #ifndef PCINT_H_ |
| 16 | #define PCINT_H_ |
16 | #define PCINT_H_ |
| - | 17 | ||
| 17 | #include <config.h> |
18 | #include <config.h> |
| 18 | #ifndef PCINT_NUM_PCINTS |
19 | #ifndef PCINT_NUM_PCINTS |
| 19 | # error PCINT_NUM_PCINTS is not defined! Edit config.inc. |
20 | # error PCINT_NUM_PCINTS is not defined! Edit config.inc. |
| 20 | #endif |
21 | #endif |
| - | 22 | ||
| - | 23 | #if PCINT_NUM_PCINTS > 0 |
|
| 21 | 24 | ||
| 22 | /*----------------------------------------------------------------------------- |
25 | /*----------------------------------------------------------------------------- |
| 23 | * Includes |
26 | * Includes |
| 24 | *---------------------------------------------------------------------------*/ |
27 | *---------------------------------------------------------------------------*/ |
| 25 | #include <inttypes.h> |
28 | #include <inttypes.h> |
| Line 40... | Line 43... | ||
| 40 | *---------------------------------------------------------------------------*/ |
43 | *---------------------------------------------------------------------------*/ |
| 41 | 44 | ||
| 42 | /** |
45 | /** |
| 43 | * @brief Type of the callback function pointer |
46 | * @brief Type of the callback function pointer |
| 44 | */ |
47 | */ |
| 45 | typedef void (*pcintCallback_t)(uint8_t); |
48 | typedef void (*pcintCallback_t)(uint8_t, uint8_t); |
| 46 | 49 | ||
| 47 | /*----------------------------------------------------------------------------- |
50 | /*----------------------------------------------------------------------------- |
| 48 | * Public Function Prototypes |
51 | * Public Function Prototypes |
| 49 | *---------------------------------------------------------------------------*/ |
52 | *---------------------------------------------------------------------------*/ |
| 50 | 53 | ||
| Line 77... | Line 80... | ||
| 77 | * pcint number as the argument whenever the pcint is thrown. It is called |
80 | * pcint number as the argument whenever the pcint is thrown. It is called |
| 78 | * from the interrupt handler and must be very short. Null if not used. |
81 | * from the interrupt handler and must be very short. Null if not used. |
| 79 | */ |
82 | */ |
| 80 | static inline __attribute__ ((always_inline)) void Pcint_SetCallbackPin(uint8_t pcint_id, volatile uint8_t* port, volatile uint8_t* pin, volatile uint8_t* ddr,uint8_t nr, uint8_t pcint, pcintCallback_t callback) {Pcint_SetCallback(pcint_id, pcint, *callback);} |
83 | static inline __attribute__ ((always_inline)) void Pcint_SetCallbackPin(uint8_t pcint_id, volatile uint8_t* port, volatile uint8_t* pin, volatile uint8_t* ddr,uint8_t nr, uint8_t pcint, pcintCallback_t callback) {Pcint_SetCallback(pcint_id, pcint, *callback);} |
| 81 | 84 | ||
| - | 85 | #endif /*PCINT_NUM_PCINTS > 0*/ |
|
| 82 | /**@}*/ |
86 | /**@}*/ |
| 83 | #endif /*PCINT_H_*/ |
87 | #endif /*PCINT_H_*/ |