forked from xuos/xiuos
fix test_i2c WriteReg coredump error
This commit is contained in:
parent
3c1129d88a
commit
aa6fb2a8b0
|
@ -35,6 +35,7 @@
|
||||||
#define ADDR 0x44 /* slave address */
|
#define ADDR 0x44 /* slave address */
|
||||||
|
|
||||||
static struct Bus *i2c_bus = NONE; /* I2C bus handle */
|
static struct Bus *i2c_bus = NONE; /* I2C bus handle */
|
||||||
|
static char addr = 0x44;
|
||||||
|
|
||||||
typedef struct Hs300xData
|
typedef struct Hs300xData
|
||||||
{
|
{
|
||||||
|
@ -50,6 +51,9 @@ static x_err_t WriteReg(struct HardwareDev *dev)
|
||||||
{
|
{
|
||||||
struct BusBlockWriteParam write_param;
|
struct BusBlockWriteParam write_param;
|
||||||
|
|
||||||
|
write_param.buffer = &addr;
|
||||||
|
write_param.size = 1;
|
||||||
|
|
||||||
/* use I2C device API transfer data */
|
/* use I2C device API transfer data */
|
||||||
if(1 == BusDevWriteData(dev, &write_param)) {
|
if(1 == BusDevWriteData(dev, &write_param)) {
|
||||||
return EOK;
|
return EOK;
|
||||||
|
|
Loading…
Reference in New Issue