From 7b97c09ce56a6d62c1f969b771aef0e30d1175af Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Fri, 5 Jul 2024 15:44:06 +0200 Subject: [PATCH] kconfig: Add variables for integer constants Add a Kconfig.constants file that defines variables for different known integer minimum and maximum values. Signed-off-by: Pieter De Gendt --- Kconfig.constants | 19 +++++++++++++++++++ Kconfig.zephyr | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 Kconfig.constants diff --git a/Kconfig.constants b/Kconfig.constants new file mode 100644 index 00000000000000..980b1da193a174 --- /dev/null +++ b/Kconfig.constants @@ -0,0 +1,19 @@ +# Constant variables to be used across Kconfig options + +# Copyright (c) 2024 basalte bv +# SPDX-License-Identifier: Apache-2.0 + +INT8_MIN := -128 +INT16_MIN := -32768 +INT32_MIN := -2147483648 +INT64_MIN := -9223372036854775808 + +INT8_MAX := 127 +INT16_MAX := 32767 +INT32_MAX := 2147483647 +INT64_MAX := 9223372036854775807 + +UINT8_MAX := 255 +UINT16_MAX := 65535 +UINT32_MAX := 4294967295 +UINT64_MAX := 18446744073709551615 diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 3cab0519b45b5f..9897607fb3bf73 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -5,6 +5,8 @@ # Copyright (c) 2023 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 +source "Kconfig.constants" + osource "${APPLICATION_SOURCE_DIR}/VERSION" # Include Kconfig.defconfig files first so that they can override defaults and