Merge pull request #10705 from keestux/eliminate-cast-bh1750fvi
drivers/bh1750fvi: change prototype of bh1750fvi_init
This commit is contained in:
commit
b005fa7da0
@ -28,7 +28,7 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params)
|
int bh1750fvi_init(bh1750fvi_t *dev, const bh1750fvi_params_t *params)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ typedef struct {
|
|||||||
* @return 0 on success
|
* @return 0 on success
|
||||||
* @return -1 if unable to speak to the device
|
* @return -1 if unable to speak to the device
|
||||||
*/
|
*/
|
||||||
int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params);
|
int bh1750fvi_init(bh1750fvi_t *dev, const bh1750fvi_params_t *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Read a ambient light value from the given device [in LUX]
|
* @brief Read a ambient light value from the given device [in LUX]
|
||||||
|
|||||||
@ -35,7 +35,7 @@ int main(void)
|
|||||||
puts("BH1750FVI ambient light sensor test\n");
|
puts("BH1750FVI ambient light sensor test\n");
|
||||||
|
|
||||||
/* initialize the device */
|
/* initialize the device */
|
||||||
res = bh1750fvi_init(&dev, (bh1750fvi_params_t *)(&bh1750fvi_params));
|
res = bh1750fvi_init(&dev, &bh1750fvi_params[0]);
|
||||||
if (res != BH1750FVI_OK) {
|
if (res != BH1750FVI_OK) {
|
||||||
puts("error: unable to initialize sensor [I2C initialization error]");
|
puts("error: unable to initialize sensor [I2C initialization error]");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user