Skip to content

Commit c004ee3

Browse files
codestyle unification
1 parent d0d4f8c commit c004ee3

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

src/utility/spi_drv.cpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#define digitalWrite(pin, value) FPGA.digitalWrite(pin, value)
4646
#endif
4747

48-
//#define _DEBUG_
48+
// #define _DEBUG_
4949
extern "C" {
5050
#include "utility/debug.h"
5151
}
@@ -94,7 +94,7 @@ void SpiDrv::begin()
9494
if (SLAVERESET > PINS_COUNT) {
9595
inverted_reset = true;
9696
SLAVERESET = ~SLAVERESET;
97-
}
97+
}
9898
#endif
9999

100100
pinMode(SLAVESELECT, OUTPUT);
@@ -252,12 +252,12 @@ int SpiDrv::waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8
252252
// Get Params data
253253
//param[ii] = spiTransfer(DUMMY_DATA);
254254
getParam(&param[ii]);
255-
}
256-
}
255+
}
256+
}
257257

258258
readAndCheckChar(END_CMD, &_data);
259-
}
260-
259+
}
260+
261261
return 1;
262262
}
263263
/*
@@ -277,12 +277,12 @@ int SpiDrv::waitResponse(uint8_t cmd, uint8_t numParam, uint8_t* param, uint16_t
277277
{
278278
// Get Params data
279279
param[ii] = spiTransfer(DUMMY_DATA);
280-
}
281-
}
280+
}
281+
}
282282
283283
readAndCheckChar(END_CMD, &_data);
284-
}
285-
284+
}
285+
286286
return 1;
287287
}
288288
*/
@@ -298,18 +298,18 @@ int SpiDrv::waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len)
298298

299299
uint8_t numParam = readChar();
300300
if (numParam != 0)
301-
{
301+
{
302302
readParamLen16(param_len);
303303
for (ii=0; ii<(*param_len); ++ii)
304304
{
305305
// Get Params data
306306
param[ii] = spiTransfer(DUMMY_DATA);
307-
}
308-
}
307+
}
308+
}
309309

310310
readAndCheckChar(END_CMD, &_data);
311-
}
312-
311+
}
312+
313313
return 1;
314314
}
315315

@@ -324,18 +324,18 @@ int SpiDrv::waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len)
324324

325325
uint8_t numParam = readChar();
326326
if (numParam != 0)
327-
{
327+
{
328328
readParamLen8(param_len);
329329
for (ii=0; ii<(*param_len); ++ii)
330330
{
331331
// Get Params data
332332
param[ii] = spiTransfer(DUMMY_DATA);
333-
}
334-
}
333+
}
334+
}
335335

336336
readAndCheckChar(END_CMD, &_data);
337-
}
338-
337+
}
338+
339339
return 1;
340340
}
341341

@@ -351,15 +351,15 @@ int SpiDrv::waitResponseParams(uint8_t cmd, uint8_t numParam, tParam* params)
351351

352352
uint8_t _numParam = readChar();
353353
if (_numParam != 0)
354-
{
354+
{
355355
for (i=0; i<_numParam; ++i)
356356
{
357357
params[i].paramLen = readParamLen8();
358358
for (ii=0; ii<params[i].paramLen; ++ii)
359359
{
360360
// Get Params data
361361
params[i].param[ii] = spiTransfer(DUMMY_DATA);
362-
}
362+
}
363363
}
364364
} else
365365
{
@@ -374,7 +374,7 @@ int SpiDrv::waitResponseParams(uint8_t cmd, uint8_t numParam, tParam* params)
374374
}
375375

376376
readAndCheckChar(END_CMD, &_data);
377-
}
377+
}
378378
return 1;
379379
}
380380

@@ -405,7 +405,7 @@ int SpiDrv::waitResponse(uint8_t cmd, tParam* params, uint8_t* numParamRead, uin
405405
{
406406
// Get Params data
407407
params[i].param[ii] = spiTransfer(DUMMY_DATA);
408-
}
408+
}
409409
}
410410
} else
411411
{
@@ -414,7 +414,7 @@ int SpiDrv::waitResponse(uint8_t cmd, tParam* params, uint8_t* numParamRead, uin
414414
return 0;
415415
}
416416
readAndCheckChar(END_CMD, &_data);
417-
}
417+
}
418418
return 1;
419419
}
420420
*/

src/utility/spi_drv.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,35 @@ class SpiDrv
5050
static void begin();
5151

5252
static void end();
53-
53+
5454
static void spiDriverInit();
55-
55+
5656
static void spiSlaveSelect();
57-
57+
5858
static void spiSlaveDeselect();
59-
59+
6060
static char spiTransfer(volatile char data);
6161

6262
static void waitForSlaveReady(bool const feed_watchdog = false);
6363

6464
//static int waitSpiChar(char waitChar, char* readChar);
6565

6666
static int waitSpiChar(unsigned char waitChar);
67-
67+
6868
static int readAndCheckChar(char checkChar, char* readChar);
6969

7070
static char readChar();
7171

7272
static int waitResponseParams(uint8_t cmd, uint8_t numParam, tParam* params);
73-
73+
7474
static int waitResponseCmd(uint8_t cmd, uint8_t numParam, uint8_t* param, uint8_t* param_len);
7575

