From 4f8450c3c2cd3f1d9ae94aebf544677c77a4c0db Mon Sep 17 00:00:00 2001 From: trembel Date: Tue, 24 Nov 2020 11:08:56 +0100 Subject: [PATCH] Fall back to module caption if instance caption is missing Signed-off-by: trembel --- src/atdf/peripheral.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atdf/peripheral.rs b/src/atdf/peripheral.rs index 64d8d2b..6a6093e 100644 --- a/src/atdf/peripheral.rs +++ b/src/atdf/peripheral.rs @@ -53,7 +53,7 @@ pub fn parse_list( peripherals.push(chip::Peripheral { name: instance.attr("name")?.clone(), - description: instance.attr("caption").ok().cloned(), + description: instance.attr("caption").or(module.attr("caption")).ok().cloned(), registers, }) }