aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDien-Nhung Nguyen <kein@kienlab.com>2024-08-27 20:48:37 +0700
committerGitHub <noreply@github.com>2024-08-27 15:48:37 +0200
commita8b32e91b6f5b4df44372d942a4f514b66ceb7f5 (patch)
tree8c0ad2407813eb9bec12dcb9e2dd84edd06ab44a
parentc95faf32a6a98975828717d596ff51dedeecdf56 (diff)
animation: add Bluetooth animation in download mode (#17)
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8a4c8b5..a7392ed 100644
--- a/src/main.c
+++ b/src/main.c
@@ -189,6 +189,12 @@ static uint16_t common_tasks(tmosTaskID task_id, uint16_t events)
return events ^ ANI_FLASH;
}
+ if (events & BLE_NEXT_STEP) {
+ ani_xbm_next_frame(&bluetooth, fb, 10, 0);
+
+ return events ^ BLE_NEXT_STEP;
+ }
+
return 0;
}
@@ -256,6 +262,9 @@ void ble_start()
tmos_stop_task(common_taskid, ANI_NEXT_STEP);
tmos_stop_task(common_taskid, ANI_MARQUE);
tmos_stop_task(common_taskid, ANI_FLASH);
+ memset(fb, 0, sizeof(fb));
+
+ tmos_start_reload_task(common_taskid, BLE_NEXT_STEP, 500000 / 625);
}
void handle_mode_transition()