📄 main.c
字号:
/*********************************************************************
*
* Copyright:
* MOTOROLA, INC. All Rights Reserved.
* You are hereby granted a copyright license to use, modify, and
* distribute the SOFTWARE so long as this entire notice is
* retained without alteration in any modified and/or redistributed
* versions, and that such modified versions are clearly identified
* as such. No licenses are granted by implication, estoppel or
* otherwise under any patents or trademarks of Motorola, Inc. This
* software is provided on an "AS IS" basis and without warranty.
*
* To the maximum extent permitted by applicable law, MOTOROLA
* DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
* PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE
* SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY
* ACCOMPANYING WRITTEN MATERIALS.
*
* To the maximum extent permitted by applicable law, IN NO EVENT
* SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS
* INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
* LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
*
* Motorola assumes no responsibility for the maintenance and support
* of this software
********************************************************************/
/*
* File: main.c
*
* Purpose: main routine for the MCF5249 Biometric Security
* reference design.
*
* Notes:
*
* Modifications:
*
*/
#include "mcf5249.h"
#include "init.h"
#include "FPsensor.h"
#include "lcd.h"
#include "displays.h"
/********************************************************************/
/********************************************************************/
/*TEST VARIABLES ONLY*/
FP_IMAGE image1;
uint32 regCIDH, regCIDL, regRAH, regRAL, regCAL, regREH, regREL, regCEL, regDTR, regDCR,
regCTRLA, regCTRLB, regCTRLC, regSRA, regPGC, regICR, regISR, regTHR, regTST;
/********************************************************************/
/********************************************************************/
/********************************************************************/
void Enrollement_Algorithm(FP_IMAGE image)
{
}
uint8 Verification_Algorithm(FP_IMAGE image)
{
uint8 verified = 0;
return(verified);
}
/*--- Main function ---*/
void main_init(void)
{
uint32 func;
CPUInit(); //CPU module initialisations
LCDInit(); //LCD initialisation routine
FPSensorInit(); //Sensor initialisation routine
LCDStartupDisplay(); //Runs the startup LCD sequence
/*--- Sensor Register Reads For Test Purposes ---*/
regCIDH = (uint32)(FPReadReg(FP_CIDH));
regCIDL = (uint32)(FPReadReg(FP_CIDL));
regRAH = (uint32)(FPReadReg(FP_RAH));
regRAL = (uint32)(FPReadReg(FP_RAL));
regCAL = (uint32)(FPReadReg(FP_CAL));
regREH = (uint32)(FPReadReg(FP_REH));
regREL = (uint32)(FPReadReg(FP_REL));
regCEL = (uint32)(FPReadReg(FP_CEL));
regDTR = (uint32)(FPReadReg(FP_DTR));
regDCR = (uint32)(FPReadReg(FP_DCR));
regCTRLA = (uint32)(FPReadReg(FP_CTRLA));
regCTRLB = (uint32)(FPReadReg(FP_CTRLB));
regCTRLC = (uint32)(FPReadReg(FP_CTRLC));
regSRA = (uint32)(FPReadReg(FP_SRA));
regPGC = (uint32)(FPReadReg(FP_PGC));
regICR = (uint32)(FPReadReg(FP_ICR));
regISR = (uint32)(FPReadReg(FP_ISR));
regTHR = (uint32)(FPReadReg(FP_THR));
regTST = (uint32)(FPReadReg(FP_TST));
/*---End Sensor Register Reads For Test Purposes ---*/
while(1)
{
func = (MCF5249_SIM_GPIO1_READ & 0x00100000); //Test the switch for enrollment or verification
if (func != 0)
LCDEnrollement(); //Start of enrollement display
else
LCDVerification(); //Start of verification display
FPMCUFingerDetect(); //Only returns when a finger is detected
FPMCUGetWhole(image1); //Get the whole image from sensor
if (func !=0)
{
Enrollement_Algorithm(image1); //Run the enrollement algorithm
LCDUserEnrolled(); //Enrollement completed display
while(func !=0)
func = (MCF5249_SIM_GPIO1_READ & 0x00100000); //Test the switch
}
else
{
if(Verification_Algorithm(image1)) //Run the verification algorithm
LCDUserVerified(); //User verified display
else
LCDUsedRejected(); //User rejected display
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -