diff --git a/ion/src/device/usb/Makefile b/ion/src/device/usb/Makefile index fafc1a44a..361ffadc1 100644 --- a/ion/src/device/usb/Makefile +++ b/ion/src/device/usb/Makefile @@ -33,6 +33,8 @@ usb_objs += liba/src/memset.o usb_objs += liba/src/memcpy.o usb_objs += libaxx/src/cxxabi/pure_virtual.o usb_objs += ion/src/device/usb/boot.o +usb_objs += ion/src/device/keyboard.o +usb_objs += ion/src/device/device.o ion/src/device/usb/dfu.elf: LDFLAGS = --gc-sections -T ion/src/device/boot/dfu.ld ion/src/device/usb/dfu.elf: $(usb_objs) diff --git a/ion/src/device/usb/calculator.cpp b/ion/src/device/usb/calculator.cpp index a5449ac0f..c63262d0a 100644 --- a/ion/src/device/usb/calculator.cpp +++ b/ion/src/device/usb/calculator.cpp @@ -1,5 +1,6 @@ #include "calculator.h" #include "../regs/regs.h" +#include namespace Ion { namespace USB { @@ -11,7 +12,9 @@ void Calculator::Poll() { } Calculator c; - while (true) { + // Leave DFU mode when pressing the Back key. + // TODO also leave on detach or when unplugging + while (!Ion::Keyboard::scan().keyDown(Ion::Keyboard::Key::A6)) { c.poll(); } }