forked from CANopenNode/CANopenNode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.cpp
More file actions
69 lines (54 loc) · 1.57 KB
/
Copy pathapplication.cpp
File metadata and controls
69 lines (54 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//===========================================================================
// INCLUDES
//===========================================================================
#include "CANopen.h"
#include <cyg/infra/diag.h>
//===========================================================================
extern "C" void programStart(void)
{
diag_printf("programStart\n");
}
//===========================================================================
extern "C" void communicationReset(void)
{
diag_printf("communicationReset\n");
}
//===========================================================================
extern "C" void programEnd(void)
{
diag_printf("programEnd\n");
}
//===========================================================================
extern "C" void programAsync(uint16_t timer1msDiff)
{
static uint32_t MsCount = 0;
static uint8_t SecCount = 0;
static uint8_t Output0 = OD_writeOutput8Bit[0];
MsCount += timer1msDiff;
OD_readInput8Bit[1] = MsCount;
if (MsCount >= 1000)
{
diag_printf("programAsync\n");
MsCount -= 1000;
SecCount++;
}
OD_readInput8Bit[0] = SecCount;
if (Output0 != OD_writeOutput8Bit[0])
{
Output0 = OD_writeOutput8Bit[0];
diag_printf("Output0 changed: %x\n", Output0);
}
}
//===========================================================================
extern "C" void program1ms(void)
{
static uint32_t MsCount = 0;
MsCount ++;
if (MsCount >= 1000)
{
diag_printf("program1ms\n");
MsCount -= 1000;
}
}
//---------------------------------------------------------------------------
// EOF application.cpp