diff options
| author | François Cartegnie <281376+fcartegnie@users.noreply.github.com> | 2024-07-09 08:46:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-09 08:46:19 +0200 |
| commit | a6c62295e92b3d960700508a445be1fba71a3cc2 (patch) | |
| tree | 35c825b6551afad7688813d7de510111a67bf007 /src/main.c | |
| parent | 69b530cbbb72ad9e4b9a7a6c4742f29540664d00 (diff) | |
| parent | 8274cab154f198447f12028e1686bbe2a6de6ebd (diff) | |
Merge pull request #30 from kienvo/ble-init
feat: Bluetooth LE initial setup
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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:
|