Skip to content

Commit 7d86021

Browse files
committed
Issue #1205 - Fixed mismatching return types for mpl3115.c and sx9500.h
Closes #1205 Closes #1110
1 parent 56c3ce4 commit 7d86021

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

src/peripherals/mpl3115.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ typedef enum
5252
*
5353
* \param [IN]: addr
5454
* \param [IN]: data
55+
*
5556
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
5657
*/
5758
LmnStatus_t MPL3115Write( uint8_t addr, uint8_t data );
@@ -62,6 +63,7 @@ LmnStatus_t MPL3115Write( uint8_t addr, uint8_t data );
6263
* \param [IN]: addr
6364
* \param [IN]: data
6465
* \param [IN]: size
66+
*
6567
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
6668
*/
6769
LmnStatus_t MPL3115WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size );
@@ -71,6 +73,7 @@ LmnStatus_t MPL3115WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size );
7173
*
7274
* \param [IN]: addr
7375
* \param [OUT]: data
76+
*
7477
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
7578
*/
7679
LmnStatus_t MPL3115Read( uint8_t addr, uint8_t *data );
@@ -81,6 +84,7 @@ LmnStatus_t MPL3115Read( uint8_t addr, uint8_t *data );
8184
* \param [IN]: addr
8285
* \param [OUT]: data
8386
* \param [IN]: size
87+
*
8488
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
8589
*/
8690
LmnStatus_t MPL3115ReadBuffer( uint8_t addr, uint8_t *data, uint8_t size );
@@ -186,7 +190,7 @@ void MPL3115SetDeviceAddr( uint8_t addr )
186190
I2cDeviceAddr = addr;
187191
}
188192

189-
LmnStatus_t MPL3115GetDeviceAddr( void )
193+
uint8_t MPL3115GetDeviceAddr( void )
190194
{
191195
return I2cDeviceAddr;
192196
}
@@ -336,7 +340,7 @@ float MPL3115ReadTemperature( void )
336340

337341
if( msb > 0x7F )
338342
{
339-
val = ~( ( msb << 8 ) + lsb ) + 1; // 2s complement
343+
val = ~( ( msb << 8 ) + lsb ) + 1; // 2's complement
340344
msb = val >> 8;
341345
lsb = val & 0x00F0;
342346
negSign = true;

src/peripherals/sx9500.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,52 +57,56 @@ extern "C"
5757

5858
#define SX9500_RESET_CMD 0xDE
5959

60-
uint8_t SX9500Init( void );
60+
LmnStatus_t SX9500Init( void );
6161

6262
/*!
6363
* \brief Resets the device
6464
*
65-
* \retval status [OK, ERROR, UNSUPPORTED]
65+
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
6666
*/
67-
uint8_t SX9500Reset( void );
67+
LmnStatus_t SX9500Reset( void );
6868

6969
/*!
7070
* \brief Writes a byte at specified address in the device
7171
*
7272
* \param [IN]: addr
7373
* \param [IN]: data
74-
* \retval status [OK, ERROR, UNSUPPORTED]
74+
*
75+
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
7576
*/
76-
uint8_t SX9500Write( uint8_t addr, uint8_t data );
77+
LmnStatus_t SX9500Write( uint8_t addr, uint8_t data );
7778

7879
/*!
7980
* \brief Writes a buffer at specified address in the device
8081
*
8182
* \param [IN]: addr
8283
* \param [IN]: data
8384
* \param [IN]: size
84-
* \retval status [OK, ERROR, UNSUPPORTED]
85+
*
86+
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
8587
*/
86-
uint8_t SX9500WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size );
88+
LmnStatus_t SX9500WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size );
8789

8890
/*!
8991
* \brief Reads a byte at specified address in the device
9092
*
9193
* \param [IN]: addr
9294
* \param [OUT]: data
93-
* \retval status [OK, ERROR, UNSUPPORTED]
95+
*
96+
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
9497
*/
95-
uint8_t SX9500Read( uint8_t addr, uint8_t *data );
98+
LmnStatus_t SX9500Read( uint8_t addr, uint8_t *data );
9699

97100
/*!
98101
* \brief Reads a buffer at specified address in the device
99102
*
100103
* \param [IN]: addr
101104
* \param [OUT]: data
102105
* \param [IN]: size
103-
* \retval status [OK, ERROR, UNSUPPORTED]
106+
*
107+
* \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
104108
*/
105-
uint8_t SX9500ReadBuffer( uint8_t addr, uint8_t *data, uint8_t size );
109+
LmnStatus_t SX9500ReadBuffer( uint8_t addr, uint8_t *data, uint8_t size );
106110

107111
/*!
108112
* \brief Sets the I2C device slave address

0 commit comments

Comments
 (0)