targets/Makefile/plc_Makefile_main.c
author laurent
Sun, 29 Nov 2009 16:31:14 +0100
changeset 437 26ec1444e351
parent 425 f390e9fdd2cf
child 452 2d0718a05cc7
permissions -rwxr-xr-x
Redesign test SVGUI interface
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 */
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    52
int WaitDebugData(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    53
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    54
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    55
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    56
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    57
/* Called by PLC thread when debug_publish finished
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    58
 * This is supposed to unlock debugger thread in WaitDebugData*/
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    59
void InitiateDebugTransfer(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    60
{
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
void suspendDebug(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    64
{
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
void resumeDebug(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    68
{
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
/* from plc_python.c */
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    72
int WaitPythonCommands(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    73
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    74
    return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    75
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    76
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    77
/* Called by PLC thread on each new python command*/
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    78
void UnBlockPythonCommands(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    79
{
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
int TryLockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    83
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    84
	return 0;
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    85
}
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    86
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    87
void UnLockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    88
{
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
void LockPython(void)
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    92
{
f390e9fdd2cf Add new target (Makefile)
greg
parents:
diff changeset
    93
}