Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Encapsulate const TMF8801_DEFAULT_I2C_ADDR within TMF8801 namespace. #37

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/TMF8801-Basic/TMF8801-Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static uint8_t const MEASUREMENT_PERIOD_ms = 100;
ArduinoTMF8801 tmf8801(i2c_generic_write,
i2c_generic_read,
delay,
TMF8801_DEFAULT_I2C_ADDR,
TMF8801::DEFAULT_I2C_ADDR,
TMF8801_CALIB_DATA,
TMF8801_ALGO_STATE,
[](unit::Length const distance)
Expand Down
2 changes: 1 addition & 1 deletion examples/TMF8801-FactoryCalib/TMF8801-FactoryCalib.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ using namespace drone;
* CONSTANTS
**************************************************************************************/

static uint8_t const TMF8801_I2C_ADDR = TMF8801_DEFAULT_I2C_ADDR;
static uint8_t const TMF8801_I2C_ADDR = TMF8801::DEFAULT_I2C_ADDR;

/**************************************************************************************
* FUNCTION DECLARATION
Expand Down
2 changes: 1 addition & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ onExternalEventHandler KEYWORD2
# Constants (LITERAL1)
#######################################

TMF8801_DEFAULT_I2C_ADDR LITERAL1
DEFAULT_I2C_ADDR LITERAL1
6 changes: 0 additions & 6 deletions src/107-Arduino-TMF8801.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
namespace drone
{

/**************************************************************************************
* CONSTANTS
**************************************************************************************/

static uint8_t constexpr TMF8801_DEFAULT_I2C_ADDR = 0x41;

/**************************************************************************************
* CLASS DECLARATION
**************************************************************************************/
Expand Down
1 change: 1 addition & 0 deletions src/TMF8801/TMF8801_Const.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ enum class Error : int
**************************************************************************************/

static uint8_t constexpr ID_EXPECTED_ID = 0x07;
static uint8_t constexpr DEFAULT_I2C_ADDR = 0x41;

/**************************************************************************************
* CONVERSION FUNCTIONS
Expand Down