Skip to content

Commit e1e152a

Browse files
authored
Fix SonarQube issue: convert macro to function (speeduino#1419)
1 parent 4a65199 commit e1e152a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ArduinoFake/FakeMega.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using namespace fakeit;
99
static std::array<unsigned char, 4096> eepromBuffer;
1010
static std::stringstream serialBuffer;
1111

12+
static constexpr uint8_t _BV(uint8_t shift) { return 1U << shift; }
13+
1214
static void fakeMegaWiring(fakeit::Mock<FunctionFake> &mock)
1315
{
1416
static constexpr uint8_t PA = 1;
@@ -98,7 +100,6 @@ static void fakeMegaWiring(fakeit::Mock<FunctionFake> &mock)
98100
PK , // PK 7 ** 69 ** A15
99101
};
100102

101-
#define _BV(bit) (1 << (bit))
102103
static constexpr uint8_t digital_pin_to_bit_mask[] = {
103104
// PIN IN PORT
104105
// -------------------------------------------

0 commit comments

Comments
 (0)