diff options
| author | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-02 20:00:08 +0700 |
|---|---|---|
| committer | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-10 19:28:00 +0700 |
| commit | 43416a62b92b8fbe9f1b74d62630a2509246cb46 (patch) | |
| tree | a4f966f484f02d1c2a9be0740268585f73a8169f /src | |
| parent | 799d8e43b54f68c61c7b63e43d4a3487754dfe60 (diff) | |
button: add entering bootloader on KEY2 long press
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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
|