⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.mil

📁 An applicaion that utilize a fingerprint scanner to turn off the PC
💻 MIL
📖 第 1 页 / 共 2 页
字号:
_Show_Splash_message:
  begin
//main.c,17 :: 		LCD_Out(1,1,"  FINGER PRINT  ");
	FARG_LCD_Out+0 <- 1
	FARG_LCD_Out+1 <- 1
	FARG_LCD_Out+2 <- 0
	CALL _LCD_Out
//main.c,18 :: 		LCD_Out(2,1,"   ENROLLMENT   ");
	FARG_LCD_Out+0 <- 2
	FARG_LCD_Out+1 <- 1
	FARG_LCD_Out+2 <- 0
	CALL _LCD_Out
  end

_Show_Welcome_String:
  begin
//main.c,23 :: 		LCD_Out(1,1,"    WELCOME!    ");
	FARG_LCD_Out+0 <- 1
	FARG_LCD_Out+1 <- 1
	FARG_LCD_Out+2 <- 0
	CALL _LCD_Out
  end

_Show_EEPROM_Stored_Messages:
  begin
//main.c,29 :: 		column = 1;
	Show_EEPROM_Stored_Messages_column_L0 <- 1
//main.c,30 :: 		while (column < 17)
L_Show_EEPROM_Stored_Messages_0:
	if ( Show_EEPROM_Stored_Messages_column_L0 >= 17) then goto L_Show_EEPROM_Stored_Messages_1
//main.c,32 :: 		buffer = EEprom_Read(location);
	FARG_EEprom_read+0 <- FARG_Show_EEPROM_Stored_Messages+1
	CALL _EEprom_read
	_buffer <- STACK_0
//main.c,33 :: 		LCD_Chr(row,column,buffer);
	FARG_Lcd_Chr+0 <- FARG_Show_EEPROM_Stored_Messages+0
	FARG_Lcd_Chr+1 <- Show_EEPROM_Stored_Messages_column_L0
	FARG_Lcd_Chr+2 <- STACK_0
	CALL _Lcd_Chr
//main.c,34 :: 		location++;
	FARG_Show_EEPROM_Stored_Messages+1 <-  FARG_Show_EEPROM_Stored_Messages+1 + 1
	FARG_Show_EEPROM_Stored_Messages+1 <- FARG_Show_EEPROM_Stored_Messages+1
//main.c,35 :: 		column++;
	Show_EEPROM_Stored_Messages_column_L0 <-  Show_EEPROM_Stored_Messages_column_L0 + 1
	Show_EEPROM_Stored_Messages_column_L0 <- Show_EEPROM_Stored_Messages_column_L0
//main.c,36 :: 		}
	goto	L_Show_EEPROM_Stored_Messages_0
L_Show_EEPROM_Stored_Messages_1:
  end

_Clear_Buffer_Registers:
  begin
//main.c,41 :: 		data_frame[0] = 0;
	_data_frame <- 0
//main.c,42 :: 		data_frame[1] = 0;
	_data_frame+1 <- 0
//main.c,43 :: 		data_frame[2] = 0;
	_data_frame+2 <- 0
//main.c,44 :: 		data_frame[3] = 0;
	_data_frame+3 <- 0
//main.c,45 :: 		data_frame[4] = 0;
	_data_frame+4 <- 0
//main.c,46 :: 		data_frame[5] = 0;
	_data_frame+5 <- 0
//main.c,47 :: 		data_frame[6] = 0;
	_data_frame+6 <- 0
//main.c,48 :: 		data_frame[7] = 0;
	_data_frame+7 <- 0
  end

_Seconds_Delay:
  begin
//main.c,53 :: 		while (length > 0)
L_Seconds_Delay_2:
	if ( FARG_Seconds_Delay+0 <= 0) then goto L_Seconds_Delay_3
//main.c,55 :: 		Delay_ms(1000);
	asm: MOVLW	11
	asm: MOVWF	STACK_12
	asm: MOVLW	255
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_12,F
	asm: GOTO	$+2
	asm: GOTO	$+8
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: GOTO	$-9
	asm: MOVLW	51
	asm: MOVWF	STACK_11
	asm: MOVLW	255
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_11,F
	asm: GOTO	$+2
	asm: GOTO	$+4
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
	asm: GOTO	$-5
	asm: MOVLW	136
	asm: MOVWF	STACK_10
	asm: DECFSZ	STACK_10,F
	asm: GOTO	$-1
//main.c,56 :: 		length--;
	FARG_Seconds_Delay+0 <-  FARG_Seconds_Delay+0 - 1
	FARG_Seconds_Delay+0 <- FARG_Seconds_Delay+0
