Update documentation, rename config

This commit is contained in:
elpekenin 2024-03-18 09:34:32 +01:00
parent 99f9031244
commit 42a33f7937
3 changed files with 14 additions and 14 deletions
app
docs/docs/config

View file

@ -402,8 +402,8 @@ config ZMK_IDLE_SLEEP_TIMEOUT
int "Milliseconds of inactivity before entering deep sleep"
default 900000
config ZMK_AWAKE_WHILE_BLE_CONNECTED
bool "Whether to stay awake while BLE is connected"
config ZMK_NO_SLEEP_WHILE_BLE_CONNECTED
bool "Prevent deep sleep while BLE is connected"
depends on ZMK_BLE
#ZMK_SLEEP

View file

@ -26,7 +26,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/usb.h>
#endif
#if IS_ENABLED(CONFIG_ZMK_AWAKE_WHILE_BLE_CONNECTED)
#if IS_ENABLED(CONFIG_ZMK_NO_SLEEP_WHILE_BLE_CONNECTED)
#include <zmk/ble.h>
#endif
@ -130,11 +130,11 @@ void activity_work_handler(struct k_work *work) {
int32_t current = k_uptime_get();
int32_t inactive_time = current - activity_last_uptime;
#if IS_ENABLED(CONFIG_ZMK_SLEEP)
if (inactive_time > MAX_SLEEP_MS &&
!is_usb_power_present()
#if IS_ENABLED(CONFIG_ZMK_AWAKE_WHILE_BLE_CONNECTED)
// if user inactive and no USB
// keyboard will sleep as soon as BLE is disconnected
if (inactive_time > MAX_SLEEP_MS && !is_usb_power_present()
#if IS_ENABLED(CONFIG_ZMK_NO_SLEEP_WHILE_BLE_CONNECTED)
/* if user inactive and USB is not connected,
* keyboard will sleep as soon as BLE is disconnected
*/
#if !IS_ENABLED(CONFIG_ZMK_SPLIT) || IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
&& !zmk_ble_active_profile_is_connected()
#else

View file

@ -18,12 +18,12 @@ In the deep sleep state, the keyboard additionally disconnects from Bluetooth an
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
| Config | Type | Description | Default |
| -------------------------------------- | ---- | ----------------------------------------------------- | ------- |
| `CONFIG_ZMK_IDLE_TIMEOUT` | int | Milliseconds of inactivity before entering idle state | 30000 |
| `CONFIG_ZMK_SLEEP` | bool | Enable deep sleep support | n |
| `CONFIG_ZMK_IDLE_SLEEP_TIMEOUT` | int | Milliseconds of inactivity before entering deep sleep | 900000 |
| `CONFIG_ZMK_AWAKE_WHILE_BLE_CONNECTED` | bool | Whether to stay awake while BLE is connected | n |
| Config | Type | Description | Default |
| ----------------------------------------- | ---- | ------------------------------------------------------------------------------------------------ | ------- |
| `CONFIG_ZMK_IDLE_TIMEOUT` | int | Milliseconds of inactivity before entering idle state | 30000 |
| `CONFIG_ZMK_SLEEP` | bool | Enable deep sleep support | n |
| `CONFIG_ZMK_IDLE_SLEEP_TIMEOUT` | int | Milliseconds of inactivity before entering deep sleep | 900000 |
| `CONFIG_ZMK_NO_SLEEP_WHILE_BLE_CONNECTED` | bool | Prevent deep sleep while BLE is connected (active profile on central, split comms on peripheral) | n |
## External Power Control