Skip to content

Commit 9d95d46

Browse files
author
Cruz Monrreal
authored
Merge pull request #8591 from 0xc0170/fix_coding_style_features
features: fix coding style
2 parents 44ee9a7 + 20646d3 commit 9d95d46

File tree

124 files changed

+1511
-1402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+1511
-1402
lines changed

.astyleignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ cmsis
33
features/cryptocell
44
features/mbedtls
55
features/lwipstack/lwip
6+
features/lwipstack/lwip-sys
67
rtos/TARGET_CORTEX/rtx4
78
features/storage/filesystem/littlefs/littlefs/
89
features/storage/filesystem/fat/ChaN
910
features/storage/FEATURE_STORAGE
1011
features/frameworks
11-
features/FEATURE_BLE/targets
12+
features/FEATURE_BLE
1213
features/unsupported/
14+
features/netsocket/emac-drivers
1315
hal/storage_abstraction
14-
FEATURE_NANOSTACK/coap-service
15-
FEATURE_NANOSTACK/sal-stack-nanostack
16+
TESTS/mbed_hal/trng/pithy
17+
features/nanostack/coap-service
18+
features/nanostack/sal-stack-nanostack
1619
rtos/TARGET_CORTEX/rtx5
1720
TESTS/mbed_hal/trng/pithy
1821
targets
22+
components/802.15.4_RF
23+
components/wifi
1924
tools

TESTS/mbed_hal/minimum_requirements/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void minimum_data_test()
5353
}
5454

5555

56-
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
56+
utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
5757
{
5858
GREENTEA_SETUP(30, "default_auto");
5959
return greentea_test_setup_handler(number_of_cases);
@@ -66,6 +66,7 @@ Case cases[] = {
6666

6767
Specification specification(greentea_test_setup, cases, greentea_test_teardown_handler);
6868

69-
int main() {
69+
int main()
70+
{
7071
Harness::run(specification);
7172
}

TESTS/network/wifi/wifi_connect.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void wifi_connect(void)
3131
{
3232
WiFiInterface *wifi = get_interface();
3333

34-
char ssid[SSID_MAX_LEN+1] = MBED_CONF_APP_WIFI_UNSECURE_SSID;
34+
char ssid[SSID_MAX_LEN + 1] = MBED_CONF_APP_WIFI_UNSECURE_SSID;
3535

3636
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->set_credentials(ssid, NULL));
3737
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());
@@ -42,7 +42,7 @@ void wifi_connect(void)
4242
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->disconnect());
4343

4444
// Driver is expected to cache the credentials
45-
memset(ssid, 0, SSID_MAX_LEN+1);
45+
memset(ssid, 0, SSID_MAX_LEN + 1);
4646

4747
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->connect());
4848
TEST_ASSERT_EQUAL_INT(NSAPI_ERROR_OK, wifi->disconnect());

UNITTESTS/features/lorawan/loraphy/Test_LoRaPHY.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class my_LoRaPHY : public LoRaPHY {
2727
phy_params.adr_ack_delay = 1;
2828
}
2929

30-
virtual ~my_LoRaPHY()
30+
virtual ~my_LoRaPHY()
3131
{
3232
}
3333

@@ -40,19 +40,19 @@ class my_LoRaPHY : public LoRaPHY {
4040
class my_radio : public LoRaRadio {
4141
public:
4242

43-
virtual void init_radio(radio_events_t *events)
43+
virtual void init_radio(radio_events_t *events)
4444
{
4545
};
4646

47-
virtual void radio_reset()
47+
virtual void radio_reset()
4848
{
4949
};
5050

51-
virtual void sleep(void)
51+
virtual void sleep(void)
5252
{
5353
};
5454

55-
virtual void standby(void)
55+
virtual void standby(void)
5656
{
5757
};
5858

@@ -62,31 +62,31 @@ class my_radio : public LoRaRadio {
6262
uint16_t symb_timeout, bool fix_len,
6363
uint8_t payload_len,
6464
bool crc_on, bool freq_hop_on, uint8_t hop_period,
65-
bool iq_inverted, bool rx_continuous)
65+
bool iq_inverted, bool rx_continuous)
6666
{
6767
};
6868

6969
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
7070
uint32_t bandwidth, uint32_t datarate,
7171
uint8_t coderate, uint16_t preamble_len,
7272
bool fix_len, bool crc_on, bool freq_hop_on,
73-
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
73+
uint8_t hop_period, bool iq_inverted, uint32_t timeout)
7474
{
7575
};
7676

77-
virtual void send(uint8_t *buffer, uint8_t size)
77+
virtual void send(uint8_t *buffer, uint8_t size)
7878
{
7979
};
8080

81-
virtual void receive(void)
81+
virtual void receive(void)
8282
{
8383
};
8484

85-
virtual void set_channel(uint32_t freq)
85+
virtual void set_channel(uint32_t freq)
8686
{
8787
};
8888

89-
virtual uint32_t random(void)
89+
virtual uint32_t random(void)
9090
{
9191
};
9292

@@ -95,15 +95,15 @@ class my_radio : public LoRaRadio {
9595
return uint8_value;
9696
};
9797

98-
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
98+
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)
9999
{
100100
};
101101

102-
virtual void set_public_network(bool enable)
102+
virtual void set_public_network(bool enable)
103103
{
104104
};
105105

106-
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
106+
virtual uint32_t time_on_air(radio_modems_t modem, uint8_t pkt_len)
107107
{
108108
};
109109

@@ -115,7 +115,7 @@ class my_radio : public LoRaRadio {
115115
return bool_value;
116116
};
117117

118-
virtual void start_cad(void)
118+
virtual void start_cad(void)
119119
{
120120
};
121121

@@ -124,15 +124,15 @@ class my_radio : public LoRaRadio {
124124
return bool_value;
125125
};
126126

127-
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
127+
virtual void set_tx_continuous_wave(uint32_t freq, int8_t power, uint16_t time)
128128
{
129129
};
130130

131-
virtual void lock(void)
131+
virtual void lock(void)
132132
{
133133
};
134134

135-
virtual void unlock(void)
135+
virtual void unlock(void)
136136
{
137137
};
138138

@@ -422,10 +422,10 @@ TEST_F(Test_LoRaPHY, compute_rx_win_params)
422422
list[0] = 125000;
423423
object->get_phy_params().bandwidths.table = list;
424424
uint8_t list2[1];
425-
list2[0]= 12;
425+
list2[0] = 12;
426426
object->get_phy_params().datarates.table = &list2;
427427
channel_params_t ch_lst[16];
428-
memset(ch_lst, 0, sizeof(channel_params_t)*16);
428+
memset(ch_lst, 0, sizeof(channel_params_t) * 16);
429429
ch_lst[0].band = 0;
430430
ch_lst[0].dr_range.fields.min = DR_0;
431431
ch_lst[0].dr_range.fields.max = DR_5;
@@ -513,7 +513,7 @@ TEST_F(Test_LoRaPHY, link_ADR_request)
513513

514514
object->get_phy_params().max_channel_cnt = 16;
515515
channel_params_t li[16];
516-
memset(li, 0, sizeof(channel_params_t)*16);
516+
memset(li, 0, sizeof(channel_params_t) * 16);
517517
object->get_phy_params().channels.channel_list = li;
518518
li[0].frequency = 0;
519519
li[1].frequency = 5;
@@ -673,7 +673,7 @@ TEST_F(Test_LoRaPHY, set_next_channel)
673673
ch = 5;
674674
t1 = 16;
675675
t2 = 32;
676-
memset(b, 0, sizeof(band_t)*4);
676+
memset(b, 0, sizeof(band_t) * 4);
677677
object->get_phy_params().bands.size = 2;
678678
object->get_phy_params().bands.table = &b;
679679
b[0].off_time = 0;
@@ -767,7 +767,7 @@ TEST_F(Test_LoRaPHY, set_tx_cont_mode)
767767

768768
cw_mode_params_t p;
769769
p.max_eirp = 0;
770-
p.channel=0;
770+
p.channel = 0;
771771
p.tx_power = -1;
772772
p.datarate = 0;
773773
p.antenna_gain = 1;

