From ccaf12750ba39fe0bc1fa6d2425ef2d1831ded9a Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Tue, 9 Jun 2020 21:29:00 +0100 Subject: [PATCH] wasp: apps: Step counter application Currently there's no fancy algorithms to estimate stride length. Just pure simple step counting directly from the hardware's "intelligence engine". Signed-off-by: Daniel Thompson --- .gitmodules | 3 ++ Makefile | 7 +-- res/feet.png | Bin 0 -> 388 bytes wasp/apps/steps.py | 82 +++++++++++++++++++++++++++++++ wasp/boards/pinetime/manifest.py | 2 + wasp/boards/pinetime/watch.py.in | 2 + wasp/boards/simulator/watch.py | 23 +++++++++ wasp/drivers/bma421.py | 53 ++++++++++++++++++++ wasp/modules/bma42x-upy | 1 + wasp/wasp.py | 2 + 10 files changed, 170 insertions(+), 5 deletions(-) create mode 100644 res/feet.png create mode 100644 wasp/apps/steps.py create mode 100644 wasp/drivers/bma421.py create mode 160000 wasp/modules/bma42x-upy diff --git a/.gitmodules b/.gitmodules index 7543a23..ec5319a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "reloader"] path = reloader url = https://github.com/daniel-thompson/wasp-reloader +[submodule "wasp/modules/bma42x-upy"] + path = wasp/modules/bma42x-upy + url = https://github.com/daniel-thompson/bma42x-upy diff --git a/Makefile b/Makefile index 5cdd4df..39fb23e 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,6 @@ submodules : bootloader: $(MAKE) -C bootloader/ BOARD=$(BOARD)_nrf52832 all genhex - python3 -m nordicsemi dfu genpkg \ - --bootloader bootloader/_build-$(BOARD)_nrf52832/$(BOARD)_nrf52832_bootloader-*-nosd.hex \ - --softdevice bootloader/lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex \ - bootloader.zip python3 tools/hexmerge.py \ bootloader/_build-$(BOARD)_nrf52832/$(BOARD)_nrf52832_bootloader-*-nosd.hex \ bootloader/lib/softdevice/s132_nrf52_6.1.1/s132_nrf52_6.1.1_softdevice.hex \ @@ -40,7 +36,8 @@ micropython: wasp/boards/pinetime/watch.py $(MAKE) -C micropython/ports/nrf \ BOARD=$(BOARD) SD=s132 \ MICROPY_VFS_LFS2=1 \ - FROZEN_MANIFEST=$(PWD)/wasp/boards/$(BOARD)/manifest.py + FROZEN_MANIFEST=$(PWD)/wasp/boards/$(BOARD)/manifest.py \ + USER_C_MODULES=$(PWD)/wasp/modules python3 -m nordicsemi dfu genpkg \ --dev-type 0x0052 \ --application micropython/ports/nrf/build-$(BOARD)-s132/firmware.hex \ diff --git a/res/feet.png b/res/feet.png new file mode 100644 index 0000000000000000000000000000000000000000..03d43d57b9cca2340b72fc00af566619c247da29 GIT binary patch literal 388 zcmV-~0ek+5P) zQ4WP541>n|Uzzt|9w8vujSY}b6Gka*nHqw2q?Cfgh?7uajGF_p+63tAU1`zBGL8ReF4Cibi$?L*|%Z<=#brOztdEaYs?>n0p7LBk2`Q zuPn~tMgT}e5`)I(-G0p_gUMB^=kpP;;p!MOI`y6Uv9#J>N