Skip to content

Commit 1b3c34a

Browse files
authored
Fix indentation
1 parent e91e10a commit 1b3c34a

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

cores/esp32/esp32-hal-spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ void spiTransaction(spi_t * spi, uint32_t clockDiv, uint8_t dataMode, uint8_t bi
10911091
if(!spi) {
10921092
return;
10931093
}
1094-
SPI_MUTEX_LOCK();
1094+
SPI_MUTEX_LOCK();
10951095
spi->dev->clock.val = clockDiv;
10961096
switch (dataMode) {
10971097
case SPI_MODE1:
@@ -1142,7 +1142,7 @@ void spiSimpleTransaction(spi_t * spi)
11421142
if(!spi) {
11431143
return;
11441144
}
1145-
SPI_MUTEX_LOCK();
1145+
SPI_MUTEX_LOCK();
11461146
}
11471147

11481148
void spiEndTransaction(spi_t * spi)

libraries/SPI/src/SPI.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,30 @@ SPIClass::SPIClass(uint8_t spi_bus)
4141
,_div(0)
4242
,_freq(1000000)
4343
,_inTransaction(false)
44-
#if !CONFIG_DISABLE_HAL_LOCKS
44+
#if !CONFIG_DISABLE_HAL_LOCKS
4545
,paramLock(NULL)
46-
#endif
4746
{
48-
#if !CONFIG_DISABLE_HAL_LOCKS
4947
if(paramLock==NULL){
5048
paramLock = xSemaphoreCreateMutex();
5149
if(paramLock==NULL){
5250
log_e("xSemaphoreCreateMutex failed");
5351
return;
5452
}
5553
}
56-
#endif
5754
}
55+
#else
56+
{}
57+
#endif
5858

5959
SPIClass::~SPIClass()
6060
{
6161
end();
62-
#if !CONFIG_DISABLE_HAL_LOCKS
62+
#if !CONFIG_DISABLE_HAL_LOCKS
6363
if(paramLock!=NULL){
6464
vSemaphoreDelete(paramLock);
6565
paramLock = NULL;
6666
}
67-
#endif
67+
#endif
6868
}
6969

7070
void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
@@ -140,22 +140,22 @@ void SPIClass::setHwCs(bool use)
140140
void SPIClass::setFrequency(uint32_t freq)
141141
{
142142
SPI_PARAM_LOCK();
143-
//check if last freq changed
143+
//check if last freq changed
144144
uint32_t cdiv = spiGetClockDiv(_spi);
145145
if(_freq != freq || _div != cdiv) {
146146
_freq = freq;
147147
_div = spiFrequencyToClockDiv(_freq);
148148
spiSetClockDiv(_spi, _div);
149149
}
150-
SPI_PARAM_UNLOCK();
150+
SPI_PARAM_UNLOCK();
151151
}
152152

153153
void SPIClass::setClockDivider(uint32_t clockDiv)
154154
{
155155
SPI_PARAM_LOCK();
156-
_div = clockDiv;
156+
_div = clockDiv;
157157
spiSetClockDiv(_spi, _div);
158-
SPI_PARAM_UNLOCK();
158+
SPI_PARAM_UNLOCK();
159159
}
160160

161161
uint32_t SPIClass::getClockDivider()
@@ -176,7 +176,7 @@ void SPIClass::setBitOrder(uint8_t bitOrder)
176176
void SPIClass::beginTransaction(SPISettings settings)
177177
{
178178
SPI_PARAM_LOCK();
179-
//check if last freq changed
179+
//check if last freq changed
180180
uint32_t cdiv = spiGetClockDiv(_spi);
181181
if(_freq != settings._clock || _div != cdiv) {
182182
_freq = settings._clock;
@@ -191,7 +191,7 @@ void SPIClass::endTransaction()
191191
if(_inTransaction){
192192
_inTransaction = false;
193193
spiEndTransaction(_spi);
194-
SPI_PARAM_UNLOCK(); // <-- Im not sure should it be here or right after spiTransaction()
194+
SPI_PARAM_UNLOCK(); // <-- Im not sure should it be here or right after spiTransaction()
195195
}
196196
}
197197

libraries/SPI/src/SPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ class SPIClass
5252
uint32_t _div;
5353
uint32_t _freq;
5454
bool _inTransaction;
55-
#if !CONFIG_DISABLE_HAL_LOCKS
55+
#if !CONFIG_DISABLE_HAL_LOCKS
5656
SemaphoreHandle_t paramLock=NULL;
57-
#endif
57+
#endif
5858
void writePattern_(const uint8_t * data, uint8_t size, uint8_t repeat);
5959

6060
public:

0 commit comments

Comments
 (0)