Skip to content

Commit 3d8c19b

Browse files
authored
Merge pull request #522 from tock/uncrustify-config-2025-06
Uncrustify: Update and include new config options
2 parents 6495f40 + f221ae8 commit 3d8c19b

File tree

116 files changed

+568
-606
lines changed

Some content is hidden

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

116 files changed

+568
-606
lines changed

examples/ble-uart/ble_nus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include "ble_nus.h"
14+
1415
#include "ble_srv_common.h"
1516
#include "sdk_common.h"
1617

@@ -21,7 +22,7 @@
2122
#define BLE_NUS_MAX_TX_CHAR_LEN BLE_NUS_MAX_DATA_LEN /**< Maximum length of the TX Characteristic (in bytes). */
2223

2324
#define NUS_BASE_UUID {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, \
24-
0x00, 0x40, 0x6E}} /**< Used vendor specific UUID. */
25+
0x00, 0x40, 0x6E}} /**< Used vendor specific UUID. */
2526

2627
/**@brief Function for handling the @ref BLE_GAP_EVT_CONNECTED event from the S110 SoftDevice.
2728
*

examples/ble-uart/main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
#include <unistd.h>
66

77
#include <ble_advdata.h>
8+
#include <eddystone.h>
89
#include <nordic_common.h>
910
#include <nrf_error.h>
10-
11-
#include <eddystone.h>
1211
#include <simple_adv.h>
1312
#include <simple_ble.h>
1413

15-
#include <libtock/net/nrf51_serialization.h>
16-
1714
#include <libtock-sync/interface/console.h>
1815
#include <libtock/interface/console.h>
16+
#include <libtock/net/nrf51_serialization.h>
1917
#include <libtock/tock.h>
2018

2119
#include "ble_nus.h"

examples/ip_sense/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#include <stdbool.h>
22
#include <stdio.h>
33

4+
#include <libtock-sync/net/ieee802154.h>
5+
#include <libtock-sync/net/udp.h>
46
#include <libtock-sync/sensors/ambient_light.h>
57
#include <libtock-sync/sensors/humidity.h>
68
#include <libtock-sync/sensors/temperature.h>
79
#include <libtock-sync/services/alarm.h>
810

9-
#include <libtock-sync/net/ieee802154.h>
10-
#include <libtock-sync/net/udp.h>
11-
1211
static unsigned char BUF_BIND_CFG[2 * sizeof(sock_addr_t)];
1312

1413
void print_ipv6(ipv6_addr_t*);

examples/lua-hello/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#include <stdbool.h>
33
#include <stdlib.h>
44

5-
#include <libtock-sync/services/alarm.h>
6-
75
#include <lua/lauxlib.h>
86
#include <lua/lua.h>
97
#include <lua/lualib.h>
108

9+
#include <libtock-sync/services/alarm.h>
10+
1111
// POSIX wrapper for `nanosleep` to make this compilable and runnable on
1212
// Linux/OS X/BSD for testing.
1313
#if defined(__unix__)
@@ -18,6 +18,7 @@ void libtocksync_alarm_delay_ms(int ms) {
1818
ts.tv_nsec = (long)ms * 1000 * 1000;
1919
nanosleep(&ts, NULL);
2020
}
21+
2122
#endif
2223

2324
int main(void) {

examples/lvgl/lvgl_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
#include <lvgl/lvgl.h>
2+
13
#include <libtock-sync/display/screen.h>
24
#include <libtock/sensors/touch.h>
35
#include <libtock/services/alarm.h>
46
#include <libtock/tock.h>
5-
#include <lvgl/lvgl.h>
67

78
#include "lvgl_driver.h"
89

examples/lvgl/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include <stdio.h>
22

3+
#include <lvgl/lvgl.h>
4+
35
#include <libtock-sync/display/screen.h>
46
#include <libtock-sync/services/alarm.h>
57

6-
#include <lvgl/lvgl.h>
7-
88
#include "lvgl_driver.h"
99

1010
static uint32_t seconds = 0;
@@ -59,7 +59,6 @@ int main(void) {
5959
uint32_t time_till_next = lv_timer_handler();
6060
libtocksync_alarm_delay_ms(time_till_next);
6161
}
62-
6362
} else {
6463
printf("lvgl init error: %s\n", tock_strrcode(status));
6564
}

examples/lwip_ethernet_tap/main.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* vim: set sw=2 expandtab tw=80: */
22

3-
#include <libtock/services/alarm.h>
4-
#include <libtock/tock.h>
5-
#include <libtock/util/streaming_process_slice.h>
3+
#include <stdio.h>
4+
#include <string.h>
5+
66
#include <lwip/apps/httpd.h>
77
#include <lwip/dhcp.h>
88
#include <lwip/err.h>
@@ -11,8 +11,10 @@
1111
#include <lwip/prot/ethernet.h>
1212
#include <lwip/sys.h>
1313
#include <lwip/timeouts.h>
14-
#include <stdio.h>
15-
#include <string.h>
14+
15+
#include <libtock/services/alarm.h>
16+
#include <libtock/tock.h>
17+
#include <libtock/util/streaming_process_slice.h>
1618

