Skip to content

Commit

Permalink
removed unnecessary debugging prints and defines
Browse files Browse the repository at this point in the history
  • Loading branch information
aeraterta committed Jan 21, 2025
1 parent 8906d57 commit 21feb5c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
9 changes: 0 additions & 9 deletions src/adxl345.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,6 @@ int8_t adxl345_get_raw_z(adxl345_dev *device, adxl345_axes_data *data) {
int8_t adxl345_get_raw_xyz(adxl345_dev *device, adxl345_axes_data *data) {
uint8_t val[6];

printf("resolution: %d\r\n", device->resolution.resolution);
printf("bits: %d\r\n", device->resolution.bits);
printf("mask: %d\r\n", device->resolution.mask);
printf("scale: %d\r\n", device->scale.scale);

if (i2c_read_byte(ADXL345_I2C_ADDRESS, ADXL345_REG_DATAX1, &val[1]) !=
ADXL345_STATUS_SUCCESS) {
return ADXL345_STATUS_API_ERR;
Expand Down Expand Up @@ -677,10 +672,6 @@ int8_t adxl345_get_raw_xyz(adxl345_dev *device, adxl345_axes_data *data) {
return ADXL345_STATUS_API_ERR;
}

printf("X: 0x%.4X\r\n", (val[1] << 8) | val[0]);
printf("Y: 0x%.4X\r\n", (val[3] << 8) | val[3]);
printf("Z: 0x%.4X\r\n", (val[5] << 8) | val[4]);

data->raw_data.x = ((val[1] << 8) | val[0]) >> device->resolution.mask;
data->raw_data.y = ((val[3] << 8) | val[2]) >> device->resolution.mask;
data->raw_data.z = ((val[5] << 8) | val[4]) >> device->resolution.mask;
Expand Down
5 changes: 0 additions & 5 deletions src/adxl345.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
#include "utils/i2c.h"

/*******************************CONSTANTS**************************************/
#define SENSITIVITY_FULL_RES 3.9
#define SENSITIVITY_10BIT_2G 3.9
#define SENSITIVITY_10BIT_4G 7.8
#define SENSITIVITY_10BIT_8G 15.6
#define SENSITIVITY_10BIT_16G 31.2

#define ADXL345_INT1_PIN 0x00
#define ADXL345_INT2_PIN 0x01
Expand Down

0 comments on commit 21feb5c

Please sign in to comment.