📄 copy.lst
字号:
577 1 feedStartI2c ();
578 1 feedSend_byte (sla);
579 1 if(ack == 0)return (0);
580 1 feedSend_byte(suba / 256); // the high byte address
581 1 if(ack == 0)return (0);
582 1 feedSend_byte(suba % 256); // the low byte address
583 1 if(ack == 0)return (0);
584 1 for( i = 0; i < no-1 ;i ++)
585 1 {
586 2 feedSend_byte(*s);
587 2 if(ack == 0)return (0);
588 2 s++;
589 2 }
590 1 feedSend_byte(*s);
591 1 feedStopI2c();
592 1
593 1 return (1);
594 1 }
595 /*bit JUBU_location_check()
596 {
597
598
599 uchar BitCnt;
600 uchar c = 0xa0;
601 jubuStartI2c();
602
603 for( BitCnt = 0; BitCnt < 8; BitCnt ++ )
604 {
605 if((c << BitCnt) & 0x80) SDA1 = 1;
606
607 else
608
609 SDA1 =0;
610
611 _Nop();
612 _Nop();
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 11
613 SCL = 1;
614 _Nop();
615 _Nop();
616 _Nop();
617 _Nop();
618 _Nop();
619 _Nop();
620 _Nop();
621 SCL = 0;
622 _Nop();
623 _Nop();
624 _Nop();
625 }
626 _Nop();
627 _Nop();
628 _Nop();
629 SDA1 =1;
630
631 _Nop();
632 _Nop();
633 _Nop();
634 _Nop();
635 SCL = 1;
636 _Nop();
637 _Nop();
638 _Nop();
639 _Nop();
640 _Nop();
641 _Nop();
642 if(SDA1==0) CONTR = SDA1;
643 else
644
645 ALM=1;
646 SCL = 0;
647 _Nop();
648 _Nop();
649 _Nop();
650
651 jubuStopI2c();
652 return (1);
653
654 }*/
655 //////////////////////////////////////
656 bit JUBU0_location_check(void)
657 {
658 1
659 1
660 1 uchar BitCnt;
661 1 uchar c = 0xa0;
662 1 jubuStartI2c();
663 1
664 1 for( BitCnt = 0; BitCnt < 8; BitCnt ++ )
665 1 {
666 2 if((c << BitCnt) & 0x80) SDA1 = 1;
667 2
668 2 else
669 2
670 2 SDA1 =0;
671 2
672 2 _Nop();
673 2 _Nop();
674 2 SCL = 1;
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 12
675 2 _Nop();
676 2 _Nop();
677 2 _Nop();
678 2 _Nop();
679 2 _Nop();
680 2 _Nop();
681 2 _Nop();
682 2 SCL = 0;
683 2 _Nop();
684 2 _Nop();
685 2 _Nop();
686 2 }
687 1 _Nop();
688 1 _Nop();
689 1 _Nop();
690 1 SDA1 =1;
691 1
692 1 _Nop();
693 1 _Nop();
694 1 _Nop();
695 1 _Nop();
696 1 SCL = 1;
697 1 _Nop();
698 1 _Nop();
699 1 _Nop();
700 1 _Nop();
701 1 _Nop();
702 1 _Nop();
703 1 if(SDA1==0) LED2 = SDA1;
704 1 else
705 1 ALM=1;
706 1 SCL = 0;
707 1 _Nop();
708 1 _Nop();
709 1 _Nop();
710 1
711 1 jubuStopI2c();
712 1 return (1);
713 1
714 1 }
715 ////////////////////////////////////////
716 bit feed_jubu_location_check()
717 {
718 1
719 1
720 1 uchar BitCnt;
721 1 uchar c = 0xa0;
722 1 feedStartI2c();
723 1
724 1 for( BitCnt = 0; BitCnt < 8; BitCnt ++ )
725 1 {
726 2 if((c << BitCnt) & 0x80) SDA9 = 1;
727 2
728 2 else
729 2
730 2 SDA9 =0;
731 2
732 2 _Nop();
733 2 _Nop();
734 2 SCL = 1;
735 2 _Nop();
736 2 _Nop();
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 13
737 2 _Nop();
738 2 _Nop();
739 2 _Nop();
740 2 _Nop();
741 2 _Nop();
742 2 SCL = 0;
743 2 _Nop();
744 2 _Nop();
745 2 _Nop();
746 2 }
747 1 _Nop();
748 1 _Nop();
749 1 _Nop();
750 1 SDA9 =1;
751 1
752 1 _Nop();
753 1 _Nop();
754 1 _Nop();
755 1 _Nop();
756 1 SCL = 1;
757 1 _Nop();
758 1 _Nop();
759 1 _Nop();
760 1 _Nop();
761 1 _Nop();
762 1 _Nop();
763 1 if(SDA9==0) LED2 = SDA9;
764 1 else
765 1 {while(1){LED2=0;delay(500);LED2=1;delay(500);}}
766 1 SCL = 0;
767 1 _Nop();
768 1 _Nop();
769 1 _Nop();
770 1
771 1 feedStopI2c();
772 1 return (1);
773 1
774 1 }
775 ///////////////////////////////////////////
776 bit feed_space_check()
777 {
778 1 uchar BitCnt; //+zcq 20040518
779 1
780 1 //-zcq 20040518 uchar BitCnt, test[6];
781 1 uchar c = 0xa2;
782 1 feedStartI2c();
783 1
784 1 for( BitCnt = 0; BitCnt < 8; BitCnt ++ )
785 1 {
786 2 if((c << BitCnt) & 0x80) SDA9 = 1;
787 2 else SDA9 = 0;
788 2
789 2 _Nop();
790 2 _Nop();
791 2 SCL = 1;
792 2 _Nop();
793 2 _Nop();
794 2 _Nop();
795 2 _Nop();
796 2 _Nop();
797 2 _Nop();
798 2 SCL = 0;
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 14
799 2 _Nop();
800 2 _Nop();
801 2 }
802 1 _Nop();
803 1 _Nop();
804 1 SDA9 = 1;
805 1
806 1 _Nop();
807 1 _Nop();
808 1 _Nop();
809 1 SCL = 1;
810 1 _Nop();
811 1 _Nop();
812 1 _Nop();
813 1 _Nop();
814 1 _Nop();
815 1 _Nop();
816 1 if( SDA9 == 0 )
817 1 {
818 2 feed_space = 'm';
819 2 SCL = 0;
820 2 _Nop();
821 2 _Nop();
822 2 _Nop();
823 2
824 2 feedStopI2c(); //
825 2 return (1);
826 2 }
827 1 else
828 1 {
829 2 SCL = 0;
830 2 _Nop();
831 2 _Nop();
832 2 _Nop();
833 2
834 2 feedStopI2c(); //
835 2
836 2 feed_space = 'o';
837 2
838 2 return (1);
839 2 }
840 1
841 1 }
842 ///////////////////////////////
843 void TIMER0(void) interrupt 1 using 2
844 {
845 1
846 1 TH0=0x87;
847 1 TL0=0x58;
848 1 P0=SEG[MODE1];
849 1 P3=0xfe; //11111110
850 1 delay2(1);
851 1 P0=SEG[LENG_LO];
852 1 P3=0xfd; //11111101
853 1 delay2(1);
854 1 P0=SEG[LENG_HI];
855 1 P3=0xfb;//11111011
856 1 delay2(2);
857 1 P0=SEG[LOL];
858 1 P3=0XF7;//11110111
859 1 delay2(2);
860 1 P0=SEG[LOH];
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 15
861 1 P3=0xef; //11101111
862 1 delay2(1);
863 1 P0=SEG[HIL];
864 1 P3=0Xdf; //11011111
865 1 delay2(1);
866 1 P0=SEG[HIH];
867 1 P3=0xbf;//10111111
868 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -