Skip to content

Commit dfff643

Browse files
committed
minor update
1 parent 3c257ac commit dfff643

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

example/example.uvoptx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,7 @@
153153
<Name>(105=150,186,829,544,0)(106=-1,-1,-1,-1,0)(107=180,218,520,403,0)</Name>
154154
</SetRegEntry>
155155
</TargetDriverDllRegistry>
156-
<Breakpoint>
157-
<Bp>
158-
<Number>0</Number>
159-
<Type>0</Type>
160-
<LineNumber>204</LineNumber>
161-
<EnabledFlag>1</EnabledFlag>
162-
<Address>10704</Address>
163-
<ByteObject>0</ByteObject>
164-
<HtxType>0</HtxType>
165-
<ManyObjects>0</ManyObjects>
166-
<SizeOfObject>0</SizeOfObject>
167-
<BreakByAccess>0</BreakByAccess>
168-
<BreakIfRCount>1</BreakIfRCount>
169-
<Filename>&lt;1&gt;.\main.c</Filename>
170-
<ExecCommand></ExecCommand>
171-
<Expression>\\example\main.c\204</Expression>
172-
</Bp>
173-
</Breakpoint>
156+
<Breakpoint/>
174157
<WatchWindow1>
175158
<Ww>
176159
<count>0</count>
@@ -864,7 +847,7 @@
864847

865848
<Group>
866849
<GroupName>::Language Extension</GroupName>
867-
<tvExp>0</tvExp>
850+
<tvExp>1</tvExp>
868851
<tvExpOptDlg>0</tvExpOptDlg>
869852
<cbSel>0</cbSel>
870853
<RteFlg>1</RteFlg>

example/main.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
typedef int64_t clock_t ;
3131
#endif
3232

33+
extern uintptr_t Image$$ARM_LIB_STACK$$ZI$$Base[];
34+
3335
extern void systimer_1ms_handler(void);
3436

3537
void systimer_1ms_handler(void)
@@ -222,6 +224,11 @@ int main (void)
222224
cpt_example_led_flash_init(&s_tExampleCPT[1], s_dwStack1, sizeof(s_dwStack1));
223225

224226
while (1) {
227+
228+
__perf_counter_printf__("System Stack Remain: %"PRIu32 "\r\n",
229+
perfc_stack_remain((uintptr_t)&Image$$ARM_LIB_STACK$$ZI$$Base));
230+
231+
225232
if (perfc_is_time_out_ms(10000)) {
226233
__perf_counter_printf__("\r[%010"PRIi64"]", get_system_ms());
227234
}
@@ -231,7 +238,7 @@ int main (void)
231238
}
232239

233240
#if __IS_COMPILER_ARM_COMPILER__
234-
extern uintptr_t Image$$ARM_LIB_STACK$$ZI$$Base[];
241+
235242
uintptr_t nStackLimit = (uintptr_t)Image$$ARM_LIB_STACK$$ZI$$Base;
236243
#else
237244
extern uintptr_t __StackLimit[];
@@ -258,11 +265,9 @@ int main (void)
258265
__perf_counter_printf__("\r\nCoroutine Stack Remain: %"PRIu32"\r\n", tStackRemain);
259266
}
260267

268+
261269
perfc_coroutine_call((perfc_coroutine_t *)&s_tExampleCPT[1]);
262270

263-
264-
__perf_counter_printf__("System Stack Remain: %"PRIu32 "\r\n",
265-
perfc_stack_remain((uintptr_t)&Image$$ARM_LIB_STACK$$ZI$$Base));
266-
//pt_example_led_flash(&s_tExamplePT);
271+
pt_example_led_flash(&s_tExamplePT);
267272
}
268273
}

perfc_task_pt.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,10 @@ label_switch_start:
245245

246246
#define PERFC_CPT_DELAY_MS(__ms, ...) \
247247
{ \
248-
int64_t lDelayTimestampInMs = get_system_ms(); \
249-
do { \
250-
if ((get_system_ms() - lDelayTimestampInMs) >= (__ms)) { \
251-
break; \
252-
} \
253-
PERFC_CPT_YIELD(fsm_rt_on_going); \
254-
} while(1); \
248+
ptTask->tCoroutine.tReturn.nResult = fsm_rt_on_going; \
249+
perfc_delay_ms((__ms), &ptTask->tCoroutine); \
255250
}
256251

257-
258252
#define PERFC_CPT_REPORT_STATUS(...) PERFC_CPT_YIELD(__VA_ARGS__)
259253

260254
#define PERFC_CPT_RETURN(...) \

0 commit comments

Comments
 (0)