Skip to content

Commit

Permalink
Fixed id on test program
Browse files Browse the repository at this point in the history
  • Loading branch information
sunipkm committed May 14, 2021
1 parent f46f3a1 commit e26c5a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EDDEBUG:=$(DEBUG)
EDCFLAGS:= -Wall -std=gnu11 $(EDCFLAGS) $(EDDEBUG)
EDLDFLAGS:= -lm -lpthread $(EDLDFLAGS)

test: EDCFLAGS:= -O2 -DUNIT_TEST $(EDCFLAGS)
test: EDCFLAGS:= -O2 -DLSM9DS1_UNIT_TEST $(EDCFLAGS)

BUILDDRV=drivers/i2cbus/i2cbus.o

Expand Down
4 changes: 2 additions & 2 deletions lsm9ds1.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void lsm9ds1_destroy(lsm9ds1 *dev)
i2cbus_close(dev->mag_dev);
}

#ifdef UNIT_TEST
#ifdef LSM9DS1_UNIT_TEST
#include <stdio.h>
#include <signal.h>

Expand All @@ -218,7 +218,7 @@ int main(int argc, char *argv[])
printf("Invocation: ./%s <Bus ID>\n\n", argv[0]);
return 0;
}
int id = atoi(argv[0]);
int id = atoi(argv[1]);
int xl_addr = LSM9DS1_XL_ADDR;
int mag_addr = LSM9DS1_MAG_ADDR;
lsm9ds1 *dev = (lsm9ds1 *)malloc(sizeof(lsm9ds1));
Expand Down

0 comments on commit e26c5a4

Please sign in to comment.