-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMemory_Module.c
More file actions
44 lines (33 loc) · 860 Bytes
/
Memory_Module.c
File metadata and controls
44 lines (33 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdlib.h>
#include <stdio.h>
#include "Temp_Module.h"
#include "Memory_Module.h"
#include "at91sam3x8.h"
int Temp_Node_Size = sizeof(Temp_Node);
Temp_Node *head;
Temp_Node *tail;
Temp_Node *first_node;
Temp_Node *last_node;
void Init_Memory(void){
head = (Temp_Node*)malloc(sizeof(Temp_Node_Size));
Temp_Node *temp_node;
Temp_Node *New_Node;
temp_node = head;
New_Node = (Temp_Node *)malloc(Temp_Node_Size);
do{
temp_node->next = New_Node;
temp_node = temp_node->next;
last_node = temp_node;
New_Node = (Temp_Node *)malloc(Temp_Node_Size);
}while(New_Node!= NULL);
tail = head;
first_node = head;
last_node->next = head;
}
void Add_Day_To_Memory(Day theDay){
tail->day = theDay;
if(tail->next == head){
head = head->next;
}
tail = tail->next;
}