UNITTESTS/features/lorawan/lorawaninterface/Test_LoRaWANInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ class my_radio : public LoRaRadio {
4444
uint8_t payload_len,
4545
bool crc_on, bool freq_hop_on, uint8_t hop_period,
4646
bool iq_inverted, bool rx_continuous)
47-
{
47+
{
4848

49-
};
49+
};
5050

5151
virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev,
5252
uint32_t bandwidth, uint32_t datarate,

events/equeue/equeue_mbed.cpp

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ using namespace mbed;
3535
// Ticker operations
3636
#if MBED_CONF_RTOS_PRESENT
3737

38-
unsigned equeue_tick() {
38+
unsigned equeue_tick()
39+
{
3940
return osKernelGetTickCount();
4041
}
4142

@@ -55,20 +56,22 @@ unsigned equeue_tick() {
5556
static bool equeue_tick_inited = false;
5657
static volatile unsigned equeue_minutes = 0;
5758
static unsigned equeue_timer[
58-
(sizeof(ALIAS_TIMER)+sizeof(unsigned)-1)/sizeof(unsigned)];
59+
(sizeof(ALIAS_TIMER) + sizeof(unsigned) - 1) / sizeof(unsigned)];
5960
static unsigned equeue_ticker[
60-
(sizeof(ALIAS_TICKER)+sizeof(unsigned)-1)/sizeof(unsigned)];
61+
(sizeof(ALIAS_TICKER) + sizeof(unsigned) - 1) / sizeof(unsigned)];
6162

