Przeglądaj źródła

Can now always kill emulator with ctrl+c

Thomas Buck 12 lat temu
rodzic
commit
981be1519a
1 zmienionych plików z 9 dodań i 9 usunięć
  1. 9
    9
      HardwareEmulator/main.c

+ 9
- 9
HardwareEmulator/main.c Wyświetl plik

@@ -141,7 +141,7 @@ int recieveFrames() {
141 141
 	}
142 142
 
143 143
 	printf("AnimationCount");
144
-	while (1) {
144
+	while (keepRunning) {
145 145
 		size = serialRead(&c, 1);
146 146
 		if (size == 1) {
147 147
 			break;
@@ -161,7 +161,7 @@ int recieveFrames() {
161 161
 
162 162
 	for (a = 0; a < animCount; a++) {
163 163
 		printf("FrameCount");
164
-		while (1) {
164
+		while (keepRunning) {
165 165
 			size = serialRead(&c, 1);
166 166
 			if (size == 1) {
167 167
 				break;
@@ -181,7 +181,7 @@ int recieveFrames() {
181 181
 
182 182
 		for (f = 0; f < frameCount; f++) {
183 183
 			printf("Duration");
184
-			while (1) {
184
+			while (keepRunning) {
185 185
 				size = serialRead(&c, 1);
186 186
 				if (size == 1) {
187 187
 					break;
@@ -195,7 +195,7 @@ int recieveFrames() {
195 195
 
196 196
 			printf("Data...");
197 197
 			for (d = 0; d < 64; d++) {
198
-				while (1) {
198
+				while (keepRunning) {
199 199
 					size = serialRead(&c, 1);
200 200
 					if (size == 1) {
201 201
 						break; // We got our data byte
@@ -217,7 +217,7 @@ int recieveFrames() {
217 217
 		}
218 218
 	}
219 219
 
220
-	while (1) {
220
+	while (keepRunning) {
221 221
 		size = serialRead(&c, 1);
222 222
 		if (size == 1) {
223 223
 			break;
@@ -226,7 +226,7 @@ int recieveFrames() {
226 226
 			return -1;
227 227
 		}
228 228
 	}
229
-	while (1) {
229
+	while (keepRunning) {
230 230
 		size = serialRead(&c, 1);
231 231
 		if (size == 1) {
232 232
 			break;
@@ -235,7 +235,7 @@ int recieveFrames() {
235 235
 			return -1;
236 236
 		}
237 237
 	}
238
-	while (1) {
238
+	while (keepRunning) {
239 239
 		size = serialRead(&c, 1);
240 240
 		if (size == 1) {
241 241
 			break;
@@ -244,7 +244,7 @@ int recieveFrames() {
244 244
 			return -1;
245 245
 		}
246 246
 	}
247
-	while (1) {
247
+	while (keepRunning) {
248 248
 		size = serialRead(&c, 1);
249 249
 		if (size == 1) {
250 250
 			break;
@@ -283,7 +283,7 @@ int serialWriteTry(char *data, size_t length) {
283 283
 	int i = 0;
284 284
 	int written = 0;
285 285
 	int ret;
286
-	while (1) {
286
+	while (keepRunning) {
287 287
 		ret = serialWrite((data + written), (length - written));
288 288
 		if (ret == -1) {
289 289
 			i++;

Ładowanie…
Anuluj
Zapisz