Browse Source

Can now always kill emulator with ctrl+c

Thomas Buck 12 years ago
parent
commit
981be1519a
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      HardwareEmulator/main.c

+ 9
- 9
HardwareEmulator/main.c View File

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

Loading…
Cancel
Save