diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-05 23:49:26 -0600 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2021-12-10 12:00:26 -0500 |
commit | 762af872d2f2c977e51d6e51b8c3ad622485cc05 (patch) | |
tree | 0fd44fe4996b04a82c5c0cc46178b5893d3ae1c0 /watch-library/driver | |
parent | 316e1f292c603885f2af3dcd69ce797d64776425 (diff) | |
download | Sensor-Watch-762af872d2f2c977e51d6e51b8c3ad622485cc05.tar.gz Sensor-Watch-762af872d2f2c977e51d6e51b8c3ad622485cc05.tar.bz2 Sensor-Watch-762af872d2f2c977e51d6e51b8c3ad622485cc05.zip |
fix missing prototype warnings
Diffstat (limited to 'watch-library/driver')
-rw-r--r-- | watch-library/driver/lis2dh.c | 16 | ||||
-rw-r--r-- | watch-library/driver/lis2dh.h | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/watch-library/driver/lis2dh.c b/watch-library/driver/lis2dh.c index 21087bef..20702bf5 100644 --- a/watch-library/driver/lis2dh.c +++ b/watch-library/driver/lis2dh.c @@ -25,7 +25,7 @@ #include "lis2dh.h" #include "watch.h" -bool lis2dh_begin() { +bool lis2dh_begin(void) { if (lis2dh_get_device_id() != LIS2DH_WHO_AM_I_VAL) { return false; } @@ -40,16 +40,16 @@ bool lis2dh_begin() { return true; } -uint8_t lis2dh_get_device_id() { +uint8_t lis2dh_get_device_id(void) { return watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_WHO_AM_I); } -bool lis2dh_have_new_data() { +bool lis2dh_have_new_data(void) { uint8_t retval = watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_STATUS); return !!retval; // return true if any bit is set } -lis2dh_reading lis2dh_get_raw_reading() { +lis2dh_reading lis2dh_get_raw_reading(void) { uint8_t buffer[6]; uint8_t reg = LIS2DH_REG_OUT_X_L | 0x80; // set high bit for consecutive reads lis2dh_reading retval; @@ -97,7 +97,7 @@ void lis2dh_set_range(lis2dh_range_t range) { watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL4, val | bits); } -lis2dh_range_t lis2dh_get_range() { +lis2dh_range_t lis2dh_get_range(void) { uint8_t retval = watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL4) & 0x30; retval >>= 4; return (lis2dh_range_t)retval; @@ -111,7 +111,7 @@ void lis2dh_set_data_rate(lis2dh_data_rate_t dataRate) { watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL1, val | bits); } -lis2dh_data_rate_t lis2dh_get_data_rate() { +lis2dh_data_rate_t lis2dh_get_data_rate(void) { return watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL1) >> 4; } @@ -124,7 +124,7 @@ void lis2dh_configure_aoi_int1(lis2dh_interrupt_configuration configuration, uin watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL5, val | latch ? LIS2DH_CTRL5_VAL_LIR_INT1 : 0); } -lis2dh_interrupt_state lis2dh_get_int1_state() { +lis2dh_interrupt_state lis2dh_get_int1_state(void) { return (lis2dh_interrupt_state) watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_INT1_SRC); } @@ -137,7 +137,7 @@ void lis2dh_configure_aoi_int2(lis2dh_interrupt_configuration configuration, uin watch_i2c_write8(LIS2DH_ADDRESS, LIS2DH_REG_CTRL5, val | latch ? LIS2DH_CTRL5_VAL_LIR_INT2 : 0); } -lis2dh_interrupt_state lis2dh_get_int2_state() { +lis2dh_interrupt_state lis2dh_get_int2_state(void) { return (lis2dh_interrupt_state) watch_i2c_read8(LIS2DH_ADDRESS, LIS2DH_REG_INT2_SRC); } diff --git a/watch-library/driver/lis2dh.h b/watch-library/driver/lis2dh.h index ddd42126..68831519 100644 --- a/watch-library/driver/lis2dh.h +++ b/watch-library/driver/lis2dh.h @@ -84,31 +84,31 @@ typedef enum { LIS2DH_INTERRUPT_STATE_X_LOW = 0b00000001, // X down } lis2dh_interrupt_state; -bool lis2dh_begin(); +bool lis2dh_begin(void); -uint8_t lis2dh_get_device_id(); +uint8_t lis2dh_get_device_id(void); -bool lis2dh_have_new_data(); +bool lis2dh_have_new_data(void); -lis2dh_reading lis2dh_get_raw_reading(); +lis2dh_reading lis2dh_get_raw_reading(void); lis2dh_acceleration_measurement lis2dh_get_acceleration_measurement(lis2dh_reading *out_reading); void lis2dh_set_range(lis2dh_range_t range); -lis2dh_range_t lis2dh_get_range(); +lis2dh_range_t lis2dh_get_range(void); void lis2dh_set_data_rate(lis2dh_data_rate_t dataRate); -lis2dh_data_rate_t lis2dh_get_data_rate(); +lis2dh_data_rate_t lis2dh_get_data_rate(void); void lis2dh_configure_aoi_int1(lis2dh_interrupt_configuration configuration, uint8_t threshold, uint8_t duration, bool latch); -lis2dh_interrupt_state lis2dh_get_int1_state(); +lis2dh_interrupt_state lis2dh_get_int1_state(void); void lis2dh_configure_aoi_int2(lis2dh_interrupt_configuration configuration, uint8_t threshold, uint8_t duration, bool latch); -lis2dh_interrupt_state lis2dh_get_int2_state(); +lis2dh_interrupt_state lis2dh_get_int2_state(void); // Assumes SA0 is high; if low, its 0x18 #define LIS2DH_ADDRESS (0x19) |