mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-13 04:51:38 -10:00
The poll waited up to the input block timeout for an event, and again after each one, so that a press a pad sends as several events a few milliseconds apart landed in one poll. That stalled every frame by the timeout, pressed or not, on the main thread. The poll no longer waits in the foreground. Instead a pad's presses in a poll are shown at its end unless the newest of them came within the timeout of it, by Android's own event times: then they wait for the next poll, and the rest of the press, coming before that, is shown with them. Nothing waits more than one poll, an older press is shown at once, and a press let go before it was shown is shown for one poll. At 0, the default, nothing is kept back and it costs nothing. The keeping back is android_press_group.h, which samples/input/android_block_timeout holds to all of that.
42 lines
1.0 KiB
Makefile
42 lines
1.0 KiB
Makefile
include ../../sample_objdir.mk
|
|
|
|
TARGET := android_block_timeout_test
|
|
|
|
LIBRETRO_COMM_DIR := ../../../libretro-common
|
|
|
|
# The waits and the keeping back are the driver's own
|
|
# (input/drivers/android_poll_wait.h and android_press_group.h, which
|
|
# take no NDK types); the event times are given by the test, because
|
|
# the driver only builds against the NDK.
|
|
SOURCES := android_block_timeout_test.c
|
|
|
|
OBJS := $(call sample_objs,$(SOURCES:.c=.o))
|
|
|
|
CFLAGS += -Wall -std=gnu89 -g1 -O1 -I$(LIBRETRO_COMM_DIR)/include
|
|
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CC) -o $@ $(OBJS) $(LDFLAGS)
|
|
|
|
android_block_timeout_test.o: ../../../input/drivers/android_poll_wait.h \
|
|
../../../input/drivers/android_press_group.h
|
|
|
|
check: all
|
|
./$(TARGET)
|
|
|
|
clean:
|
|
rm -rf $(SAMPLE_OBJDIR)
|
|
rm -f $(OBJS) $(TARGET)
|
|
|
|
.PHONY: all check clean
|
|
|
|
$(SAMPLE_OBJDIR)/%.o: $$(call sample_src,$$*).c
|
|
@mkdir -p $(@D)
|
|
$(COMPILE.c) $(OUTPUT_OPTION) $<
|