Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device app to test hold touch #223

Open
mchack-work opened this issue May 16, 2024 · 1 comment · May be fixed by #212 or tillitis/tkey-libs#47
Open

Device app to test hold touch #223

mchack-work opened this issue May 16, 2024 · 1 comment · May be fixed by #212 or tillitis/tkey-libs#47

Comments

@mchack-work
Copy link
Member

We need a device app to test hold touch, indicating a finger present for a long time.

See connected PR.

@dehanj
Copy link
Member

dehanj commented May 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants