Subversion Repositories HomeAutomation

Rev

Rev 869 | Rev 948 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 869 Rev 905
Line 5... Line 5...
5
#include <drivers/can/stdcan.h>
5
#include <drivers/can/stdcan.h>
6
#include <config.h> // All configuration parameters
6
#include <config.h> // All configuration parameters
7
#include <bios.h>   // BIOS interface declarations, including CAN structure and ID defines.
7
#include <bios.h>   // BIOS interface declarations, including CAN structure and ID defines.
8
#include <drivers/timer/timer.h>
8
#include <drivers/timer/timer.h>
9
 
9
 
-
 
10
#include <drivers/can/canprintf.h>
-
 
11
 
10
%INCLUDE
12
%INCLUDE
11
 
13
 
12
int main(void)
14
int main(void)
13
{
15
{
14
	StdCan_Msg_t rxMsg; // Message storage
16
	StdCan_Msg_t rxMsg; // Message storage
15
 
17
 
16
	// Enable interrupts as early as possible
18
	// Enable interrupts as early as possible
17
	sei();
19
	sei();
18
	
20
	
19
	Timer_Init();
21
	Timer_Init();
20
 
22
 
21
	StdCan_Init();
23
	StdCan_Init();
-
 
24
 
-
 
25
#if CAN_PRINTF==1
-
 
26
	#warning can_printf in use
-
 
27
	CanPrintf_Init();
-
 
28
#endif
22
	
29
	
23
	Timer_SetTimeout(APP_HEARTBEAT_TIMER, STDCAN_HEARTBEAT_PERIOD, TimerTypeFreeRunning, StdCan_SendHeartbeat);
30
	Timer_SetTimeout(APP_HEARTBEAT_TIMER, STDCAN_HEARTBEAT_PERIOD, TimerTypeFreeRunning, StdCan_SendHeartbeat);
24
	
31
 
25
	%INIT
32
	%INIT
26
 
33