diff --git a/library.properties b/library.properties index fb4e601d..b983848a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=10.5.0 +version=10.6.0 author= John Wellbelove maintainer=John Wellbelove sentence=A C++ template library tailored for embedded systems. diff --git a/src/io_port.h b/src/io_port.h index 7932bbe0..2577162b 100644 --- a/src/io_port.h +++ b/src/io_port.h @@ -350,7 +350,7 @@ namespace etl } /// Constructor. - io_port_rw(uint8_t* address_) + io_port_rw(void* address_) : address(reinterpret_cast(address_)) { } @@ -369,7 +369,7 @@ namespace etl } /// Set the IO port address. - void set_address(uintptr_t address_) + void set_address(void* address_) { address = reinterpret_cast(address_); } @@ -393,7 +393,7 @@ namespace etl } /// Read. - T value() const + T read() const { return *address; } @@ -480,7 +480,7 @@ namespace etl } /// Set the IO port address. - void set_address(uintptr_t address_) + void set_address(void* address_) { address = reinterpret_cast(address_); } @@ -498,7 +498,7 @@ namespace etl } /// Read. - T value() const + T read() const { return *address; } @@ -569,7 +569,7 @@ namespace etl } /// Set the IO port address. - void set_address(uintptr_t address_) + void set_address(void* address_) { address = reinterpret_cast(address_); } @@ -723,7 +723,7 @@ namespace etl } /// Set the IO port address. - void set_address(uintptr_t address_) + void set_address(void* address_) { address = reinterpret_cast(address_); } @@ -753,7 +753,7 @@ namespace etl } /// Read. - T value() const + T read() const { return shadow_value; } diff --git a/test/test_io_port.cpp b/test/test_io_port.cpp index 798e147d..398c5bc8 100644 --- a/test/test_io_port.cpp +++ b/test/test_io_port.cpp @@ -127,7 +127,7 @@ namespace CHECK_EQUAL(0xDE, control2); CHECK_EQUAL(0xDE, port.control2); - port.control2.set_address(0x1000); + port.control2.set_address((void*)0x1000); volatile uint8_t* address = port.control2.get_address(); CHECK_EQUAL(reinterpret_cast(0x1000), address); } @@ -140,10 +140,10 @@ namespace uint8_t memory_wo = 0x56; uint8_t memory_wos = 0x78; - iop_rw.set_address(uintptr_t(&memory_rw)); - iop_ro.set_address(uintptr_t(&memory_ro)); - iop_wo.set_address(uintptr_t(&memory_wo)); - iop_wos.set_address(uintptr_t(&memory_wos)); + iop_rw.set_address(&memory_rw); + iop_ro.set_address(&memory_ro); + iop_wo.set_address(&memory_wo); + iop_wos.set_address(&memory_wos); std::array compare; std::array result;