equal
deleted
inserted
replaced
181 __debug_tick = __tick; |
181 __debug_tick = __tick; |
182 /* signal debugger thread it can read data */ |
182 /* signal debugger thread it can read data */ |
183 ReleaseSemaphore(debug_wait_sem, 1, NULL); |
183 ReleaseSemaphore(debug_wait_sem, 1, NULL); |
184 } |
184 } |
185 |
185 |
186 void suspendDebug(int disable) |
186 int suspendDebug(int disable) |
187 { |
187 { |
188 /* Prevent PLC to enter debug code */ |
188 /* Prevent PLC to enter debug code */ |
189 WaitForSingleObject(debug_sem, INFINITE); |
189 WaitForSingleObject(debug_sem, INFINITE); |
190 /*__DEBUG is protected by this mutex */ |
|
191 __DEBUG = !disable; |
190 __DEBUG = !disable; |
192 if(disable) |
191 if(disable) |
193 ReleaseSemaphore(debug_sem, 1, NULL); |
192 ReleaseSemaphore(debug_sem, 1, NULL); |
|
193 return 0; |
194 } |
194 } |
195 |
195 |
196 void resumeDebug() |
196 void resumeDebug() |
197 { |
197 { |
198 __DEBUG = 1; |
198 __DEBUG = 1; |