From 86d1db21f76399843cc0563e757b31a2511547cc Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sat, 10 Aug 2019 13:58:42 +0200 Subject: [PATCH] Fixed nullptr not being a valid uintptr_t --- io.hpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/io.hpp b/io.hpp index f0e5a2b..9112c1f 100644 --- a/io.hpp +++ b/io.hpp @@ -142,9 +142,9 @@ static constexpr uintptr_t PORT_A_DIR_REG_ADDR = DDRA + __SFR_OFFSET; static constexpr uintptr_t PORT_A_OUTPUT_REG_ADDR = PORTA + __SFR_OFFSET; static constexpr uintptr_t PORT_A_INPUT_REG_ADDR = PINA + __SFR_OFFSET; #else -static constexpr uintptr_t PORT_A_DIR_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_A_OUTPUT_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_A_INPUT_REG_ADDR = nullptr; +static constexpr uintptr_t PORT_A_DIR_REG_ADDR = 0; +static constexpr uintptr_t PORT_A_OUTPUT_REG_ADDR = 0; +static constexpr uintptr_t PORT_A_INPUT_REG_ADDR = 0; #endif #ifdef PORT_B_AVAILABLE @@ -152,9 +152,9 @@ static constexpr uintptr_t PORT_B_DIR_REG_ADDR = DDRB + __SFR_OFFSET; static constexpr uintptr_t PORT_B_OUTPUT_REG_ADDR = PORTB + __SFR_OFFSET; static constexpr uintptr_t PORT_B_INPUT_REG_ADDR = PINB + __SFR_OFFSET; #else -static constexpr uintptr_t PORT_B_DIR_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_B_OUTPUT_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_B_INPUT_REG_ADDR = nullptr; +static constexpr uintptr_t PORT_B_DIR_REG_ADDR = 0; +static constexpr uintptr_t PORT_B_OUTPUT_REG_ADDR = 0; +static constexpr uintptr_t PORT_B_INPUT_REG_ADDR = 0; #endif #ifdef PORT_C_AVAILABLE @@ -162,9 +162,9 @@ static constexpr uintptr_t PORT_C_DIR_REG_ADDR = DDRC + __SFR_OFFSET; static constexpr uintptr_t PORT_C_OUTPUT_REG_ADDR = PORTC + __SFR_OFFSET; static constexpr uintptr_t PORT_C_INPUT_REG_ADDR = PINC + __SFR_OFFSET; #else -static constexpr uintptr_t PORT_C_DIR_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_C_OUTPUT_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_C_INPUT_REG_ADDR = nullptr; +static constexpr uintptr_t PORT_C_DIR_REG_ADDR = 0; +static constexpr uintptr_t PORT_C_OUTPUT_REG_ADDR = 0; +static constexpr uintptr_t PORT_C_INPUT_REG_ADDR = 0; #endif #ifdef PORT_D_AVAILABLE @@ -172,9 +172,9 @@ static constexpr uintptr_t PORT_D_DIR_REG_ADDR = DDRD + __SFR_OFFSET; static constexpr uintptr_t PORT_D_OUTPUT_REG_ADDR = PORTD + __SFR_OFFSET; static constexpr uintptr_t PORT_D_INPUT_REG_ADDR = PIND + __SFR_OFFSET; #else -static constexpr uintptr_t PORT_D_DIR_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_D_OUTPUT_REG_ADDR = nullptr; -static constexpr uintptr_t PORT_D_INPUT_REG_ADDR = nullptr; +static constexpr uintptr_t PORT_D_DIR_REG_ADDR = 0; +static constexpr uintptr_t PORT_D_OUTPUT_REG_ADDR = 0; +static constexpr uintptr_t PORT_D_INPUT_REG_ADDR = 0; #endif #undef _SFR_IO8