//main.c,57 :: 		}
	goto	L_Seconds_Delay_2
L_Seconds_Delay_3:
  end

_Transmit_Command_to_Scanner:
  begin
//main.c,62 :: 		count = 0;
	_count <- 0
//main.c,63 :: 		while (count < 8)
L_Transmit_Command_to_Scanner_4:
	if ( _count >= 8) then goto L_Transmit_Command_to_Scanner_5
//main.c,65 :: 		Usart_Write(data_frame[count]);
	FSR <-  0 + _count
	FARG_Usart_Write+0 <- *FSR
	FARG_Usart_Write+0 <- FARG_Usart_Write+0
	CALL _Usart_Write
//main.c,66 :: 		count++;
	_count <-  _count + 1
	_count <- _count
//main.c,67 :: 		}
	goto	L_Transmit_Command_to_Scanner_4
L_Transmit_Command_to_Scanner_5:
  end

_Receive_Response_from_Scanner:
  begin
//main.c,72 :: 		Clear_Buffer_Registers();
	CALL _Clear_Buffer_Registers
//main.c,73 :: 		count = 0;
	_count <- 0
//main.c,74 :: 		while (data_frame[count] != 0xf5)
L_Receive_Response_from_Scanner_6:
	FSR <-  0 + _count
	STACK_1 <- *FSR
	if ( STACK_1 = 245) then goto L_Receive_Response_from_Scanner_7
//main.c,76 :: 		if (PIR1.RCIF)
	if (!PIR1) then goto L_Receive_Response_from_Scanner_8
//main.c,78 :: 		data_frame[count] = Usart_Read();
	FLOC_Receive_Response_from_Scanner+0 <-  0 + _count
	CALL _Usart_Read
	*FLOC_Receive_Response_from_Scanner+0 <- STACK_0
//main.c,79 :: 		}
L_Receive_Response_from_Scanner_8:
//main.c,80 :: 		}
	goto	L_Receive_Response_from_Scanner_6
L_Receive_Response_from_Scanner_7:
//main.c,81 :: 		count++;
	_count <-  _count + 1
	_count <- _count
//main.c,82 :: 		while (count < 8)
L_Receive_Response_from_Scanner_9:
	if ( _count >= 8) then goto L_Receive_Response_from_Scanner_10
//main.c,84 :: 		if (PIR1.RCIF)
	if (!PIR1) then goto L_Receive_Response_from_Scanner_11
//main.c,86 :: 		data_frame[count] = Usart_Read();
	FLOC_Receive_Response_from_Scanner+0 <-  0 + _count
	CALL _Usart_Read
	*FLOC_Receive_Response_from_Scanner+0 <- STACK_0
//main.c,87 :: 		count++;
	_count <-  _count + 1
	_count <- _count
//main.c,88 :: 		}
L_Receive_Response_from_Scanner_11:
//main.c,89 :: 		}
	goto	L_Receive_Response_from_Scanner_9
L_Receive_Response_from_Scanner_10:
  end

_Boot_Computer:
  begin
//main.c,94 :: 		pc_supply_control = on;
	PORTC <-  PORTC | 8
//main.c,95 :: 		while (!pc_power_source)
L_Boot_Computer_12:
	if (PORTA) then goto L_Boot_Computer_13
//main.c,97 :: 		asm nop;
	asm: nop
//main.c,98 :: 		}
	goto	L_Boot_Computer_12
L_Boot_Computer_13:
//main.c,99 :: 		LCD_Cmd(LCD_CLEAR);
	FARG_Lcd_Cmd+0 <- 1
	CALL _Lcd_Cmd
//main.c,100 :: 		pc_supply_control = off;
	PORTC <-  PORTC & -9
//main.c,101 :: 		PWM_Stop();
	CALL _PWM_Stop
//main.c,102 :: 		while (pc_power_source)
L_Boot_Computer_14:
	if (!PORTA) then goto L_Boot_Computer_15
//main.c,104 :: 		asm nop;
	asm: nop
//main.c,105 :: 		}
	goto	L_Boot_Computer_14
L_Boot_Computer_15:
//main.c,106 :: 		clear_buffer_registers();
	CALL _Clear_Buffer_Registers
//main.c,107 :: 		PWM_Start();
	CALL _PWM_Start
  end

_Determine_Checksum_of_Data_frame:
  begin
//main.c,115 :: 		^ data_frame[2]
	_data_frame+6 <-  _data_frame+1 ^ _data_frame+2
//main.c,116 :: 		^ data_frame[3]
	_data_frame+6 <-  _data_frame+6 ^ _data_frame+3
//main.c,117 :: 		^ data_frame[4]
	_data_frame+6 <-  _data_frame+6 ^ _data_frame+4
