summaryrefslogtreecommitdiff
path: root/cts/gpio
diff options
context:
space:
mode:
authorChris Chen <twothreecc@google.com>2016-07-11 10:36:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-12 11:04:41 -0700
commit1b8fa6dbe41850a48c1271be3cf9d260b05f4c52 (patch)
tree2c48662b495ecb747122e09490746f0d2a2ac553 /cts/gpio
parent730c7c469fc06264a67280a62185bfc9f06d88a6 (diff)
downloadchrome-ec-1b8fa6dbe41850a48c1271be3cf9d260b05f4c52.tar.gz
cts: Added sync() function
sync() involves 2 gpios on each board, each labeled GPIO_HANDSHAKE_OUTPUT and GPIO_HANDSHAKE_INPUT on their respective boards. They both start low, then the th wiggles his line up and down, waiting for the dut to mimic it. BRANCH=None BUG=None TEST=manual - Connect handshake lines to appropriate pins on each board (pins found in board's gpio.inc) - Build tests - Flash boards - run 'cat /dev/ttyACM0' in one terminal - run 'cat /dev/ttyACM1' in another - They should each have printed 'successful sync' Change-Id: I61233bca9605ba89c3628c2a65ca9013c56365ea Reviewed-on: https://chromium-review.googlesource.com/359355 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'cts/gpio')
-rw-r--r--cts/gpio/dut.c8
-rw-r--r--cts/gpio/th.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/cts/gpio/dut.c b/cts/gpio/dut.c
index bdcd4938f7..7120a4da3e 100644
--- a/cts/gpio/dut.c
+++ b/cts/gpio/dut.c
@@ -3,11 +3,19 @@
* found in the LICENSE file.
*/
+#include "common.h"
+#include "watchdog.h"
+#include "uart.h"
#include "timer.h"
#include "watchdog.h"
+#include "dut_common.h"
+#include "cts_common.h"
void cts_task(void)
{
+ sync();
+ CPRINTS("Successful Sync!");
+ uart_flush_output();
while (1) {
watchdog_reload();
sleep(1);
diff --git a/cts/gpio/th.c b/cts/gpio/th.c
index bdcd4938f7..7120a4da3e 100644
--- a/cts/gpio/th.c
+++ b/cts/gpio/th.c
@@ -3,11 +3,19 @@
* found in the LICENSE file.
*/
+#include "common.h"
+#include "watchdog.h"
+#include "uart.h"
#include "timer.h"
#include "watchdog.h"
+#include "dut_common.h"
+#include "cts_common.h"
void cts_task(void)
{
+ sync();
+ CPRINTS("Successful Sync!");
+ uart_flush_output();
while (1) {
watchdog_reload();
sleep(1);