62-
static void equeue_tick_update() {
63-
equeue_minutes += reinterpret_cast<ALIAS_TIMER*>(equeue_timer)->read_ms();
64-
reinterpret_cast<ALIAS_TIMER*>(equeue_timer)->reset();
63+
static void equeue_tick_update()
64+
{
65+
equeue_minutes += reinterpret_cast<ALIAS_TIMER *>(equeue_timer)->read_ms();
66+
reinterpret_cast<ALIAS_TIMER *>(equeue_timer)->reset();
6567
}
6668

67-
static void equeue_tick_init() {
69+
static void equeue_tick_init()
70+
{
6871
MBED_STATIC_ASSERT(sizeof(equeue_timer) >= sizeof(ALIAS_TIMER),
69-
"The equeue_timer buffer must fit the class Timer");
72+
"The equeue_timer buffer must fit the class Timer");
7073
MBED_STATIC_ASSERT(sizeof(equeue_ticker) >= sizeof(ALIAS_TICKER),
71-
"The equeue_ticker buffer must fit the class Ticker");
74+
"The equeue_ticker buffer must fit the class Ticker");
7275
ALIAS_TIMER *timer = new (equeue_timer) ALIAS_TIMER;
7376
ALIAS_TICKER *ticker = new (equeue_ticker) ALIAS_TICKER;
7477

@@ -79,7 +82,8 @@ static void equeue_tick_init() {
7982
equeue_tick_inited = true;
8083
}
8184

82-
unsigned equeue_tick() {
85+
unsigned equeue_tick()
86+
{
8387
if (!equeue_tick_inited) {
8488
equeue_tick_init();
8589
}
@@ -89,7 +93,7 @@ unsigned equeue_tick() {
8993

9094
do {
9195
minutes = equeue_minutes;
92-
ms = reinterpret_cast<ALIAS_TIMER*>(equeue_timer)->read_ms();
96+
ms = reinterpret_cast<ALIAS_TIMER *>(equeue_timer)->read_ms();
9397
} while (minutes != equeue_minutes);
9498

9599
return minutes + ms;
@@ -98,22 +102,28 @@ unsigned equeue_tick() {
98102
#endif
99103

100104
// Mutex operations
101-
int equeue_mutex_create(equeue_mutex_t *m) { return 0; }
105+
int equeue_mutex_create(equeue_mutex_t *m)
106+
{
107+
return 0;
108+
}
102109
void equeue_mutex_destroy(equeue_mutex_t *m) { }
103110

104-
void equeue_mutex_lock(equeue_mutex_t *m) {
111+
void equeue_mutex_lock(equeue_mutex_t *m)
112+
{
105113
core_util_critical_section_enter();
106114
}
107115

108-
void equeue_mutex_unlock(equeue_mutex_t *m) {
116+
void equeue_mutex_unlock(equeue_mutex_t *m)
117+
{
109118
core_util_critical_section_exit();
110119
}
111120

112121

113122
// Semaphore operations
114123
#ifdef MBED_CONF_RTOS_PRESENT
115124

116-
int equeue_sema_create(equeue_sema_t *s) {
125+
int equeue_sema_create(equeue_sema_t *s)
126+
{
117127
osEventFlagsAttr_t attr;
118128
memset(&attr, 0, sizeof(attr));
119129
attr.cb_mem = &s->mem;
@@ -123,15 +133,18 @@ int equeue_sema_create(equeue_sema_t *s) {
123133
return !s->id ? -1 : 0;
124134
}
125135

126-
void equeue_sema_destroy(equeue_sema_t *s) {
136+
void equeue_sema_destroy(equeue_sema_t *s)
137+
{
127138
osEventFlagsDelete(s->id);
128139
}
129140

130-
void equeue_sema_signal(equeue_sema_t *s) {
141+
void equeue_sema_signal(equeue_sema_t *s)
142+
{
131143
osEventFlagsSet(s->id, 1);
132144
}
133145

134-
bool equeue_sema_wait(equeue_sema_t *s, int ms) {
146+
bool equeue_sema_wait(equeue_sema_t *s, int ms)
147+
{
135148
if (ms < 0) {
136149
ms = osWaitForever;
137150
}
@@ -142,29 +155,34 @@ bool equeue_sema_wait(equeue_sema_t *s, int ms) {
142155
#else
143156

144157
// Semaphore operations
145-
int equeue_sema_create(equeue_sema_t *s) {
158+
int equeue_sema_create(equeue_sema_t *s)
159+
{
146160
*s = false;
147161
return 0;
148162
}
149163

150-
void equeue_sema_destroy(equeue_sema_t *s) {
164+
void equeue_sema_destroy(equeue_sema_t *s)
165+
{
151166
}
152167

153-
void equeue_sema_signal(equeue_sema_t *s) {
168+
void equeue_sema_signal(equeue_sema_t *s)
169+
{
154170
*s = 1;
155171
}
156172

157-
static void equeue_sema_timeout(equeue_sema_t *s) {
173+
static void equeue_sema_timeout(equeue_sema_t *s)
174+
{
158175
*s = -1;
159176
}
160177

161-
bool equeue_sema_wait(equeue_sema_t *s, int ms) {
178+
bool equeue_sema_wait(equeue_sema_t *s, int ms)
179+
{
162180
int signal = 0;
163181
ALIAS_TIMEOUT timeout;
164182
if (ms == 0) {
165183
return false;
166184
} else if (ms > 0) {
167-
timeout.attach_us(callback(equeue_sema_timeout, s), (us_timestamp_t)ms*1000);
185+
timeout.attach_us(callback(equeue_sema_timeout, s), (us_timestamp_t)ms * 1000);
168186
}
169187

170188
core_util_critical_section_enter();

features/cellular/TESTS/api/cellular_information/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ static void test_information_interface()
8484
TEST_ASSERT(info->get_model(buf, kbuf_size) == NSAPI_ERROR_OK);
8585
TEST_ASSERT(info->get_revision(buf, kbuf_size) == NSAPI_ERROR_OK);
8686
TEST_ASSERT((info->get_serial_number(buf, kbuf_size, CellularInformation::SN) == NSAPI_ERROR_OK) ||
87-
((((AT_CellularInformation *)info)->get_device_error().errType == 3) && // 3 == CME error from the modem
88-
(((AT_CellularInformation *)info)->get_device_error().errCode == 4))); // 4 == "operation not supported"
87+
((((AT_CellularInformation *)info)->get_device_error().errType == 3) && // 3 == CME error from the modem
88+
(((AT_CellularInformation *)info)->get_device_error().errCode == 4))); // 4 == "operation not supported"
8989

9090
nsapi_error_t err = info->get_serial_number(buf, kbuf_size, CellularInformation::IMEI);
9191
TEST_ASSERT(err == NSAPI_ERROR_UNSUPPORTED || err == NSAPI_ERROR_OK);

0 commit comments

Comments
 (0)