Subversion Repositories shark

Rev

Rev 1628 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1627 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Giacomo Guidi       <giacomo@gandalf.sssup.ti>
10
 *
11
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
12
 *
13
 * http://www.sssup.it
14
 * http://retis.sssup.it
15
 * http://shark.sssup.it
16
 */
17
 
18
/*
19
 * This program is free software; you can redistribute it and/or modify
20
 * it under the terms of the GNU General Public License as published by
21
 * the Free Software Foundation; either version 2 of the License, or
22
 * (at your option) any later version.
23
 *
24
 * This program is distributed in the hope that it will be useful,
25
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27
 * GNU General Public License for more details.
28
 *
29
 * You should have received a copy of the GNU General Public License
30
 * along with this program; if not, write to the Free Software
31
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32
 */
33
 
34
#include "kernel/kern.h"
35
 
36
TASK elastic_test(void *arg) {
37
 
38
  while(1) {
39
 
40
    cprintf("X.");
41
 
42
    task_endcycle();
43
 
44
  }
45
 
46
}
47
 
48
int main(int argc, char **argv)
49
{
50
 
51
  ELASTIC_TASK_MODEL e;
52
  PID el_pid;
53
 
54
  elastic_task_default_model(e);
55
  elastic_task_def_period(e, 10000, 100000);
56
  elastic_task_def_wcet(e, 4000);
57
  elastic_task_def_param(e, 0, 0);
58
  elastic_task_def_ctrl_jet(e);
59
  elastic_task_def_usemath(e);
60
 
61
  el_pid = task_create("Elastic Test",elastic_test,&e,NULL);
62
  if (el_pid == NIL) {
63
    cprintf("ERROR: Cannot create elastic task\n");
64
    sys_end();
65
  }
66
 
67
  task_activate(el_pid);
68
 
69
  return 0;
70
 
71
}