Skip to content

Commit ba5551f

Browse files
committed
fix: apply astyle source code formatting
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 1fac24e commit ba5551f

2 files changed

Lines changed: 29 additions & 34 deletions

File tree

src/ISM330DHCXSensor.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ISM330DHCXSensor::ISM330DHCXSensor(SPIClass *spi, int cs_pin, uint32_t spi_speed
2828
reg_ctx.read_reg = ISM330DHCX_io_read;
2929
reg_ctx.handle = (void *) this;
3030
dev_i2c = NULL;
31-
address = 0U;
31+
address = 0U;
3232
acc_is_enabled = 0U;
3333
gyro_is_enabled = 0U;
3434
}
@@ -92,15 +92,13 @@ ISM330DHCXStatusTypeDef ISM330DHCXSensor::Init()
9292
*/
9393
ISM330DHCXStatusTypeDef ISM330DHCXSensor::begin()
9494
{
95-
if(dev_spi)
96-
{
95+
if (dev_spi) {
9796
// Configure CS pin
9897
pinMode(cs_pin, OUTPUT);
99-
digitalWrite(cs_pin, HIGH);
98+
digitalWrite(cs_pin, HIGH);
10099
}
101100

102-
if (Init() != ISM330DHCX_OK)
103-
{
101+
if (Init() != ISM330DHCX_OK) {
104102
return ISM330DHCX_ERROR;
105103
}
106104

@@ -114,21 +112,18 @@ ISM330DHCXStatusTypeDef ISM330DHCXSensor::begin()
114112
ISM330DHCXStatusTypeDef ISM330DHCXSensor::end()
115113
{
116114
/* Disable both acc and gyro */
117-
if (ACC_Disable() != ISM330DHCX_OK)
118-
{
115+
if (ACC_Disable() != ISM330DHCX_OK) {
119116
return ISM330DHCX_ERROR;
120117
}
121118

122-
if (GYRO_Disable() != ISM330DHCX_OK)
123-
{
119+
if (GYRO_Disable() != ISM330DHCX_OK) {
124120
return ISM330DHCX_ERROR;
125121
}
126122

127123
/* Reset CS configuration */
128-
if(dev_spi)
129-
{
124+
if (dev_spi) {
130125
// Configure CS pin
131-
pinMode(cs_pin, INPUT);
126+
pinMode(cs_pin, INPUT);
132127
}
133128

134129
return ISM330DHCX_OK;

src/ism330dhcx_reg.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,23 @@ extern "C" {
5757
*/
5858

5959
typedef union {
60-
int16_t i16bit[3];
61-
uint8_t u8bit[6];
60+
int16_t i16bit[3];
61+
uint8_t u8bit[6];
6262
} axis3bit16_t;
6363

6464
typedef union {
65-
int16_t i16bit;
66-
uint8_t u8bit[2];
65+
int16_t i16bit;
66+
uint8_t u8bit[2];
6767
} axis1bit16_t;
6868

6969
typedef union {
70-
int32_t i32bit[3];
71-
uint8_t u8bit[12];
70+
int32_t i32bit[3];
71+
uint8_t u8bit[12];
7272
} axis3bit32_t;
7373

7474
typedef union {
75-
int32_t i32bit;
76-
uint8_t u8bit[4];
75+
int32_t i32bit;
76+
uint8_t u8bit[4];
7777
} axis1bit32_t;
7878

7979
/**
@@ -82,14 +82,14 @@ typedef union {
8282
*/
8383

8484
typedef struct {
85-
uint8_t bit0 : 1;
86-
uint8_t bit1 : 1;
87-
uint8_t bit2 : 1;
88-
uint8_t bit3 : 1;
89-
uint8_t bit4 : 1;
90-
uint8_t bit5 : 1;
91-
uint8_t bit6 : 1;
92-
uint8_t bit7 : 1;
85+
uint8_t bit0 : 1;
86+
uint8_t bit1 : 1;
87+
uint8_t bit2 : 1;
88+
uint8_t bit3 : 1;
89+
uint8_t bit4 : 1;
90+
uint8_t bit5 : 1;
91+
uint8_t bit6 : 1;
92+
uint8_t bit7 : 1;
9393
} bitwise_t;
9494

9595
#define PROPERTY_DISABLE (0U)
@@ -140,11 +140,11 @@ typedef int32_t (*ism330dhcx_write_ptr)(void *, uint8_t, uint8_t *, uint16_t);
140140
typedef int32_t (*ism330dhcx_read_ptr)(void *, uint8_t, uint8_t *, uint16_t);
141141

142142
typedef struct {
143-
/** Component mandatory fields **/
144-
ism330dhcx_write_ptr write_reg;
145-
ism330dhcx_read_ptr read_reg;
146-
/** Customizable optional pointer **/
147-
void *handle;
143+
/** Component mandatory fields **/
144+
ism330dhcx_write_ptr write_reg;
145+
ism330dhcx_read_ptr read_reg;
146+
/** Customizable optional pointer **/
147+
void *handle;
148148
} ism330dhcx_ctx_t;
149149

150150
/**

0 commit comments

Comments
 (0)