Skip to content

Commit 0b60c2b

Browse files
committed
minor updates all around
1 parent 2c3d210 commit 0b60c2b

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.20)
1+
cmake_minimum_required(VERSION 3.21)
22
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
33

44
project(bitfilled
@@ -14,13 +14,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
1414
add_library(${PROJECT_NAME} INTERFACE)
1515
add_subdirectory(${PROJECT_NAME})
1616

17-
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
18-
set(IS_TOPLEVEL_PROJECT TRUE)
19-
else()
20-
set(IS_TOPLEVEL_PROJECT FALSE)
21-
endif()
22-
23-
option(BITFILLED_TESTS "Enable unit testing" ${IS_TOPLEVEL_PROJECT})
17+
option(BITFILLED_TESTS "Enable unit testing" ${PROJECT_IS_TOP_LEVEL})
2418
if(BITFILLED_TESTS)
2519
enable_testing()
2620
add_subdirectory(test)

bitfilled/bitfilled/integer.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ struct integer_storage : public std::array<sized_unsigned_t<1>, SIZE>
5959
using base_type::operator=;
6060

6161
constexpr integer_storage() : base_type() {}
62-
62+
constexpr explicit integer_storage(const sized_unsigned_t<1> (&arr)[SIZE])
63+
{
64+
std::copy_n(arr, SIZE, base_type::data());
65+
}
6366
template <std::integral T>
6467
constexpr explicit integer_storage(T value, std::endian endianness = std::endian::native)
6568
: base_type()
@@ -185,6 +188,8 @@ struct packed_integer
185188

186189
constexpr packed_integer() : storage_() {}
187190
constexpr packed_integer(value_type value) : storage_(value, endianness) {}
191+
constexpr explicit packed_integer(const sized_unsigned_t<1> (&arr)[SIZE]) : storage_(arr) {}
192+
188193
constexpr packed_integer& operator=(value_type value)
189194
{
190195
storage_ = integer_storage<SIZE>(value, endianness);

bitfilled/bitfilled/mmreg.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ struct mmreg : public detail::accesscondition<ACCESS, detail::mmr_r<T>, detail::
127127
constexpr mmreg& operator=(const mmreg&)
128128
requires(!is_readwrite<ACCESS>)
129129
= delete;
130+
constexpr mmreg(const mmreg&)
131+
requires(is_readwrite<ACCESS>)
132+
= default;
133+
constexpr mmreg& operator=(const mmreg&)
134+
requires(is_readwrite<ACCESS>)
135+
= default;
130136

131137
BITFILLED_OPS_FORWARDING
132138
};

tools/svd2mmregmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def generate_peripheral(peripheral, bitband):
3838
# TODO: in the first round of iteration, generate enum types where enumeratedValues is provided
3939
# also de-duplicate enum types across registers
4040

41-
nametrim = peripheral.name + "_"
41+
nametrim = peripheral_name + "_"
4242
offset = 0
4343
for register in peripheral.get_registers():
4444
# filling gaps in the register map with reserved

0 commit comments

Comments
 (0)