Rev 1627 | Rev 1629 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*
* Project: S.Ha.R.K.
*
* Coordinators:
* Giorgio Buttazzo <giorgio@sssup.it>
* Paolo Gai <pj@gandalf.sssup.it>
*
* Authors :
* Giacomo Guidi <giacomo@gandalf.sssup.ti>
*
* ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
*
* http://www.sssup.it
* http://retis.sssup.it
* http://shark.sssup.it
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "kernel/kern.h"
TASK elastic_test(void *arg) {
while(1) {
cprintf("X.");
task_endcycle();
}
}
int main(int argc, char **argv)
{
ELASTIC_TASK_MODEL e;
PID el_pid;
cprintf("Elastic Task Demo\n");
elastic_task_default_model(e);
elastic_task_def_period(e, 10000, 100000);
elastic_task_def_wcet(e, 4000);
elastic_task_def_param(e, 0, 0);
elastic_task_def_ctrl_jet(e);
elastic_task_def_usemath(e);
el_pid = task_create("Elastic Test",elastic_test,&e,NULL);
if (el_pid == NIL) {
cprintf("ERROR: Cannot create elastic task\n");
sys_end();
}
task_activate(el_pid);
while(sys_gettime(NULL) < 10000000);
sys_end();
return 0;
}