Mercurial > hg > Members > nobuyasu > CbC
diff temporal_logic/hoge.cbc @ 10:972515f10c1d draft
add some files
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 03 Jun 2012 22:09:13 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/temporal_logic/hoge.cbc Sun Jun 03 22:09:13 2012 +0900 @@ -0,0 +1,20 @@ +#include <stdio.h> +#include "hoge.h" +#include "task.h" + +code increment(PktPtr pkt, TaskPtr current_task) +{ + pkt->val++; + printf("inc: %d\n", pkt->val); + pkt->next = modulo; + goto scheduler(pkt, current_task); +} + +code modulo(PktPtr pkt, TaskPtr current_task) +{ + // pkt->val %= 10; + pkt->val = pkt->val % 10; + printf("mod: %d\n", pkt->val); + pkt->next = increment; + goto scheduler(pkt, current_task); +}