//main.c,118 :: 		^ data_frame[5];
	_data_frame+6 <-  _data_frame+6 ^ _data_frame+5
	_data_frame+6 <- _data_frame+6
  end

_Construct_Scanner_Command:
  begin
//main.c,123 :: 		data_frame[0] = header;
	_data_frame <- 245
//main.c,124 :: 		data_frame[5] = 0;
	_data_frame+5 <- 0
//main.c,125 :: 		data_frame[7] = header;
	_data_frame+7 <- 245
//main.c,126 :: 		Determine_Checksum_of_Data_frame();
	CALL _Determine_Checksum_of_Data_frame
  end

_Delete_Specific_User:
  begin
//main.c,131 :: 		data_frame[1] = 0x04; // delete user command
	_data_frame+1 <- 4
//main.c,132 :: 		data_frame[2] = 0; // this byte is MSB of the user number
	_data_frame+2 <- 0
//main.c,133 :: 		data_frame[3] = number; // this byte is LSB of the user number
	_data_frame+3 <- FARG_Delete_Specific_User+0
//main.c,134 :: 		data_frame[4] = 0;
	_data_frame+4 <- 0
//main.c,135 :: 		Construct_Scanner_Command();
	CALL _Construct_Scanner_Command
//main.c,136 :: 		retry1:Transmit_Command_to_Scanner();
___Delete_Specific_User_retry1:
	CALL _Transmit_Command_to_Scanner
//main.c,137 :: 		Receive_Response_from_Scanner();
	CALL _Receive_Response_from_Scanner
//main.c,138 :: 		if (data_frame[4])
	if (_data_frame+4) then goto ___Delete_Specific_User_retry1
//main.c,141 :: 		}
L_Delete_Specific_User_16:
  end

_Disable_Scanners_Timeout:
  begin
//main.c,146 :: 		data_frame[1] = 0x2e; // change timeout command
	_data_frame+1 <- 46
//main.c,147 :: 		data_frame[2] = 0;
	_data_frame+2 <- 0
//main.c,148 :: 		data_frame[3] = 0; // timeout is disabled
	_data_frame+3 <- 0
//main.c,149 :: 		data_frame[4] = 0; // write data
	_data_frame+4 <- 0
//main.c,150 :: 		Construct_Scanner_Command();
	CALL _Construct_Scanner_Command
//main.c,151 :: 		retry2:Transmit_Command_to_Scanner();
___Disable_Scanners_Timeout_retry2:
	CALL _Transmit_Command_to_Scanner
//main.c,152 :: 		Receive_Response_from_Scanner();
	CALL _Receive_Response_from_Scanner
//main.c,153 :: 		if (data_frame[4])
	if (_data_frame+4) then goto ___Disable_Scanners_Timeout_retry2
//main.c,156 :: 		}
L_Disable_Scanners_Timeout_17:
  end

_Set_Enroll_Sampling_Counts:
  begin
//main.c,161 :: 		data_frame[1] = 0x2d; // enroll sampling command
	_data_frame+1 <- 45
//main.c,162 :: 		data_frame[2] = 0;
	_data_frame+2 <- 0
//main.c,163 :: 		data_frame[3] = 0;  //scan sample up to three times
	_data_frame+3 <- 0
//main.c,164 :: 		data_frame[4] = 0;  //write data
	_data_frame+4 <- 0
//main.c,165 :: 		Construct_Scanner_Command();
	CALL _Construct_Scanner_Command
//main.c,166 :: 		retry3:Transmit_Command_to_Scanner();
___Set_Enroll_Sampling_Counts_retry3:
	CALL _Transmit_Command_to_Scanner
//main.c,167 :: 		Receive_Response_from_Scanner();
	CALL _Receive_Response_from_Scanner
//main.c,168 :: 		if (data_frame[4])
	if (_data_frame+4) then goto ___Set_Enroll_Sampling_Counts_retry3
//main.c,171 :: 		}
L_Set_Enroll_Sampling_Counts_18:
  end

_Enroll_Users_Fingerprint:
  begin
//main.c,177 :: 		error = 0;
	Enroll_Users_Fingerprint_error_L0 <- 0
//main.c,178 :: 		Clear_Buffer_Registers();
	CALL _Clear_Buffer_Registers
//main.c,179 :: 		if (number <= 3)
	if ( FARG_Enroll_Users_Fingerprint+0 > 3) then goto L_Enroll_Users_Fingerprint_19
//main.c,181 :: 		Show_EEPROM_Stored_Messages(1,0x40);
	FARG_Show_EEPROM_Stored_Messages+0 <- 1
	FARG_Show_EEPROM_Stored_Messages+1 <- 64
	CALL _Show_EEPROM_Stored_Messages
