# --- removed because it no longer exists ---
# CONFIG_BT_DEBUG_LOG=y

# Bluetooth
CONFIG_BT=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_DEVICE_NAME="Skisens v3"
#CONFIG_BT_HCI_VS_EXT=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME_MAX=30

CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_ATT_PREPARE_COUNT=10
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=131
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y

CONFIG_BT_CTLR_RX_BUFFERS=10
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

CONFIG_BT_RX_STACK_SIZE=2048
#CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE=1024
CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=2048


# outdoor sports activity 0x1440(5184) to 0x147F  https://specificationrefs.bluetooth.com/assigned-values/Appearance%20Values.pdf
CONFIG_BT_DEVICE_APPEARANCE=5184  


# Enable DK LED and Buttons library
CONFIG_DK_LIBRARY=y

#rtc clock is not user configuration in zephyr 2.0.2

CONFIG_NRFX_RTC0=y




#regulator and pwmled
CONFIG_I2C=y
CONFIG_NRFX_TWIM1=y
CONFIG_PWM=y


# flash part
CONFIG_STDOUT_CONSOLE=n
CONFIG_FLASH=y
CONFIG_SPI=y



CONFIG_DMA=y
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=256
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=2048
CONFIG_MAIN_STACK_SIZE=10240

CONFIG_MULTITHREADING=y
CONFIG_MINIMAL_LIBC=y
CONFIG_PRINTK=y
#CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_ASSERT=y
CONFIG_RESET_ON_FATAL_ERROR=n

# Enable system reboot functionality for VIN_PGOOD interrupt handler
CONFIG_REBOOT=y

# Note: CONFIG_SOC_NRF53_CPUNET_ENABLE moved to sysbuild.conf as SB_CONFIG_SOC_NRF53_CPUNET_ENABLE=y


CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100

#print log through rtt #https://devzone.nordicsemi.com/f/nordic-q-a/71497/configuring-rtt-for-nordic-thingy-52-connected-to-nrf5340-s-debug-out
#power optimization
CONFIG_LOG=y   # Enable logging (changed from 'n' to 'y')
CONFIG_USE_SEGGER_RTT=y   #y
CONFIG_LOG_BACKEND_RTT=y  #y
CONFIG_LOG_BACKEND_UART=n #n
CONFIG_RTT_CONSOLE=y      #y
CONFIG_SERIAL=n           #take away
CONFIG_UART_CONSOLE=n      # disable UART console
CONFIG_PM=y
CONFIG_PM_DEVICE=y

#ADC
CONFIG_NRFX_SAADC=y
CONFIG_NRFX_TIMER1=y

CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y

#DFU session , use example https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu
# another example for nrf5340  https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/blob/main/bootloader_samples/nrf5340/mcuboot_smp_ble_simultaneous/prj.conf
# Note: CONFIG_BOOTLOADER_MCUBOOT moved to sysbuild.conf as SB_CONFIG_BOOTLOADER_MCUBOOT=y
#Include MCUMGR and the dependencies in the build
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y



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

# codedphy config
#CONFIG_BT_PHY_UPDATE=y
#CONFIG_BT_CTLR_PHY_CODED=y

# Enable MCUmgr SMP over Bluetooth so smp_bt_register() is available
CONFIG_MCUMGR=y
CONFIG_MCUMGR_TRANSPORT_BT=y
CONFIG_MCUMGR_TRANSPORT_BT_DYNAMIC_SVC_REGISTRATION=y

# Enable dynamic GATT database needed for smp_bt_register()
CONFIG_BT_GATT_DYNAMIC_DB=y

# Dependency for MCUmgr (required so that smp_bt_register is linked in)
CONFIG_ZCBOR=y

# Optional: Reassemble long SMP packets (recommended for DFU)
CONFIG_MCUMGR_TRANSPORT_BT_REASSEMBLY=y
