Skip to content

Commit 6d83147

Browse files
committed
Update main.c
1 parent 787dabf commit 6d83147

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

main.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int mainloop(){
142142
//Start of file code
143143
GPIO_CLR = 1<<GPI;
144144

145-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
145+
clock_gettime(CLOCK_REALTIME), &gettime_now);
146146
firstTime = gettime_now.tv_nsec;
147147
totalFirstTime = firstTime;
148148

@@ -153,27 +153,27 @@ int mainloop(){
153153
tempAddress = readMem(++regPC).data;
154154
instAddr |= (tempAddress << 12);
155155

156-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
156+
clock_gettime(CLOCK_REALTIME), &gettime_now);
157157
while((gettime_now.tv_nsec - firstTime) < period)
158-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
158+
clock_gettime(CLOCK_REALTIME), &gettime_now);
159159
GPIO_SET = 1<<GPI;
160160
firstTime = gettime_now.tv_nsec;
161161

162162
tempAddress = readMem(++regPC).data;
163163
instAddr |= (tempAddress << 8);
164164

165-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
165+
clock_gettime(CLOCK_REALTIME), &gettime_now);
166166
while((gettime_now.tv_nsec - firstTime) < period)
167-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
167+
clock_gettime(CLOCK_REALTIME), &gettime_now);
168168
GPIO_CLR = 1<<GPI;
169169
firstTime = gettime_now.tv_nsec;
170170

171171
tempAddress = readMem(++regPC).data;
172172
instAddr |= (tempAddress << 4);
173173

174-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
174+
clock_gettime(CLOCK_REALTIME), &gettime_now);
175175
while((gettime_now.tv_nsec - firstTime) < period)
176-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
176+
clock_gettime(CLOCK_REALTIME), &gettime_now);
177177
GPIO_SET = 1 <<GPI;
178178
firstTime = gettime_now.tv_nsec;
179179

@@ -182,9 +182,9 @@ int mainloop(){
182182
instAddr |= (tempAddress);
183183
regPC++;
184184

185-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
185+
clock_gettime(CLOCK_REALTIME), &gettime_now);
186186
while((gettime_now.tv_nsec - firstTime) < period)
187-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
187+
clock_gettime(CLOCK_REALTIME), &gettime_now);
188188
GPIO_CLR = 1<<GPI;
189189
firstTime = gettime_now.tv_nsec;
190190

@@ -208,9 +208,9 @@ int mainloop(){
208208
else
209209
shutdown(UNKNOWNINSTRUCTIONERROR);
210210

211-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
211+
clock_gettime(CLOCK_REALTIME), &gettime_now);
212212
while((gettime_now.tv_nsec - firstTime) < period)
213-
clock_gettime(CLOCK_MONOTONIC, &gettime_now);
213+
clock_gettime(CLOCK_REALTIME), &gettime_now);
214214
firstTime = gettime_now.tv_nsec;
215215

216216

0 commit comments

Comments
 (0)