📄 main.lst
字号:
226 4 *pKeyCode=cKeyCodeReceive;
227 4
228 4 cKeyCodeReceiveState=0; //取走键盘码
229 4 ++x;
230 4 }while(x!=9); //读码结束标志
231 3
232 3
233 3
234 3
235 3 } //end case while rotate
236 2 break; //finish case
237 2
238 2
239 2 case PELCOP:
240 2 while(1)
241 2 {
C51 COMPILER V8.01 MAIN 12/13/2008 17:52:30 PAGE 5
242 3
243 3 WdtCls();
244 3 if(PELCOP!=cProtocol) // 利用协议出错处理
245 3 goto ERRor;
246 3 if(!cKeyCodeReceiveState) continue;
247 3
248 3 if(0xa0!=cKeyCodeReceive)
249 3 {
250 4 cKeyCodeReceiveState=0;
251 4 continue; //首码错则结束 进 入 循 环
252 4 }
253 3
254 3 cKeyCodeReceiveState=0;
255 3 while(!cKeyCodeReceiveState)
256 3 {
257 4 WdtCls();
258 4
259 4 }
260 3
261 3
262 3 if( cKeyCodeReceive!=id) //说明是正确的键盘码转入处理程序
263 3
264 3 { //不是本球机的接收码ID不正确或者是一误码都必须会结束
265 4 cKeyCodeReceiveState=0;
266 4 continue; //处理并且清除接收标志
267 4 }
268 3
269 3
270 3
271 3 x=2;
272 3 pKeyCode=sKeyCode;
273 3 *pKeyCode=0xa0; //起始同步码
274 3
275 3 ++pKeyCode;
276 3 *pKeyCode=id; //ID码
277 3
278 3 cKeyCodeReceiveState=0;//已取走第2个码
279 3 do
280 3 {
281 4 // x=x+*pKeyCode ; //从第二个开始累加校验
282 4 while(!cKeyCodeReceiveState) //读码等待
283 4 {
284 5 _nop_();
285 5 }
286 4 ++pKeyCode;
287 4 *pKeyCode=cKeyCodeReceive;
288 4
289 4 cKeyCodeReceiveState=0; //取走键盘码
290 4 ++x;
291 4 }while(x!=8); //读码结束标志
292 3
293 3
294 3
295 3 } //end case while rotate
296 2 break; //finish case
297 2
298 2 case B01:
299 2
300 2 while(1)
301 2 {
302 3
303 3 WdtCls();
C51 COMPILER V8.01 MAIN 12/13/2008 17:52:30 PAGE 6
304 3 if(B01!=cProtocol) // 利用协议出错处理
305 3 goto ERRor;
306 3 if(!cKeyCodeReceiveState) continue;
307 3
308 3 if(0xa0!=cKeyCodeReceive)
309 3 {
310 4 cKeyCodeReceiveState=0;
311 4 continue; //首码错则结束 进 入 循 环
312 4 }
313 3
314 3 cKeyCodeReceiveState=0;
315 3 while(!cKeyCodeReceiveState)
316 3 {
317 4 WdtCls();
318 4
319 4 }
320 3
321 3
322 3 if( cKeyCodeReceive!=id) //说明是正确的键盘码转入处理程序
323 3
324 3 { //不是本球机的接收码ID不正确或者是一误码都必须会结束
325 4 cKeyCodeReceiveState=0;
326 4 continue; //处理并且清除接收标志
327 4 }
328 3
329 3
330 3
331 3 x=2;
332 3 pKeyCode=sKeyCode;
333 3 *pKeyCode=0xa0; //起始同步码
334 3 ++pKeyCode;
335 3 *pKeyCode=id; //ID码
336 3
337 3 cKeyCodeReceiveState=0;//已取走第2个码
338 3 do
339 3 {
340 4 // x=x+*pKeyCode ; //从第二个开始累加校验
341 4 while(!cKeyCodeReceiveState) //读码等待
342 4 {
343 5 _nop_();
344 5 }
345 4 ++pKeyCode;
346 4 *pKeyCode=cKeyCodeReceive;
347 4
348 4 cKeyCodeReceiveState=0; //取走键盘码
349 4 ++x;
350 4 }while(x!=11); //读码结束标志
351 3
352 3
353 3
354 3
355 3 } //end case while rotate
356 2 break; //finish case
357 2
358 2 while(1)
359 2 {
360 3
361 3 WdtCls();
362 3 if(YAAN!=cProtocol) // 利用协议出错处理
363 3 goto ERRor;
364 3 if(!cKeyCodeReceiveState) continue;
365 3
C51 COMPILER V8.01 MAIN 12/13/2008 17:52:30 PAGE 7
366 3 if(0x02!=cKeyCodeReceive)
367 3 {
368 4 cKeyCodeReceiveState=0;
369 4 continue; //首码错则结束 进 入 循 环
370 4 }
371 3
372 3 cKeyCodeReceiveState=0;
373 3 while(!cKeyCodeReceiveState)
374 3 {
375 4 WdtCls();
376 4
377 4 }
378 3
379 3
380 3 if( cKeyCodeReceive!=id) //说明是正确的键盘码转入处理程序
381 3
382 3 { //不是本球机的接收码ID不正确或者是一误码都必须会结束
383 4 cKeyCodeReceiveState=0;
384 4 continue; //处理并且清除接收标志
385 4 }
386 3
387 3 pKeyCode=sKeyCode;
388 3 *pKeyCode=0x02; //起始同步码
389 3
390 3 ++pKeyCode;
391 3 *pKeyCode=id; //ID码
392 3
393 3 cKeyCodeReceiveState=0;//已取走第2个码
394 3 while(!cKeyCodeReceiveState) //读码等待
395 3 {
396 4 _nop_();
397 4 }
398 3 ++pKeyCode;
399 3 *pKeyCode=cKeyCodeReceive;
400 3
401 3 cKeyCodeReceiveState=0; //取走键盘码
402 3 if((sKeyCode[2]>1)&&(sKeyCode[2]<12))
403 3 {
404 4 while(!cKeyCodeReceiveState) //读码等待
405 4 {
406 5 _nop_();
407 5 }
408 4 ++pKeyCode;
409 4 *pKeyCode=cKeyCodeReceive;
410 4
411 4 cKeyCodeReceiveState=0; //取走键盘码
412 4 while(!cKeyCodeReceiveState) //读码等待
413 4 {
414 5 _nop_();
415 5 }
416 4 ++pKeyCode;
417 4 *pKeyCode=cKeyCodeReceive;
418 4
419 4 cKeyCodeReceiveState=0; //取走键盘码
420 4 }
421 3 else
422 3 {
423 4 while(!cKeyCodeReceiveState) //读码等待
424 4 {
425 5 _nop_();
426 5 }
427 4 ++pKeyCode;
C51 COMPILER V8.01 MAIN 12/13/2008 17:52:30 PAGE 8
428 4 *pKeyCode=cKeyCodeReceive;
429 4
430 4 cKeyCodeReceiveState=0; //取走键盘码
431 4 while(!cKeyCodeReceiveState) //读码等待
432 4 {
433 5 _nop_();
434 5 }
435 4 ++pKeyCode;
436 4 *pKeyCode=cKeyCodeReceive;
437 4
438 4 cKeyCodeReceiveState=0; //取走键盘码
439 4 while(!cKeyCodeReceiveState) //读码等待
440 4 {
441 5 _nop_();
442 5 }
443 4 ++pKeyCode;
444 4 *pKeyCode=cKeyCodeReceive;
445 4
446 4 cKeyCodeReceiveState=0; //取走键盘码
447 4 }
448 3
449 3
450 3
451 3
452 3
453 3 } //end case while rotate
454 2 break; //finish case
455 2
456 2
457 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -