0
|
1 #include <stdio.h>
|
|
2 #include "SchedTaskArray.h"
|
|
3 #include "Twice.h"
|
|
4 #include "Func.h"
|
|
5
|
|
6 /* これは必須 */
|
|
7 SchedDefineTask1(Twice,twice_run);
|
|
8
|
|
9 static int
|
|
10 twice_run(SchedTask *s,void *rbuf, void *wbuf)
|
|
11 {
|
|
12 // SchedTaskArray *a = (SchedTaskArray *)s;
|
|
13
|
|
14 int *i_data;
|
|
15 int *o_data;
|
|
16 long length;
|
|
17 long count = (long)s->get_param(0);
|
|
18
|
|
19 for(int j = 0; j<count; j++) {
|
|
20 i_data = (int*)s->get_input(rbuf, j);
|
|
21 o_data = (int*)s->get_output(wbuf, j);
|
|
22 length = (long)s->get_param(j+1);
|
|
23
|
|
24 for (int i = 0; i < length; i++) {
|
|
25 o_data[i] = i_data[i] * 2;
|
|
26 }
|
|
27 }
|
|
28
|
|
29 return 0;
|
|
30 }
|