Better processing BM-Lite transfer interrupts
This commit is contained in:
parent
b8a0ad09b7
commit
b2f48def26
@ -45,6 +45,8 @@ static HCP_comm_t hcp_chain = {
|
||||
.phy_rx_timeout = 2000,
|
||||
};
|
||||
|
||||
#ifdef BMLITE_USE_CALLBACK
|
||||
|
||||
void bmlite_on_error(bmlite_error_t error, int32_t value)
|
||||
{
|
||||
if(value != FPC_BEP_RESULT_TIMEOUT) {
|
||||
@ -84,7 +86,7 @@ void bmlite_on_identify_start()
|
||||
}
|
||||
|
||||
// void bmlite_on_identify_finish();
|
||||
|
||||
#endif
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
@ -117,8 +119,9 @@ int main (int argc, char **argv)
|
||||
current_id = 0;
|
||||
}
|
||||
res = bep_identify_finger(&hcp_chain, 0, &template_id, &match);
|
||||
if (res == FPC_BEP_RESULT_TIMEOUT) {
|
||||
if (res == FPC_BEP_RESULT_TIMEOUT || res == FPC_BEP_RESULT_IO_ERROR) {
|
||||
platform_bmlite_reset();
|
||||
continue;
|
||||
} else if (res != FPC_BEP_RESULT_OK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -152,6 +152,10 @@ fpc_bep_result_t bep_capture(HCP_comm_t *chain, uint16_t timeout)
|
||||
chain->phy_rx_timeout = timeout;
|
||||
for(int i=0; i< MAX_SINGLE_CAPTURE_ATTEMPTS; i++) {
|
||||
bep_result = bmlite_send_cmd_arg(chain, CMD_CAPTURE, ARG_NONE, ARG_TIMEOUT, &timeout, sizeof(timeout));
|
||||
if(bep_result == FPC_BEP_RESULT_IO_ERROR ||
|
||||
bep_result == FPC_BEP_RESULT_TIMEOUT) {
|
||||
break;
|
||||
}
|
||||
if( !(bep_result || chain->bep_result))
|
||||
break;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ typedef struct {
|
||||
* Pin definitions for RPI 3
|
||||
*/
|
||||
#define BMLITE_RESET_PIN 0
|
||||
#define BMLITE_IRQ_PIN 22
|
||||
#define BMLITE_READY_PIN 22
|
||||
#define SPI_CHANNEL 0
|
||||
|
||||
/**
|
||||
|
||||
@ -53,7 +53,7 @@ static const uint8_t spiBPW = 8;
|
||||
|
||||
uint32_t speed_hz_int;
|
||||
|
||||
void fpc_sensor_spi_reset(bool state);
|
||||
void fpc_bmlite_reset(bool state);
|
||||
|
||||
static void raspberryPi_init()
|
||||
{
|
||||
@ -61,7 +61,7 @@ static void raspberryPi_init()
|
||||
wiringPiSetup();
|
||||
|
||||
/* Set correct pin modes */
|
||||
pinMode(BMLITE_IRQ_PIN, INPUT);
|
||||
pinMode(BMLITE_READY_PIN, INPUT);
|
||||
pinMode(BMLITE_RESET_PIN, OUTPUT);
|
||||
|
||||
/* Set reset high */
|
||||
@ -81,7 +81,7 @@ void hal_bmlite_reset(bool state)
|
||||
|
||||
bool hal_bmlite_get_status(void)
|
||||
{
|
||||
return digitalRead(BMLITE_IRQ_PIN);
|
||||
return digitalRead(BMLITE_READY_PIN);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
CPU = cortex_m4
|
||||
LOG :=
|
||||
FPU ?= hard
|
||||
CC := arm-none-eabi-gcc
|
||||
|
||||
CFLAGS +=\
|
||||
@ -116,7 +116,6 @@ HAL_SRCS += \
|
||||
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
|
||||
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \
|
||||
$(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
|
||||
# $(PROJ_DIR)/main.c \
|
||||
|
||||
VPATH += $(dir $(HAL_SRCS))
|
||||
C_SRCS += $(notdir $(HAL_SRCS))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user