Skip to content

Commit

Permalink
Update incorrect device id
Browse files Browse the repository at this point in the history
  • Loading branch information
aeraterta committed Jan 15, 2025
1 parent 2b2020a commit 9f93eba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/adxl345.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool adxl345_online(void) {
ADXL345_STATUS_SUCCESS) {
return ADXL345_STATUS_API_ERR;
}
if (val != 0x0E) {
if (val != ADXL345_DEV_ID) {
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/adxl345.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef enum {
/*****************************ID REGISTERS*************************************/

#define ADXL345_I2C_ADDRESS 0x53
#define ADXL345_DEV_ID 0X0E
#define ADXL345_DEV_ID 0xE5

/*********************************MASKS****************************************/
/*********************************REGISTERS************************************/
Expand Down
2 changes: 1 addition & 1 deletion test/test_adxl345.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void test_adxl345_setup(void) {
}

void test_adxl345_online(void) {
uint8_t read_data_result = 0x0E;
uint8_t read_data_result = 0xE5;
i2c_read_byte_ExpectAndReturn(ADXL345_I2C_ADDRESS, ADXL345_REG_DEV_ID, NULL,
ADXL345_STATUS_SUCCESS);
i2c_read_byte_IgnoreArg_read_data();
Expand Down

0 comments on commit 9f93eba

Please sign in to comment.