7676
static int waitResponseData8(uint8_t cmd, uint8_t* param, uint8_t* param_len);
77-
77+
7878
static int waitResponseData16(uint8_t cmd, uint8_t* param, uint16_t* param_len);
79-
/*
79+
/*
8080
static int waitResponse(uint8_t cmd, tParam* params, uint8_t* numParamRead, uint8_t maxNumParams);
81-
81+
8282
static int waitResponse(uint8_t cmd, uint8_t numParam, uint8_t* param, uint16_t* param_len);
8383
*/
8484
static int waitResponse(uint8_t cmd, uint8_t* numParamRead, uint8_t** params, uint8_t maxNumParams);
@@ -98,11 +98,11 @@ class SpiDrv
9898
static void sendBuffer(uint8_t* param, uint16_t param_len, uint8_t lastParam = NO_LAST_PARAM);
9999

100100
static void sendParam(uint16_t param, uint8_t lastParam = NO_LAST_PARAM);
101-
101+
102102
static void sendCmd(uint8_t cmd, uint8_t numParam);
103103

104104
static int available();
105-
};
105+
};
106106

107107
extern SpiDrv spiDrv;
108108

src/utility/wifi_drv.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ int8_t WiFiDrv::wifiSetKey(const char* ssid, uint8_t ssid_len, uint8_t key_idx,
189189
SpiDrv::sendParam((uint8_t*)ssid, ssid_len, NO_LAST_PARAM);
190190
SpiDrv::sendParam(&key_idx, KEY_IDX_LEN, NO_LAST_PARAM);
191191
SpiDrv::sendParam((uint8_t*)key, len, LAST_PARAM);
192-
192+
193193
// pad to multiple of 4
194194
int commandSize = 8 + ssid_len + len;
195195
while (commandSize % 4) {
@@ -299,7 +299,7 @@ void WiFiDrv::setHostname(const char* hostname)
299299
}
300300
SpiDrv::spiSlaveDeselect();
301301
}
302-
302+
303303
int8_t WiFiDrv::disconnect()
304304
{
305305
WAIT_FOR_SLAVE_SELECT();
@@ -381,7 +381,7 @@ uint8_t* WiFiDrv::getMacAddress()
381381

382382
uint8_t _dummy = DUMMY_DATA;
383383
SpiDrv::sendParam(&_dummy, 1, LAST_PARAM);
384-
384+
385385
// pad to multiple of 4
386386
SpiDrv::readChar();
387387
SpiDrv::readChar();
@@ -649,7 +649,7 @@ uint8_t* WiFiDrv::getBSSIDNetowrks(uint8_t networkItem, uint8_t* bssid)
649649

650650
SpiDrv::spiSlaveDeselect();
651651

652-
return bssid;
652+
return bssid;
653653
}
654654

655655
uint8_t WiFiDrv::getChannelNetowrks(uint8_t networkItem)
@@ -680,7 +680,7 @@ uint8_t WiFiDrv::getChannelNetowrks(uint8_t networkItem)
680680

681681
SpiDrv::spiSlaveDeselect();
682682

683-
return channel;
683+
return channel;
684684
}
685685

686686
int32_t WiFiDrv::getRSSINetoworks(uint8_t networkItem)
@@ -982,7 +982,7 @@ int16_t WiFiDrv::ping(uint32_t ipAddress, uint8_t ttl)
982982
_data = WL_PING_ERROR;
983983
}
984984
SpiDrv::spiSlaveDeselect();
985-
return _data;
985+
return _data;
986986
}
987987

988988
void WiFiDrv::debug(uint8_t on)
@@ -1008,7 +1008,7 @@ void WiFiDrv::debug(uint8_t on)
10081008
uint8_t data = 0;
10091009
SpiDrv::waitResponseCmd(SET_DEBUG_CMD, PARAM_NUMS_1, &data, &dataLen);
10101010

1011-
SpiDrv::spiSlaveDeselect();
1011+
SpiDrv::spiSlaveDeselect();
10121012
}
10131013

10141014
float WiFiDrv::getTemperature()

src/utility/wifi_spi.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define CMD_POS 1 // Position of Command OpCode on SPI stream
4343
#define PARAM_LEN_POS 2 // Position of Param len on SPI stream
4444

45-
45+
4646
enum {
4747
SET_NET_CMD = 0x10,
4848
SET_PASSPHRASE_CMD = 0x11,
@@ -118,17 +118,17 @@ enum {
118118

119119

120120
enum wl_tcp_state {
121-
CLOSED = 0,
122-
LISTEN = 1,
123-
SYN_SENT = 2,
124-
SYN_RCVD = 3,
125-
ESTABLISHED = 4,
126-
FIN_WAIT_1 = 5,
127-
FIN_WAIT_2 = 6,
128-
CLOSE_WAIT = 7,
129-
CLOSING = 8,
130-
LAST_ACK = 9,
131-
TIME_WAIT = 10
121+
CLOSED = 0,
122+
LISTEN = 1,
123+
SYN_SENT = 2,
124+
SYN_RCVD = 3,
125+
ESTABLISHED = 4,
126+
FIN_WAIT_1 = 5,
127+
FIN_WAIT_2 = 6,
128+
CLOSE_WAIT = 7,
129+
CLOSING = 8,
130+
LAST_ACK = 9,
131+
TIME_WAIT = 10
132132
};
133133

134134

@@ -199,7 +199,7 @@ typedef struct __attribute__((__packed__))
199199
typedef struct __attribute__((__packed__))
200200
{
201201
uint8_t paramLen;
202-
uint8_t param;
202+
uint8_t param;
203203
}tByteParam;
204204

205205
#endif

0 commit comments

Comments
 (0)