From 12e1f3f4da9bf02adc0c3f9d107a616eb405b647 Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Sun, 3 Mar 2024 23:17:06 +0000 Subject: [PATCH] litex/soc/integration: use format_constant for soc.h --- litex/soc/integration/export.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index 5835e7c22..c89fce557 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -28,6 +28,7 @@ from sysconfig import get_platform from migen import * +from litex.gen.format import format_constant from litex.soc.interconnect.csr import CSRStatus from litex.soc.integration.soc import SoCRegion @@ -181,7 +182,7 @@ def get_soc_header(constants, with_access_functions=True): value = "\"" + value + "\"" ctype = "const char *" else: - value = str(value) + value = format_constant(value) ctype = "int" r += "#define "+name+" "+value+"\n" if with_access_functions: