From 43416a62b92b8fbe9f1b74d62630a2509246cb46 Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen-Phu Date: Sun, 2 Jun 2024 20:00:08 +0700 Subject: button: add entering bootloader on KEY2 long press --- src/main.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3