From 85dfc50de341ece9d095cc4b4a20b8172e1c770a Mon Sep 17 00:00:00 2001 From: Juvenn Woo Date: Thu, 16 May 2013 21:30:16 +0800 Subject: [PATCH 3/3] Cleanup macros and comments for aes3k drivers --- libfprint/drivers/aes3500.c | 8 +++----- libfprint/drivers/aes3k.h | 10 +++++----- libfprint/drivers/aes4000.c | 10 ++++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/libfprint/drivers/aes3500.c b/libfprint/drivers/aes3500.c index 43f97e3..3a24f17 100644 --- a/libfprint/drivers/aes3500.c +++ b/libfprint/drivers/aes3500.c @@ -41,13 +41,11 @@ #include "driver_ids.h" #define DATA_BUFLEN 0x2089 -#define FRAME_NUMBER 8 -// FRAME_WIDTH * AES3K_FRAME_HEIGHT / 2 -#define FRAME_SIZE 1024 - -// image size = FRAME_WIDTH * AES3K_FRAME_WIDTH +/* image size = FRAME_WIDTH x FRAME_WIDTH */ #define FRAME_WIDTH 128 +#define FRAME_SIZE FRAME_WIDTH * AES3K_FRAME_HEIGHT / 2 +#define FRAME_NUMBER FRAME_WIDTH / AES3K_FRAME_HEIGHT #define ENLARGE_FACTOR 2 diff --git a/libfprint/drivers/aes3k.h b/libfprint/drivers/aes3k.h index c9aa64a..98750ed 100644 --- a/libfprint/drivers/aes3k.h +++ b/libfprint/drivers/aes3k.h @@ -41,13 +41,13 @@ struct aes3k_dev { struct libusb_transfer *img_trf; - size_t frame_width; // sensor image size = frame_width * frame_width - size_t frame_size; // frame_width * AES3K_FRAME_HEIGHT / 2, 4 bits / pixel - size_t frame_number; // number of frames: frame_width / AES3K_FRAME_HEIGHT + size_t frame_width; /* image size = frame_width x frame_width */ + size_t frame_size; /* 4 bits/pixel: frame_width x AES3K_FRAME_HEIGHT / 2 */ + size_t frame_number; /* number of frames */ size_t enlarge_factor; - size_t data_buflen; // buffer length of usb bulk transfer - struct aes_regwrite *init_reqs; // initial values sent to device + size_t data_buflen; /* buffer length of usb bulk transfer */ + struct aes_regwrite *init_reqs; /* initial values sent to device */ size_t init_reqs_len; }; diff --git a/libfprint/drivers/aes4000.c b/libfprint/drivers/aes4000.c index 5234652..fe84fac 100644 --- a/libfprint/drivers/aes4000.c +++ b/libfprint/drivers/aes4000.c @@ -38,13 +38,11 @@ #include "driver_ids.h" #define DATA_BUFLEN 0x1259 -#define FRAME_NUMBER 6 -// FRAME_WIDTH * AES3K_FRAME_HEIGHT / 2 -#define FRAME_SIZE 768 - -// image size = FRAME_WIDTH * FRAME_WIDTH -#define FRAME_WIDTH 96 +/* image size = FRAME_WIDTH x FRAME_WIDTH */ +#define FRAME_WIDTH 96 +#define FRAME_SIZE FRAME_WIDTH * AES3K_FRAME_HEIGHT / 2 +#define FRAME_NUMBER FRAME_WIDTH / AES3K_FRAME_HEIGHT #define ENLARGE_FACTOR 3 -- 1.8.2.3