Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: VMachine.h
- Revision:
- 0:6477530de2c0
diff -r 000000000000 -r 6477530de2c0 VMachine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/VMachine.h Fri Nov 27 21:43:33 2015 +0000 @@ -0,0 +1,44 @@ +/* VMachine */ +void VMachine(void const *i) +{ + int CurrentState = VMACHINE_INITIAL; + RtosTimer local_timer = RtosTimer(VMachine_timer, osTimerPeriodic,(void *)0); + local_timer.start(1); + while (true) { + switch (CurrentState) { + case VMACHINE_AEVENT: + if(VMachine_clock >= AVI && global_time >= CURRENT_URI) { + SyncStatus[VPACE] = agre_time; + CurrentState = VMACHINE_INITIAL; + pc.printf("VPace "); + pc.printf("Time: %ld", agre_time); + pc.printf("\n"); + } + break; + case VMACHINE_INTER: + if (global_time >= CURRENT_URI){ + SyncStatus[VPACE] = agre_time; + CurrentState = VMACHINE_INITIAL; + pc.printf("VPace "); + pc.printf("Time: %ld", agre_time); + pc.printf("\n"); + } + break; + } + for(int trn=10; trn<=16; trn++) { + if(TRANS[trn].source == CurrentState){ + TRANS[trn].active = true; + }else{ + TRANS[trn].active = false; + } + if(TRANS[trn].active) { + if(EVAL_GUARD(trn)) { + if(TRANS[trn].syncid == NONE || agre_time - SyncStatus[TRANS[trn].syncid] < Broadcase_delay) { + CurrentState = TRANS[trn].dest; + ASSIGN(trn); + } + } + } + } + } +}