summaryrefslogtreecommitdiff
path: root/extra/sps_errs/Makefile
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-07-10 13:07:50 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-11 00:28:11 +0000
commit47ccb26dd06fbe4782fac349d356f6c58fc8951e (patch)
tree35238920d2030ba09722b7a0cf8388ccfeea0a88 /extra/sps_errs/Makefile
parent18ea8f4ec3c328cbbe2e9a432caa3337f26d4340 (diff)
downloadchrome-ec-47ccb26dd06fbe4782fac349d356f6c58fc8951e.tar.gz
Cr50: Add extra/sps_errs/ test program
This adds another test program to use with the EC connected to the build host via an FTDI USB-to-SPI adapater, This program sends an EC_CMD_HELLO host command to the EC. Options exist to display the bytes transferred over the SPI interface, and to truncate the message before its complete, to see how the EC reacts. BUG=chrome-os-partner:40969 BRANCH=none TEST=make buildall To try out the new test program: cd extra/sps_errs make ./prog ./prog -v ./prog -v -c 22 Change-Id: I1d370ecdbae047d9504bc6e5f73949d4e3aed9d9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284865 Reviewed-by: Vadim Bendebury <vbendeb@google.com>
Diffstat (limited to 'extra/sps_errs/Makefile')
-rw-r--r--extra/sps_errs/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/extra/sps_errs/Makefile b/extra/sps_errs/Makefile
new file mode 100644
index 0000000000..12224ad803
--- /dev/null
+++ b/extra/sps_errs/Makefile
@@ -0,0 +1,37 @@
+# Copyright 2015 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Use your own libmpsse if you want, but we're going to use the files
+# that are part of the Chromium OS trunks_client program.
+PLATFORM2 = ../../../../platform2
+MPSSE_DIR = $(PLATFORM2)/trunks/ftdi
+
+PROG = prog
+SRCS = prog.c $(MPSSE_DIR)/mpsse.c $(MPSSE_DIR)/support.c
+
+CFLAGS = \
+ -std=gnu99 \
+ -g3 \
+ -O3 \
+ -Wall \
+ -Werror \
+ -Wpointer-arith \
+ -Wcast-align \
+ -Wcast-qual \
+ -Wundef \
+ -Wsign-compare \
+ -Wredundant-decls \
+ -Wmissing-declarations
+
+CFLAGS += -I../../include -I${MPSSE_DIR} -I${PLATFORM2}
+
+CFLAGS += $(shell pkg-config --cflags libusb-1.0 libftdi1)
+LIBS += $(shell pkg-config --libs libusb-1.0 libftdi1)
+
+$(PROG): $(SRCS) Makefile
+ gcc $(CFLAGS) $(SRCS) $(LDFLAGS) $(LIBS) -o $@
+
+.PHONY: clean
+clean:
+ rm -rf $(PROG)