
# Debug & Pebble settings
CONFIG_DEBUG=n
CONFIG_LEFT_PEBBLE=y
CONFIG_RIGHT_PEBBLE=n

# Disable heap for testing coverage
CONFIG_COVERAGE_GCOV_HEAP_SIZE=0

# Disable shell
CONFIG_SHELL=n

# Disable file system
CONFIG_FILE_SYSTEM=n

# Enable compiler optimizations
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_DEBUG_OPTIMIZATIONS=n

# Disable some logging and debugging
CONFIG_EARLY_CONSOLE=n
CONFIG_ASSERT_VERBOSE=n
CONFIG_BOOT_BANNER=n
CONFIG_LOG=n
CONFIG_ASSERT=n

# Enable RTT console for printk output
CONFIG_PRINTK=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_CONSOLE=y

# Disable CBPRINTF libraries
CONFIG_CBPRINTF_COMPLETE=n
CONFIG_CBPRINTF_NANO=y
CONFIG_CBPRINTF_REDUCED_INTEGRAL=y

# Enable SPI for RGB WS2812
CONFIG_SPI=y
CONFIG_LED_STRIP=y
CONFIG_WS2812_STRIP=y
CONFIG_ADC=y
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_GPIO=y

CONFIG_CPP=y
# include std c/c++, do not remove else standard design patterns will not work
CONFIG_NEWLIB_LIBC=y
CONFIG_LIB_CPLUSPLUS=y

# Bluetooth LE
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=n
# # Disabling BLE PHY features - small impact on memory usage.
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_DATA_LEN_UPDATE=n
# Disable cache - this has big impact on memory usage!
CONFIG_BT_GATT_CACHING=n
# Super small improvements om memory usage
CONFIG_BT_ASSERT=n
CONFIG_BT_EXT_ADV=n
# CONFIG_BT_DEVICE_NAME_MAX=10

CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=n
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_DM=y
CONFIG_BT_GATT_DM_DATA_PRINT=n
CONFIG_BT_GATTP=n
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_SERIAL=n
CONFIG_BT_GATT_AUTO_DISCOVER_CCC=n

# Disable some GATT features
CONFIG_BT_GATT_AUTO_RESUBSCRIBE=n
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
CONFIG_BT_GATT_READ_MULTIPLE=n
CONFIG_BT_GATT_READ_MULT_VAR_LEN=n
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=n
CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=n

#BLE TX POWER
CONFIG_BT_CTLR_CONN_RSSI=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y

# BLE Controller configuration & features
CONFIG_BT_CTLR_CRYPTO=y
CONFIG_BT_CTLR_AD_DATA_BACKUP=n
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_ECDH=n
CONFIG_BT_CTLR_EXT_REJ_IND=n
CONFIG_BT_CTLR_EXT_SCAN_FP=n
CONFIG_BT_CTLR_CHAN_SEL_2=n

#Important Settings for DFU
# Enable mcumgr.
CONFIG_ZCBOR=y
CONFIG_MCUMGR=y

# Enable most core commands.
CONFIG_MCUMGR_GRP_IMG=y
CONFIG_MCUMGR_GRP_OS=y

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

# Allow for large Bluetooth data packets.
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

# Enable the Bluetooth (unauthenticated) and shell mcumgr transports.
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN=n

# Some command handlers require a large stack.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

#DFU FOTA
# CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP=y

# Some minor space saving attempts
CONFIG_LINKER_SORT_BY_ALIGNMENT=n
CONFIG_NO_RUNTIME_CHECKS=y
CONFIG_OUTPUT_STAT=n
CONFIG_OUTPUT_DISASSEMBLY=n

######## FROM EXAMPLE ########
#### CONFIG_BOOTLOADER_MCUBOOT=y
#### CONFIG_LOG=y

# # For spi and nor flash
CONFIG_NORDIC_QSPI_NOR=n
CONFIG_FLASH=y
#### CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=32 
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

# # If you don't add this when setting CONFIG_SPI=y, you'll get a lot of undefined references from the nrfx spim driver
# # E.G. "undefined reference to `z_impl_k_sleep'"
CONFIG_MULTITHREADING=y

CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y

CONFIG_NET_BUF=y
CONFIG_CRC=y
CONFIG_MCUMGR_TRANSPORT_BT_CONN_PARAM_CONTROL=y
CONFIG_IMG_MANAGER=y
CONFIG_STREAM_FLASH=y
CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y