targets/Makefile/plc_Makefile_main.c
author edouard
Mon, 07 Dec 2009 13:55:13 +0100
changeset 469 a6a9b59636d8
parent 452 2d0718a05cc7
permissions -rwxr-xr-x
Propagated new runtime changes to win32 target
425
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     1
/**
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     2
 * Yagarto specific code
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     3
 **/
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     4
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     5
//#include <stdio.h>
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     6
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     7
/* provided by POUS.C */
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     8
extern int common_ticktime__;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
     9
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    10
void Target_GetTime(IEC_TIME*);
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    11
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    12
long AtomicCompareExchange(long* atomicvar,long compared, long exchange)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    13
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    14
	return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    15
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    16
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    17
void PLC_GetTime(IEC_TIME *CURRENT_TIME)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    18
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    19
	/* Call target GetTime function */
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    20
	Target_GetTime(CURRENT_TIME);
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    21
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    22
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    23
void PLC_SetTimer(long long next, long long period)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    24
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    25
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    26
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    27
int startPLC(int argc,char **argv)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    28
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    29
	if(__init(argc,argv) == 0)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    30
		return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    31
	else
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    32
		return 1;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    33
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    34
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    35
int TryEnterDebugSection(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    36
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    37
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    38
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    39
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    40
void LeaveDebugSection(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    41
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    42
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    43
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    44
int stopPLC(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    45
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    46
    __cleanup();
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    47
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    48
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    49
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    50
extern unsigned long __tick;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    51
/* from plc_debugger.c */
452
2d0718a05cc7 Reflect changes in iec type definitions in matiec/lib
edouard
parents: 425
diff changeset
    52
int WaitDebugData(unsigned long *tick)
425
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    53
{
452
2d0718a05cc7 Reflect changes in iec type definitions in matiec/lib
edouard
parents: 425
diff changeset
    54
    *tick = __tick;
425
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    55
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    56
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    57
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    58
/* Called by PLC thread when debug_publish finished
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    59
 * This is supposed to unlock debugger thread in WaitDebugData*/
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    60
void InitiateDebugTransfer(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    61
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    62
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    63
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    64
void suspendDebug(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    65
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    66
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    67
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    68
void resumeDebug(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    69
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    70
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    71
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    72
/* from plc_python.c */
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    73
int WaitPythonCommands(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    74
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    75
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    76
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    77
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    78
/* Called by PLC thread on each new python command*/
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    79
void UnBlockPythonCommands(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    80
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    81
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    82
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    83
int TryLockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    84
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    85
	return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    86
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    87
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    88
void UnLockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    89
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    90
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    91
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    92
void LockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    93
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    94
}