diff --git a/src/hal/progmem.h b/src/hal/progmem.h index c67106e..9f0bf8c 100644 --- a/src/hal/progmem.h +++ b/src/hal/progmem.h @@ -2,7 +2,7 @@ #include #ifdef __AVR__ -#include +#include #else #define PROGMEM // ignored #endif @@ -13,12 +13,12 @@ namespace hal { namespace progmem { /// read a 16bit word from PROGMEM -static inline uint16_t pgm_read_word(const uint16_t* addr) +static inline uint16_t read_word(const uint16_t* addr) { #ifndef __AVR__ return *addr; #else - return (uint16_t)::pgm_read_word(addr); + return (uint16_t)pgm_read_word(addr); #endif } diff --git a/tests/unit/hal/progmem/test_progmem.cpp b/tests/unit/hal/progmem/test_progmem.cpp index abd54f7..ab0da9a 100644 --- a/tests/unit/hal/progmem/test_progmem.cpp +++ b/tests/unit/hal/progmem/test_progmem.cpp @@ -2,14 +2,14 @@ #include "progmem.h" using Catch::Matchers::Equals; -using hal::progmem::pgm_read_word; +namespace pm = hal::progmem; -TEST_CASE("progmem::basic", "[progmem]") { +TEST_CASE("progmem::read_word", "[progmem]") { // create a PROGMEM array const uint16_t arr[2] PROGMEM = {0, 1}; // ensure it can be read correctly - REQUIRE(0 == pgm_read_word(&arr[0])); - REQUIRE(1 == pgm_read_word(&arr[1])); + REQUIRE(0 == pm::read_word(&arr[0])); + REQUIRE(1 == pm::read_word(&arr[1])); }