X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/9d18e10afb2439a6a9ba6978a799259746a837b7..0e08764c8201f13bd03e685bfc7a2e5ee65dc540:/drivers/sensors/tsl2561/tsl2561.c?ds=sidebyside diff --git a/drivers/sensors/tsl2561/tsl2561.c b/drivers/sensors/tsl2561/tsl2561.c index 79027b5..db82dbe 100644 --- a/drivers/sensors/tsl2561/tsl2561.c +++ b/drivers/sensors/tsl2561/tsl2561.c @@ -71,8 +71,6 @@ extern volatile uint8_t I2CMasterBuffer[I2C_BUFSIZE]; extern volatile uint8_t I2CSlaveBuffer[I2C_BUFSIZE]; extern volatile uint32_t I2CReadLength, I2CWriteLength; -uint32_t i; - static bool _tsl2561Initialised = false; static tsl2561IntegrationTime_t _tsl2561IntegrationTime = TSL2561_INTEGRATIONTIME_402MS; static tsl2561Gain_t _tsl2561Gain = TSL2561_GAIN_0X; @@ -85,6 +83,7 @@ static tsl2561Gain_t _tsl2561Gain = TSL2561_GAIN_0X; tsl2561Error_t tsl2561WriteCmd (uint8_t cmd) { // Clear write buffers + uint32_t i; for ( i = 0; i < I2C_BUFSIZE; i++ ) { I2CMasterBuffer[i] = 0x00; @@ -106,6 +105,7 @@ tsl2561Error_t tsl2561WriteCmd (uint8_t cmd) tsl2561Error_t tsl2561Write8 (uint8_t reg, uint32_t value) { // Clear write buffers + uint32_t i; for ( i = 0; i < I2C_BUFSIZE; i++ ) { I2CMasterBuffer[i] = 0x00; @@ -128,6 +128,7 @@ tsl2561Error_t tsl2561Write8 (uint8_t reg, uint32_t value) tsl2561Error_t tsl2561Read16(uint8_t reg, uint16_t *value) { // Clear write buffers + uint32_t i; for ( i = 0; i < I2C_BUFSIZE; i++ ) { I2CMasterBuffer[i] = 0x00;