📄 setup.lst
字号:
695 4
696 4 }
697 3 else if(keynumber==CANCEL)terminatesetup();
698 3 else if(keynumber==NUMBER6)setmasterchangedisp();
699 3 else if(keynumber==NUMBER4)setbaudratedisp();
700 3 }
701 2 else
702 2 {
703 3 if((keynumber==ENTER)||(keynumber==CANCEL)||(keynumber==NUMBER0))
704 3 {
705 4 submenuflag=0;
706 4 seteventcleardisp();
707 4 }
708 3 else if(keynumber==NUMBER1)
709 3 {
710 4 submenuflag=0;
711 4 //Here clear the event
712 4 ram_writep0(EVENTSTART,0);
713 4 ram_writep0(EVENTSTART+1,0);
714 4 ram_writep0(EVENTSTOP,0);
715 4 ram_writep0(EVENTSTOP+1,0);
716 4
717 4 seteventcleardisp();
718 4 }
719 3 }
720 2 }
721 1 }
722 /////////////////////////////////////////////////////////////////////////////////////
723 void setmasterchangedisp()
724 {
725 1 if(!submenuflag)
726 1 {
727 2 setupitem=SETMASTERCHANGE;
728 2 displaymessage(LMMASTERCHANGE,LINE1);
729 2 displaymessage(LMBLANK,LINE2);
730 2 }
731 1 else
732 1 {
733 2 if(!submenu1flag)
734 2 {
735 3 displaymessage(LMINPUTNEWMASTER,LINE1);
736 3 displaymessage(LMINPUTMASTERID,LINE2);
C51 COMPILER V7.01 SETUP 03/08/2007 12:09:38 PAGE 13
737 3 lcdcuron(MASTERIDSTARTP,LINE2);
738 3 }
739 2 else
740 2 {
741 3 }
742 2
743 2 }
744 1
745 1 }
746 /////////////////////////////////////////////////////////////////////////////////////
747 void removenormaluser()
748 {
749 1 getidfromlcd();
750 1 if(getuserbyid())
751 1 {
752 2 deleteuserbysn();
753 2 rdeleteuserbysn();
754 2 }
755 1 else
756 1 {
757 2 _nop_();
758 2 }
759 1 }
760 /////////////////////////////////////////////////////////////////////////////////////
761 unsigned char deleteoldmaster()
762 {
763 1 unsigned char i;
764 1 if(readmasterchange())
765 1 {
766 2 if(readfpmode())
767 2 {
768 3 displaymessage(LMBLANK,LINE2);
769 3 displaymessage(LMPUTOLDMASTERFP,LINE1);
770 3 delayTimerh(TMSGWAITTIME);
771 3
772 3 if(!capturecheckimage()) return MASTERFPERR;
773 3 if(!rextractfeature(3,0)) return MASTERFPERR;
774 3
775 3 currentsn=0x9999; //master's sn
776 3
777 3 if(!rfinduserbysn()) return MASTERFPERR;
778 3
779 3 if(!rdeleteuserbysn()) return DELETEMASTERERR;
780 3
781 3 for(i=0;i<8;i++)tempbuff[i]=0xff;
782 3 writeuserdata(MAXUSERNUM+20);
783 3
784 3 ram_writep0(MASTERCHANGED,0); //clear master changed flag
785 3
786 3 return DELETEMASTEROK;
787 3
788 3 }
789 2 }
790 1 else
791 1 return TRUE;
792 1 }
793 /////////////////////////////////////////////////////////////////////////////////////
794 void setmasterchange()
795 {
796 1 if(keynumber==0xff)setmasterchangedisp();
797 1 else
798 1 {
C51 COMPILER V7.01 SETUP 03/08/2007 12:09:38 PAGE 14
799 2 if(!submenuflag)
800 2 {
801 3 if(keynumber==ENTER)
802 3 {
803 4 clearsetup();
804 4 submenuflag=1;
805 4
806 4 //displaymessage(LMINPUTNEWMASTER,LINE1);
807 4 //displaymessage(LMINPUTMASTERID,LINE2);
808 4 //l/cdcur(MASTERIDSTARTP,LINE2);
809 4 if(readmasterchange())
810 4 {
811 5 if(readfpmode())
812 5 {
813 6 if(deleteoldmaster()==DELETEMASTEROK)
814 6 {
815 7 setmasterchangedisp();
816 7 }
817 6 else
818 6 {
819 7 displaymessage(LMBLANK,LINE1);
820 7 displaymessage(LMFINGERERR,LINE2);
821 7 delayTimerh(TMSGWAITTIME);
822 7 clearsetup();
823 7 setmasterchangedisp();
824 7 }
825 6 }
826 5 }
827 4 setmasterchangedisp();
828 4
829 4
830 4 }
831 3 else if(keynumber==CANCEL)terminatesetup();
832 3 else if(keynumber==NUMBER6)setsysinitdisp();
833 3 else if(keynumber==NUMBER4)seteventcleardisp();
834 3 }
835 2 else
836 2 {
837 3 if(!submenu1flag)
838 3 {
839 4 if(keynumber==ENTER)
840 4 {
841 5
842 5 if(setcount>=MINUSERIDLEN)
843 5 {
844 6 submenu1flag=1;
845 6 subsetcount=0;
846 6 //getidfromlcd();
847 6 //if(!getuserbyid())
848 6 //{
849 6 // //deleteuserbysn();
850 6 // rdeleteuserbysn();
851 6 //}
852 6 removenormaluser();
853 6 setcount=0;
854 6 displaymessage(LMMASTERPASS,LINE1);
855 6 displaymessage(LMMASTERPASSIN,LINE2);
856 6 lcdcuron(MASTERPASSSTARTP,LINE2);
857 6 }
858 5 }
859 4 else if(keynumber==CANCEL)
860 4 {
C51 COMPILER V7.01 SETUP 03/08/2007 12:09:38 PAGE 15
861 5 clearsetup();
862 5 setmasterchangedisp();
863 5 }
864 4 else
865 4 {
866 5
867 5 dispbuff[LINE2][MASTERIDSTARTP+setcount]=keynumber+0x30;
868 5 setcount++;
869 5 display(LINE2);
870 5 lcdcuron(MASTERIDSTARTP+setcount,LINE2);
871 5
872 5 if(setcount>=8)
873 5 {
874 6 submenu1flag=1;
875 6 subsetcount=0;
876 6 //registerid();
877 6 removenormaluser();
878 6 displaymessage(LMMASTERPASS,LINE1);
879 6 displaymessage(LMMASTERPASSIN,LINE2);
880 6 }
881 5 }
882 4 }
883 3 else
884 3 {
885 4 if(keynumber==ENTER)
886 4 {
887 5 }
888 4 else if(keynumber==CANCEL)
889 4 {
890 5 displaymessage(LMMASTERCHANGEFAIL,LINE1); //051011
891 5 displaymessage(LMMASTERBACKTO0,LINE2); //051011
892 5 delayTimerh(TMSGWAITTIME); //051011
893 5 ram_writep0(MASTERCHANGED,0); //051011
894 5
895 5 clearsetup();
896 5 setmasterchangedisp();
897 5
898 5 }
899 4 else
900 4 {
901 5 dispbuff[LINE2][setcount+MASTERPASSSTARTP]=keynumber+0x30;
902 5 display(LINE2);
903 5 keybuff[setcount]=keynumber;
904 5 setcount++;
905 5 lcdcuron(MASTERPASSSTARTP+setcount,LINE2);
906 5 if(setcount>=4)
907 5 {
908 6 keybuff[0]=(keybuff[0]<<4)+keybuff[1];
909 6 keybuff[1]=(keybuff[2]<<4)+keybuff[3];
910 6
911 6 tempbuff[0]=userid[0];
912 6 tempbuff[1]=userid[1];
913 6 tempbuff[2]=userid[2];
914 6 tempbuff[3]=userid[3];
915 6 tempbuff[4]=keybuff[0];
916 6 tempbuff[5]=keybuff[1];
917 6 tempbuff[6]=0x55;
918 6 tempbuff[7]=0xaa;
919 6 writeuserdata(MASTERUSERSN);
920 6 ram_writep0(MASTERCHANGED,1);
921 6
922 6 if(readfpmode())
C51 COMPILER V7.01 SETUP 03/08/2007 12:09:38 PAGE 16
923 6 {
924 7 currentsn=0x9999;
925 7 if(registerfp())
926 7 {
927 8 displaymessage(LMBLANK,LINE1);
928 8 displaymessage(LMMASTERCHANGEOK,LINE2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -