From 8274cab154f198447f12028e1686bbe2a6de6ebd Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen-Phu Date: Sun, 23 Jun 2024 19:22:20 +0700 Subject: feat: add initial Bluetooth LE module --- src/main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d3a959b..613504e 100644 --- a/src/main.c +++ b/src/main.c @@ -5,6 +5,9 @@ #include "button.h" #include "fb.h" +#include "ble/setup.h" +#include "ble/profile.h" + #define FB_WIDTH (LED_COLS * 4) #define SCROLL_IRATIO (16) #define SCAN_F (2000) @@ -103,6 +106,16 @@ void poweroff() LowPower_Shutdown(0); } +void ble_start() +{ + ble_hardwareInit(); + tmos_clockInit(); + + peripheral_init(); + devInfo_registerService(); + legacy_registerService(); +} + void handle_mode_transition() { static int prev_mode; @@ -116,8 +129,9 @@ void handle_mode_transition() // Take control of the current fb to display // the Bluetooth animation + ble_start(); while (mode == DOWNLOAD) { - /* Animation and Bluetooth will be placed here */ + TMOS_SystemProcess(); } // If not being flashed, pressing KEY1 again will // make the badge goes off: -- cgit v1.2.3