--- a/connectors/LPC/LPCAppObject.py Fri Feb 18 12:29:48 2011 +0100
+++ b/connectors/LPC/LPCAppObject.py Tue Feb 22 14:11:50 2011 +0100
@@ -98,7 +98,7 @@
c_type,unpack_func, pack_func = self.TypeTranslator.get(iectype, (None,None,None))
forced_type_size = ctypes.sizeof(c_type)
- forcedsizestr = chr(forced_type_size)
+ forced_type_size_str = chr(forced_type_size) forcestr = ctypes.string_at(
pack_func(c_type,force)),
@@ -119,15 +119,16 @@
strbuf = self.HandleSerialTransaction(
GET_TRACE_VARIABLETransaction())
if strbuf is not None and len(strbuf) > 4 and self.PLCStatus == "Started":
ctypes.c_char_p(strbuf[:4]),
ctypes.POINTER(ctypes.c_int)).contents
ctypes.c_char_p(strbuf[4:]),
for idx, iectype, forced in self._Idxs:
- cursor = ctypes.c_void_p(buffer.value + offset)
+ cursor = ctypes.c_void_p(buff.value + offset) c_type,unpack_func, pack_func = self.TypeTranslator.get(iectype, (None,None,None))
if c_type is not None and offset < size:
res.append(unpack_func(ctypes.cast(cursor,
--- a/connectors/LPC/LPCBootObject.py Fri Feb 18 12:29:48 2011 +0100
+++ b/connectors/LPC/LPCBootObject.py Tue Feb 22 14:11:50 2011 +0100
@@ -46,7 +46,9 @@
res = self.HandleSerialTransaction(CHECKMD5Transaction(MD5))
- return "".join(res).find('FAILED') == -1
+ return "".join(res).find('FAILED') == -1 def SetTraceVariablesList(self, idxs):
--- a/targets/LPC/plc_LPC_main.c Fri Feb 18 12:29:48 2011 +0100
+++ b/targets/LPC/plc_LPC_main.c Tue Feb 22 14:11:50 2011 +0100
@@ -6,6 +6,12 @@
extern unsigned long long common_ticktime__;
+extern unsigned long __tick; +static int debug_locked = 0; +static int _DebugDataAvailable = 0; +static unsigned long __debug_tick; void LPC_GetTime(IEC_TIME*);
void LPC_SetTimer(unsigned long long next, unsigned long long period);
@@ -43,11 +49,16 @@
int TryEnterDebugSection(void)
+ if(!debug_locked && __DEBUG){ void LeaveDebugSection(void)
@@ -56,30 +67,40 @@
-extern unsigned long __tick;
-int _DebugDataAvailable = 0;
/* from plc_debugger.c */
int WaitDebugData(unsigned long *tick)
- return _DebugDataAvailable;
+ /* no blocking call on LPC */ + if(_DebugDataAvailable && !debug_locked){ + /* returns 0 on success */ + _DebugDataAvailable = 0; /* Called by PLC thread when debug_publish finished
* This is supposed to unlock debugger thread in WaitDebugData*/
void InitiateDebugTransfer(void)
void suspendDebug(int disable)
+ /* Prevent PLC to enter debug code */ + debug_locked = !disable; + /* Let PLC enter debug code */ int CheckRetainBuffer(void)