diff options
| author | Dien-Nhung Nguyen <kein@kienlab.com> | 2024-08-27 20:08:24 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 15:08:24 +0200 |
| commit | c95faf32a6a98975828717d596ff51dedeecdf56 (patch) | |
| tree | 8fe52862e0c34bfe82509adf0c98a8e57056d4c7 /src/ble | |
| parent | f5874d607315ff88b27414299089b8528b5bb07c (diff) | |
Add animations (#15)
* animation: add xbm animations
* refactor: correct framebuffer terminology
* animation: add animations and effect
* animation: timing with TMOS scheduler
Diffstat (limited to 'src/ble')
| -rw-r--r-- | src/ble/peripheral.c | 14 | ||||
| -rw-r--r-- | src/ble/setup.h | 9 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/ble/peripheral.c b/src/ble/peripheral.c index 955799a..f9c5e58 100644 --- a/src/ble/peripheral.c +++ b/src/ble/peripheral.c @@ -198,16 +198,26 @@ static uint16 peripheral_task(uint8 task_id, uint16 events) return 0;
}
+void ble_enable_advertise()
+{
+ uint8 e = TRUE;
+ GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8), &e);
+}
+
+void ble_disable_advertise()
+{
+ uint8 e = FALSE;
+ GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8), &e);
+}
+
static void gap_init()
{
GAPRole_PeripheralInit();
- static uint8 initial_advertising_enable = TRUE;
static uint16 desired_min_interval = 6;
static uint16 desired_max_interval = 500;
// Set the GAP Role Parameters
- GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8), &initial_advertising_enable);
GAPRole_SetParameter(GAPROLE_SCAN_RSP_DATA, sizeof(scanRspData), scanRspData);
GAPRole_SetParameter(GAPROLE_ADVERT_DATA, sizeof(advertData), advertData);
GAPRole_SetParameter(GAPROLE_MIN_CONN_INTERVAL, sizeof(uint16), &desired_min_interval);
diff --git a/src/ble/setup.h b/src/ble/setup.h index fd65b84..b814b36 100644 --- a/src/ble/setup.h +++ b/src/ble/setup.h @@ -1,8 +1,11 @@ -#ifndef __HAL_H__
-#define __HAL_H__
+#ifndef __BLE_SETUP_H__
+#define __BLE_SETUP_H__
void tmos_clockInit(void);
void ble_hardwareInit(void);
void peripheral_init(void);
-#endif /* __HAL_H__ */
+void ble_enable_advertise();
+void ble_disable_advertise();
+
+#endif /* __BLE_SETUP_H__ */
|