Closed mchack-work closed 1 week ago
With the linked PR in tkey-libs and this snipped below, it is possible to test this feature.
// Copyright (C) Tillitis AB
// SPDX-License-Identifier: GPL-2.0-only
#include <stdbool.h>
#include <tkey/led.h>
#include <tkey/tk1_mem.h>
#include <tkey/qemu_debug.h>
#include <tkey/touch.h>
int main(void)
{
qemu_puts("Hello, world!\n");
qemu_lf();
touch_wait(LED_BLUE, 10);
for (;;) {
if (touch()) {
led_set(LED_GREEN);
} else {
led_set(LED_RED);
}
}
}
It will first to a touch_wait with a timeout of 10 seconds, then it will simply show green when touched and red when not touched.
We need a device app to test hold touch, indicating a finger present for a long time.
See connected PR.