author | edouard |
Mon, 14 Dec 2009 21:05:10 +0100 | |
changeset 512 | 36aeab46f27d |
parent 502 | 5343ae43f6d0 |
child 518 | 8e61b0066859 |
permissions | -rwxr-xr-x |
425 | 1 |
/** |
2 |
* Yagarto specific code |
|
3 |
**/ |
|
4 |
||
5 |
//#include <stdio.h> |
|
6 |
||
7 |
/* provided by POUS.C */ |
|
8 |
extern int common_ticktime__; |
|
9 |
||
10 |
void Target_GetTime(IEC_TIME*); |
|
11 |
||
12 |
long AtomicCompareExchange(long* atomicvar,long compared, long exchange) |
|
13 |
{ |
|
14 |
return 0; |
|
15 |
} |
|
16 |
||
17 |
void PLC_GetTime(IEC_TIME *CURRENT_TIME) |
|
18 |
{ |
|
19 |
/* Call target GetTime function */ |
|
20 |
Target_GetTime(CURRENT_TIME); |
|
21 |
} |
|
22 |
||
23 |
void PLC_SetTimer(long long next, long long period) |
|
24 |
{ |
|
25 |
} |
|
26 |
||
27 |
int startPLC(int argc,char **argv) |
|
28 |
{ |
|
29 |
if(__init(argc,argv) == 0) |
|
30 |
return 0; |
|
31 |
else |
|
32 |
return 1; |
|
33 |
} |
|
34 |
||
35 |
int TryEnterDebugSection(void) |
|
36 |
{ |
|
502 | 37 |
return __DEBUG; |
425 | 38 |
} |
39 |
||
40 |
void LeaveDebugSection(void) |
|
41 |
{ |
|
42 |
} |
|
43 |
||
44 |
int stopPLC(void) |
|
45 |
{ |
|
46 |
__cleanup(); |
|
47 |
return 0; |
|
48 |
} |
|
49 |
||
50 |
extern unsigned long __tick; |
|
502 | 51 |
int _DebugDataAvailable = 0; |
425 | 52 |
/* from plc_debugger.c */ |
452
2d0718a05cc7
Reflect changes in iec type definitions in matiec/lib
edouard
parents:
425
diff
changeset
|
53 |
int WaitDebugData(unsigned long *tick) |
425 | 54 |
{ |
452
2d0718a05cc7
Reflect changes in iec type definitions in matiec/lib
edouard
parents:
425
diff
changeset
|
55 |
*tick = __tick; |
502 | 56 |
return _DebugDataAvailable; |
425 | 57 |
} |
58 |
||
59 |
/* Called by PLC thread when debug_publish finished |
|
60 |
* This is supposed to unlock debugger thread in WaitDebugData*/ |
|
61 |
void InitiateDebugTransfer(void) |
|
62 |
{ |
|
502 | 63 |
_DebugDataAvailable = 1; |
425 | 64 |
} |
65 |
||
502 | 66 |
void suspendDebug(int disable) |
425 | 67 |
{ |
502 | 68 |
__DEBUG = !disable; |
425 | 69 |
} |
70 |
||
71 |
void resumeDebug(void) |
|
72 |
{ |
|
502 | 73 |
__DEBUG = 1; |
425 | 74 |
} |
483
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
75 |
|
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
76 |
void Retain(unsigned int offset, unsigned int count, void *p) |
497 | 77 |
{ |
483
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
78 |
} |
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
79 |
|
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
80 |
void Remind(unsigned int offset, unsigned int count, void *p) |
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
81 |
{ |
bc26c42d2eec
fixed greg's crap in win32, enhanced debug stability, implemented preliminary retain
edouard
parents:
478
diff
changeset
|
82 |
} |