//main.c,182 :: 		Show_EEPROM_Stored_Messages(2,0x50);
	FARG_Show_EEPROM_Stored_Messages+0 <- 2
	FARG_Show_EEPROM_Stored_Messages+1 <- 80
	CALL _Show_EEPROM_Stored_Messages
//main.c,183 :: 		}
L_Enroll_Users_Fingerprint_19:
//main.c,184 :: 		if (number >= 4)
	if ( FARG_Enroll_Users_Fingerprint+0 < 4) then goto L_Enroll_Users_Fingerprint_20
//main.c,186 :: 		Show_EEPROM_Stored_Messages(1,0x60);
	FARG_Show_EEPROM_Stored_Messages+0 <- 1
	FARG_Show_EEPROM_Stored_Messages+1 <- 96
	CALL _Show_EEPROM_Stored_Messages
//main.c,187 :: 		Show_EEPROM_Stored_Messages(2,0x70);
	FARG_Show_EEPROM_Stored_Messages+0 <- 2
	FARG_Show_EEPROM_Stored_Messages+1 <- 112
	CALL _Show_EEPROM_Stored_Messages
//main.c,188 :: 		}
L_Enroll_Users_Fingerprint_20:
//main.c,189 :: 		data_frame[1] = 0x01; //scan for the 1st time
	_data_frame+1 <- 1
//main.c,190 :: 		data_frame[2] = 0; // this byte is MSB of the user number
	_data_frame+2 <- 0
//main.c,191 :: 		data_frame[3] = number; // this byte is LSB of the user number
	_data_frame+3 <- FARG_Enroll_Users_Fingerprint+0
//main.c,192 :: 		data_frame[4] = 1;   // set priveledge to 1 (optional)
	_data_frame+4 <- 1
//main.c,193 :: 		Construct_Scanner_Command();
	CALL _Construct_Scanner_Command
//main.c,194 :: 		Transmit_Command_to_Scanner();
	CALL _Transmit_Command_to_Scanner
//main.c,195 :: 		Receive_Response_from_Scanner();
	CALL _Receive_Response_from_Scanner
//main.c,196 :: 		if (data_frame[4])
	if (!_data_frame+4) then goto L_Enroll_Users_Fingerprint_21
//main.c,198 :: 		error = 1;
	Enroll_Users_Fingerprint_error_L0 <- 1
//main.c,199 :: 		return error;
	STACK_0 <- 1
	return
//main.c,200 :: 		}
L_Enroll_Users_Fingerprint_21:
//main.c,201 :: 		LCD_Cmd(LCD_CLEAR);
	FARG_Lcd_Cmd+0 <- 1
	CALL _Lcd_Cmd
//main.c,202 :: 		Clear_Buffer_Registers();
	CALL _Clear_Buffer_Registers
//main.c,203 :: 		seconds_delay(1);
	FARG_Seconds_Delay+0 <- 1
	CALL _Seconds_Delay
//main.c,204 :: 		Show_EEPROM_Stored_Messages(1,0x80);
	FARG_Show_EEPROM_Stored_Messages+0 <- 1
	FARG_Show_EEPROM_Stored_Messages+1 <- 128
	CALL _Show_EEPROM_Stored_Messages
//main.c,205 :: 		Show_EEPROM_Stored_Messages(2,0x90);
	FARG_Show_EEPROM_Stored_Messages+0 <- 2
	FARG_Show_EEPROM_Stored_Messages+1 <- 144
	CALL _Show_EEPROM_Stored_Messages
//main.c,206 :: 		data_frame[1] = 0x02;  //scan for the second time
	_data_frame+1 <- 2
//main.c,207 :: 		data_frame[2] = 0; // this byte is MSB of the user number
	_data_frame+2 <- 0
//main.c,208 :: 		data_frame[3] = number; // this byte is LSB of the user number
	_data_frame+3 <- FARG_Enroll_Users_Fingerprint+0
//main.c,209 :: 		data_frame[4] = 1;   // set priveledge to 1
	_data_frame+4 <- 1
//main.c,210 :: 		Construct_Scanner_Command();
	CALL _Construct_Scanner_Command
//main.c,211 :: 		Transmit_Command_to_Scanner();
	CALL _Transmit_Command_to_Scanner
//main.c,212 :: 		Receive_Response_from_Scanner();
	CALL _Receive_Response_from_Scanner
//main.c,213 :: 		if (data_frame[4])
	if (!_data_frame+4) then goto L_Enroll_Users_Fingerprint_22
//main.c,215 :: 		error = 1;
	Enroll_Users_Fingerprint_error_L0 <- 1
//main.c,216 :: 		return error;
	STACK_0 <- 1
	return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -