diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b645cd0..2ba500d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,9 +2,9 @@ "version": "2.0.0", "options": { "env": { - "APPLICATION": "blinky", + // "APPLICATION": "button", // "APPLICATION": "spi", - // "APPLICATION": "st7789_lcd", + "APPLICATION": "st7789_lcd", }, }, "presentation": { diff --git a/Makefile b/Makefile index de07461..a8bf9d4 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ check: $(C_SRCS) $(TARGET): $(OBJS) $(THIS_MAKEFILE) @mkdir -p $(dir $@) $(CXX) $(CXX_FLAGS) $(LD_FLAGS) $(OBJS) $(addprefix -l,$(LIBS)) -Wl,-Map=$@.map -o $@ - $(OBJDUMP) --disassemble-all --section=.text --source -EL -C --wide --line-numbers --inlines $@ > $@.text.disassemble + # $(OBJDUMP) --disassemble-all --section=.text --source -EL -C --wide --line-numbers --inlines $@ > $@.text.disassemble ln -sf $(shell pwd)/$@ $(shell pwd)/bin/firmware.elf $(SIZE) -x $@ > $@.size @cat $@.size diff --git a/src/application/button/main.cc b/src/application/button/main.cc index c275b06..90db859 100644 --- a/src/application/button/main.cc +++ b/src/application/button/main.cc @@ -66,6 +66,9 @@ int main(void) led->toggle(); } } + __SEV(); + __WFE(); + __WFE(); } return 0; } diff --git a/src/application/st7789_lcd/main.cc b/src/application/st7789_lcd/main.cc index b3a7ba1..8f12b9d 100644 --- a/src/application/st7789_lcd/main.cc +++ b/src/application/st7789_lcd/main.cc @@ -2,6 +2,7 @@ #include "platform/cm4/InterruptGuardian.h" #include "platform/nrf52/gpio.h" +#include "platform/nrf52/gpiote.h" #include "platform/nrf52/spi.h" #include "platform/nrf52/InterruptHandler.h" #include "platform/nrf52/InterruptGuardian.h" @@ -22,6 +23,9 @@ St7789 lcd(lcd_spi, lcd_reset, lcd_data_command, lcd_backlight); cm4::InterruptGuardian cm4::InterruptGuardian::instance; nrf52::InterruptGuardian nrf52::InterruptGuardian::instance; +// GPIO events +nrf52::Gpiote gpiote; + int main(void) { cm4::InterruptGuardian::enable_interrupts(); diff --git a/src/platform/nrf52/gpio.cc b/src/platform/nrf52/gpio.cc index b3c04fe..d10a53e 100644 --- a/src/platform/nrf52/gpio.cc +++ b/src/platform/nrf52/gpio.cc @@ -6,6 +6,10 @@ extern "C" { NRF_GPIOTE_Type *const GPIOTE_REGS = reinterpret_cast(NRF_GPIOTE_BASE); } +#include "gpiote.h" + +extern pinetime::platform::nrf52::Gpiote gpiote; + #include "platform/nrf52/gpiote.h" #include "platform/nrf52/gpio.h"