diff --git a/lib/include/prjxray/bit_ops.h b/lib/include/prjxray/bit_ops.h index 5979e2b5..baeaab1c 100644 --- a/lib/include/prjxray/bit_ops.h +++ b/lib/include/prjxray/bit_ops.h @@ -31,10 +31,10 @@ constexpr UInt bit_field_get(UInt value, const int top_bit, const int bottom_bit return (value & bit_mask_range(top_bit, bottom_bit)) >> bottom_bit; } -template +template constexpr UInt bit_field_set(const UInt reg_value, const int top_bit, const int bottom_bit, - const UInt field_value) { + const ValueType field_value) { return ((reg_value & ~bit_mask_range(top_bit, bottom_bit)) | ((static_cast(field_value) << bottom_bit) & bit_mask_range(top_bit, bottom_bit)));