mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 15:20:39 +01:00
[usb] Leave DFU mode on Back key press.
Change-Id: Icd031097f678a19729f12453db18cac2e08c6f05
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "calculator.h"
|
||||
#include "../regs/regs.h"
|
||||
#include <ion/keyboard.h>
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user