Skip to content

Commit

Permalink
Rename sources to prevent conflicts with other Arduino libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Erriez committed Aug 4, 2018
1 parent 45d2d06 commit cbb98f3
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 29 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ include_directories(${LIB_SRC_DIR})
generate_arduino_library(
${PROJECT_NAME}Lib
SRCS
${LIB_SRC_DIR}/BH1750.cpp
${LIB_SRC_DIR}/ErriezBH1750.cpp
HDRS
${LIB_SRC_DIR}/BH1750.h
${LIB_SRC_DIR}/BH1750_priv.h
${LIB_SRC_DIR}/ErriezBH1750.h
${LIB_SRC_DIR}/ErriezBH1750_regs.h
)

# Configure project
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Examples | Erriez BH1750:

```c++
#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down Expand Up @@ -154,7 +154,7 @@ Light: 667.5 LUX

```c++
#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#include <Wire.h>
#include <BH1750.h>
#include <ErriezBH1750.h>

// ADDR line LOW/open: I2C address 0x23 (0x46 including R/W bit) [default]
// ADDR line HIGH: I2C address 0x5C (0xB8 including R/W bit)
Expand Down
2 changes: 1 addition & 1 deletion platformio/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* https://github.com/Erriez/ErriezDHT22
*/

#include <DHT22.h>
#include <ErriezDHT22.h>

// Connect DTH22 data pin to Arduino DIGITAL pin
#define DHT22_PIN 2
Expand Down
6 changes: 3 additions & 3 deletions src/BH1750.cpp → src/ErriezBH1750.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
*/

/*!
* \file BH1750.cpp
* \file ErriezBH1750.cpp
* \brief BH1750 digital light sensor library for Arduino.
* \details
* Source: https://github.com/Erriez/ErriezBH1750
* Documentation: https://erriez.github.io/ErriezBH1750
*/

#include "BH1750.h"
#include "BH1750_priv.h"
#include "ErriezBH1750.h"
#include "ErriezBH1750_regs.h"

/*!
* \brief
Expand Down
8 changes: 4 additions & 4 deletions src/BH1750.h → src/ErriezBH1750.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
*/

/*!
* \file BH1750.h
* \file ErriezBH1750.h
* \brief BH1750 digital light sensor library for Arduino.
* \details
* Source: https://github.com/Erriez/ErriezBH1750
* Documentation: https://erriez.github.io/ErriezBH1750
*/

#ifndef BH1750_H__
#define BH1750_H__
#ifndef ERRIEZ_BH1750_H__
#define ERRIEZ_BH1750_H__

#include <Arduino.h>
#include <Wire.h>
Expand Down Expand Up @@ -71,4 +71,4 @@ class BH1750
uint8_t _mode;
};

#endif // BH1750_H__
#endif // ERRIEZ_BH1750_H__
12 changes: 5 additions & 7 deletions src/BH1750_priv.h → src/ErriezBH1750_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@
*/

/*!
* \file
* BH1750_priv.h
* \brief
* BH1750 digital light sensor library for Arduino.
* \file ErriezBH1750_regs.h
* \brief BH1750 digital light sensor library for Arduino.
* \details
* Source: https://github.com/Erriez/ErriezBH1750
* Documentation: https://erriez.github.io/ErriezBH1750
*/

#ifndef BH1750_PRIV_H__
#define BH1750_PRIV_H__
#ifndef ERRIEZ_BH1750_REGS_H_
#define ERRIEZ_BH1750_REGS_H_

// I2C addresses (without R/W bit)
#define BH1750_I2C_ADDR_L 0x23 //!< I2C address with ADDR pin low
Expand Down Expand Up @@ -83,4 +81,4 @@
#define GET_TIMEOUT(mode) ((((mode) & BH1750_RES_MASK) == ResolutionLow) ? \
BH1750_CONV_TIME_L : BH1750_CONV_TIME_H)

#endif // BH1750_PRIV_H__
#endif // ERRIEZ_BH1750_REGS_H_

0 comments on commit cbb98f3

Please sign in to comment.