ATxmega Core
Loading...
Searching...
No Matches
hwbp_sync.h
Go to the documentation of this file.
1#ifndef _HWBP_SYNC_H_
2#define _HWBP_SYNC_H_
3#include <avr/io.h>
4
5
6/************************************************************************/
7/* Prototypes */
8/************************************************************************/
9void initialize_timestamp_uart (uint32_t * timestamp_pointer);
10void reset_sync_counter (void);
11void trigger_sync_timer (void);
12
13
14/************************************************************************/
15/* Reset sync counter */
16/************************************************************************/
17#if defined(__AVR_ATxmega16A4U__)
18 #define RESET_TIMESTAMP_COUNTER reset_sync_counter()
19#else
20 #define RESET_TIMESTAMP_COUNTER
21#endif
22
23
24/************************************************************************/
25/* Trigger timer */
26/************************************************************************/
27#if defined(__AVR_ATxmega16A4U__)
28 #define SYNC_TRIGGER_TIMER trigger_sync_timer()
29#else
30 #define SYNC_TRIGGER_TIMER
31#endif
32
33
34/************************************************************************/
35/* Control when the device lost sync */
36/************************************************************************/
37#if defined(__AVR_ATxmega16A4U__)
38 #define INCREASE_LOST_SYNC_COUNTER
39#else
40 #define INCREASE_LOST_SYNC_COUNTER if(++device_lost_sync_counter == 255) device_lost_sync_counter = 254; if(device_lost_sync_counter >= 5 ) commonbank.R_HEARTBEAT &= ~B_IS_SYNCHRONIZED
41#endif
42
43
44#endif /* _HWBP_SYNC_H_ */
void trigger_sync_timer(void)
Definition hwbp_sync.c:114
void reset_sync_counter(void)
Definition hwbp_sync.c:105
void initialize_timestamp_uart(uint32_t *timestamp_pointer)
Definition hwbp_sync.c:31