view 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 source

#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);
}