aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDien-Nhung Nguyen-Phu <kein@kienlab.com>2024-06-02 20:00:08 +0700
committerDien-Nhung Nguyen-Phu <kein@kienlab.com>2024-06-10 19:28:00 +0700
commit43416a62b92b8fbe9f1b74d62630a2509246cb46 (patch)
treea4f966f484f02d1c2a9be0740268585f73a8169f /src/main.c
parent799d8e43b54f68c61c7b63e43d4a3487754dfe60 (diff)
button: add entering bootloader on KEY2 long press
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 2ee8211..ae818a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,8 +104,16 @@ int main()
btn_onOnePress(KEY2, change_fb);
btn_onLongPress(KEY1, change_brightness);
- while (1) {
- }
+ while (1) {
+ int i = 0;
+ while (isPressed(KEY2)) {
+ i++;
+ if (i>10) {
+ asm volatile("j 0x00");
+ }
+ DelayMs(200);
+ }
+ }
}
__INTERRUPT