1719
// ########## Settings
1820

@@ -38,11 +40,11 @@
3840

3941
const uint32_t tap_driver_num = 0x30007;
4042

41-
#define debug_print(...) \
42-
do { \
43-
if (DEBUG) \
44-
printf(__VA_ARGS__); \
45-
} while (0)
43+
#define debug_print(...) \
44+
do { \
45+
if (DEBUG) \
46+
printf(__VA_ARGS__); \
47+
} while (0)
4648

4749
// Transmission metadata feedback buffer len:
4850
#if TX_FRAME_INFO_ENABLE
@@ -61,9 +63,9 @@ static uint8_t tx_frame_buffer[ETHERNET_MTU];
6163
// to hold a streaming process slice header, and `RX_FRAME_BUFFER_FRAMES / 2`
6264
// Ethernet frames (encoded as TAP_DRIVER_FRAME_HEADER_LEN + payload, assumed to
6365
// be ETHERNET_MTU bytes).
64-
#define RX_FRAME_BUFFER_LEN \
65-
STREAMING_PROCESS_SLICE_HEADER_LEN \
66-
+ ((ETHERNET_MTU + TAP_DRIVER_FRAME_HEADER_LEN) * (RX_FRAME_BUFFER_FRAMES / 2))
66+
#define RX_FRAME_BUFFER_LEN \
67+
STREAMING_PROCESS_SLICE_HEADER_LEN \
68+
+ ((ETHERNET_MTU + TAP_DRIVER_FRAME_HEADER_LEN) * (RX_FRAME_BUFFER_FRAMES / 2))
6769
static uint8_t rx_frames_streaming_buffer_a[RX_FRAME_BUFFER_LEN];
6870
static uint8_t rx_frames_streaming_buffer_b[RX_FRAME_BUFFER_LEN];
6971

examples/music/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ int melody[] = {
2828
NOTE_G6, 4, NOTE_F6, 4, NOTE_E6, 4, NOTE_D6, 4,
2929
NOTE_C6, 4, NOTE_C6, 4, NOTE_D6, 4, NOTE_E6, 4,
3030
NOTE_D6, -4, NOTE_C6, 8, NOTE_C6, 2
31-
3231
};
3332

3433
#define TEMPO 114

examples/openthread/openthread_hello/main.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <assert.h>
2+
#include <stdio.h>
3+
#include <string.h>
24

35
#include <libopenthread/platform/openthread-system.h>
46
#include <libopenthread/platform/plat.h>
@@ -11,9 +13,6 @@
1113

1214
#include <libtock/tock.h>
1315

14-
#include <stdio.h>
15-
#include <string.h>
16-
1716
// helper utility demonstrating network config setup
1817
static void setNetworkConfiguration(otInstance* aInstance);
1918

@@ -60,7 +59,6 @@ int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[])
6059
if (!otTaskletsArePending(instance) && !openthread_platform_pending_work()) {
6160
yield();
6261
}
63-
6462
}
6563

6664
return 0;
@@ -87,7 +85,6 @@ void setNetworkConfiguration(otInstance* aInstance) {
8785

8886
otError error = otDatasetSetActive(aInstance, &aDataset);
8987
assert(error == 0);
90-
9188
}
9289

9390
static void stateChangeCallback(uint32_t flags, void* context) {
@@ -127,5 +124,4 @@ static void print_ip_addr(otInstance* instance) {
127124
otIp6AddressToString(&ip6_addr, addr_string, sizeof(addr_string));
128125
printf("%s\n", addr_string);
129126
}
130-
131127
}

examples/openthread/openthread_udp_rx/main.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include <assert.h>
2+
#include <stdio.h>
3+
#include <string.h>
24

35
#include <libopenthread/platform/openthread-system.h>
46
#include <libopenthread/platform/plat.h>
@@ -13,9 +15,6 @@
1315

1416
#include <libtock/tock.h>
1517

16-
#include <stdio.h>
17-
#include <string.h>
18-
1918
#define UDP_PORT 1212
2019

2120
static otUdpSocket sUdpSocket;
@@ -74,7 +73,6 @@ int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[])
7473
if (!otTaskletsArePending(instance) && !openthread_platform_pending_work()) {
7574
yield();
7675
}
77-
7876
}
7977

8078
return 0;
@@ -101,7 +99,6 @@ void setNetworkConfiguration(otInstance* aInstance) {
10199

102100
otError error = otDatasetSetActive(aInstance, &aDataset);
103101
assert(error == 0);
104-
105102
}
106103

107104
void initUdp(otInstance* aInstance) {
@@ -137,7 +134,6 @@ void handleUdpReceive(void* aContext, otMessage* aMessage,
137134
}
138135

139136
printf("\n");
140-
141137
}
142138

143139
static void stateChangeCallback(uint32_t flags, void* context) {
@@ -177,5 +173,4 @@ static void print_ip_addr(otInstance* instance) {
177173
otIp6AddressToString(&ip6_addr, addr_string, sizeof(addr_string));
178174
printf("%s\n", addr_string);
179175
}
180-
181176
}

0 commit comments

Comments
 (0)