Skip to content

Commit 531a4c6

Browse files
committed
Adding broken line and sensor variant algorithm tests for sensors
1 parent 05b89e8 commit 531a4c6

17 files changed

+1821
-9
lines changed

Makefile.am

+24-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ AM_CFLAGS = \
1717

1818
AM_LDFLAGS = \
1919
-Wl,--gc-sections \
20-
-Wl,--as-needed
20+
-Wl,--as-needed \
21+
-lm
2122

2223
if !DEBUG
2324
AM_CFLAGS += -DNDEBUG
@@ -30,7 +31,24 @@ check_PROGRAMS = run-unit-tests
3031

3132
run_unit_tests_SOURCES =\
3233
src/test/run_unit_tests.c \
33-
src/test/test_utilfuncs.c
34+
src/test/test_utilfuncs.c \
35+
src/test/test_sensor_variant.c \
36+
src/mxt-app/mxt_app.h \
37+
src/mxt-app/broken_line.c \
38+
src/mxt-app/sensor_variant.c \
39+
src/mxt-app/polyfit.c \
40+
src/mxt-app/menu.c \
41+
src/mxt-app/bootloader.c \
42+
src/mxt-app/diagnostic_data.c \
43+
src/mxt-app/touch_app.c \
44+
src/mxt-app/self_test.c \
45+
src/mxt-app/bridge.c \
46+
src/mxt-app/gr.c \
47+
src/mxt-app/serial_data.c \
48+
src/mxt-app/buffer.c \
49+
src/mxt-app/buffer.h \
50+
src/mxt-app/self_cap.c \
51+
src/mxt-app/signal.c
3452

3553
run_unit_tests_CFLAGS =\
3654
-I$(top_srcdir)/src \
@@ -43,7 +61,7 @@ run_unit_tests_CFLAGS =\
4361
-DMXT_VERSION=\"$(GIT_VERSION)\" \
4462
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
4563

46-
run_unit_tests_LDFLAGS = -lcmocka -lmaxtouch
64+
run_unit_tests_LDFLAGS = -lcmocka -lmaxtouch -lm
4765

4866
TESTS = run-unit-tests
4967

@@ -82,6 +100,9 @@ EXTRA_mxt_app_DEPENDENCIES = git-version
82100
mxt_app_SOURCES =\
83101
src/mxt-app/mxt_app.h \
84102
src/mxt-app/mxt_app.c \
103+
src/mxt-app/broken_line.c \
104+
src/mxt-app/sensor_variant.c \
105+
src/mxt-app/polyfit.c \
85106
src/mxt-app/menu.c \
86107
src/mxt-app/bootloader.c \
87108
src/mxt-app/diagnostic_data.c \

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,59 @@ deltas. Self capacitance measurements are only available on some devices.
245245
: Set *DATATYPE* of the file. This will be automatically detected from the
246246
file itself in most cases.
247247

248+
# BROKEN LINE DETECTION
249+
250+
The broken line test scans the diagnostic data to identify touch sensor
251+
defects.
252+
253+
`--broken-line`
254+
: Run the broken line detection algorithm on the device
255+
256+
`--dualx`
257+
: Indicate if sensor X lines are double connected
258+
259+
`--x-center-threshold N`
260+
: Set threshold for X lines in center of sensor to N percent
261+
262+
`--x-border-threshold N`
263+
: Set threshold for X lines at edge of sensor to N percent
264+
265+
`--y-center-threshold N`
266+
: Set threshold for Y lines in center of sensor to N percent
267+
268+
`--y-border-threshold N`
269+
: Set threshold for Y lines at edge of sensor to N percent
270+
271+
`--pattern *PATTERN*`
272+
: set sensor *PATTERN* material to ITO or Xsense
273+
274+
# SENSOR VARIANT ALGORITHM
275+
276+
The sensor variant algorithm calculates all nodes of a channel
277+
to find the trend line of the reference. A comparison is done
278+
between the real and expected sensor reference.
279+
280+
`--sensor-variant`
281+
: Perform the Sensor Variant algorithm
282+
283+
`--dualx`
284+
: Indicate if sensor X lines are double connected
285+
286+
`--fail-if-any`
287+
: Fail the Sensor Variant test on any defects
288+
289+
`--max-defects N`
290+
: Maximum No. of continuous defects
291+
292+
`--upper-limit N`
293+
: Upper limit for regression, in percentage %
294+
295+
`--lower-limit N`
296+
: Lower limit for regression, in percentage %
297+
298+
`--matrix-size N`
299+
: The allowed matrix size
300+
248301
# FINDING AND SPECIFYING DEVICE
249302

250303
By default mxt-app will scan available devices and connect to the first device
@@ -506,6 +559,10 @@ To compile using autotools:
506559
To cross-compile:
507560

508561
./autogen.sh --host=arm-linux-gnueabi && make
562+
563+
or,
564+
565+
./autogen.sh --host=arm-linux-gnueabihf && make
509566

510567
To enable debug:
511568

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.27
1+
1.28

src/libmaxtouch/libmaxtouch.c

-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ int mxt_new_device(struct libmaxtouch_ctx *ctx, struct mxt_conn_info *conn,
224224
return ret;
225225
}
226226

227-
228227
//******************************************************************************
229228
/// \brief Read information block
230229
/// \return #mxt_rc

src/libmaxtouch/libmaxtouch.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ enum mxt_rc {
108108
MXT_ERROR_NOENT = 30, /*!< No such file or directory */
109109
MXT_ERROR_SELFCAP_TUNE = 31, /*!< Error processing self cap command */
110110
MXT_MSG_CONTINUE = 32, /*!< Continue processing messages */
111-
MXT_ERROR_RESERVED = 33, /*!< Reserved value */
111+
MXT_BROKEN_LINE_DETECTED = 33, /*!< Broken Line Detected */
112112
MXT_DEVICE_IN_BOOTLOADER = 34, /*!< Device is in bootloader mode */
113113
MXT_ERROR_OBJECT_IS_VOLATILE = 35, /*!< Object is volatile */
114-
MXT_ERROR_RESERVED2 = 36, /*!< Reserved value */
114+
MXT_SENSOR_VARIANT_DETECTED = 36, /*!< Sensor variant issue detected */
115115
};
116116

117117
//******************************************************************************

src/mxt-app/Android.mk

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LOCAL_CFLAGS += -DHAVE_LIBUSB -DMXT_VERSION=\"$(GIT_VERSION)\"
55
LOCAL_C_INCLUDES := $(TOP_DIR)/src $(TOP_DIR)/lib/libusbdroid/code/src
66
LOCAL_SRC_FILES := \
77
mxt_app.c \
8+
broken_line.c \
9+
sensor_variant.c \
10+
polyfit.c \
811
menu.c \
912
bootloader.c \
1013
diagnostic_data.c \

0 commit comments

Comments
 (0)