diff --git a/Makefile b/Makefile index 7b182ff..6939abd 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ CC=gcc CFLAGS=-O0 -g3 -ggdb -std=c89 -W -Werror -Wall -Wextra -Wpedantic -pedantic-errors -Wformat-signedness -I. -CFLAGS+=-Wlogical-op -Wmissing-declarations -Wswitch-default -Wundef -Wformat=2 -lasan +CFLAGS+=-Wlogical-op -Wmissing-declarations -Wswitch-default -Wundef -Wformat=2 -lasan -lm CFLAGS+=-fsanitize=pointer-overflow,undefined,shift,shift-exponent,shift-base,integer-divide-by-zero,null,signed-integer-overflow,bounds -LFLAGS=-lm CFILES=$(wildcard *.c) +BINFILE=lis3dh + all: - $(CC) $(CFLAGS) $(CFILES) -o lis3dh $(LFLAGS) + $(CC) $(CFLAGS) $(CFILES) -o $(BINFILE) clean: - rm -rf lis3dh + rm -rf $(BINFILE) diff --git a/example/double-click.c b/example/double-click.c index f3f64f6..6a4299c 100644 --- a/example/double-click.c +++ b/example/double-click.c @@ -123,10 +123,6 @@ int main() { LIS3DH_CLICK_SCLICK(lis.src.click), LIS3DH_CLICK_DCLICK(lis.src.click)); } - - /* sleep for 5 ms because gpio sysfs is slow at clearing interrupts */ - /* not necessary with "real" IRQ */ - usleep(5000); } /* unregister interrupt */ diff --git a/example/inertial-wakeup.c b/example/inertial-wakeup.c index 4036936..6a158f5 100644 --- a/example/inertial-wakeup.c +++ b/example/inertial-wakeup.c @@ -116,10 +116,6 @@ int main() { LIS3DH_INT_SRC_Y_LOW(lis.src.int1), LIS3DH_INT_SRC_X_HIGH(lis.src.int1), LIS3DH_INT_SRC_X_LOW(lis.src.int1)); - - /* sleep for 5 ms because gpio sysfs is slow at clearing interrupts */ - /* not necessary with "real" IRQ */ - usleep(5000); } /* unregister interrupt */ diff --git a/example/single-click.c b/example/single-click.c index 088d81b..5a750a5 100644 --- a/example/single-click.c +++ b/example/single-click.c @@ -107,10 +107,6 @@ int main() { LIS3DH_CLICK_SCLICK(lis.src.click), LIS3DH_CLICK_DCLICK(lis.src.click)); } - - /* sleep for 5 ms because gpio sysfs is slow at clearing interrupts */ - /* not necessary with "real" IRQ */ - usleep(5000); } /* unregister interrupt */