Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double myList[100];
- int head, tail ;
- // Do not initialize inputs!
- void Init(void)
- {
- head = 0;
- tail = 0;
- }
- void Exec(void)
- {
- if(*v->En == 1){
- myList[tail] = *v->In;
- //tail = (tail+1)% v->Count;
- v->Out = myList[tail] - myList[head] ;
- v->head = head;
- v->tail = tail;
- if(tail + 1 >= v->Count) tail = 0; else tail++;
- if(tail == head)
- if(head+1 >= v->Count) head = 0; else head++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement