Skip to content

Commit cffb347

Browse files
authored
Merge pull request #1007 from 3devo/astyle-indent-preproc-block
Astyle indent preproc block
2 parents 3102bae + 4ab0fc3 commit cffb347

File tree

394 files changed

+5399
-5398
lines changed

Some content is hidden

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

394 files changed

+5399
-5398
lines changed

Diff for: CI/astyle/.astylerc

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ indent-classes
2020
indent-switches
2121
indent-cases
2222
indent-col1-comments
23+
indent-preproc-block
2324

2425
# Remove spaces in and around parentheses
2526
unpad-paren

Diff for: cores/arduino/Arduino.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
+ __GNUC_PATCHLEVEL__)
2727
#endif
2828
#if GCC_VERSION < 60300
29-
#error "GCC version 6.3 or higher is required"
29+
#error "GCC version 6.3 or higher is required"
3030
#endif
3131

3232
#ifdef __IN_ECLIPSE__
33-
#include "SrcWrapper.h"
33+
#include "SrcWrapper.h"
3434
#endif
3535

3636
#include "wiring.h"

Diff for: cores/arduino/HardwareSerial.cpp

+75-75
Original file line numberDiff line numberDiff line change
@@ -28,81 +28,81 @@
2828

2929
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
3030
#if defined(HAVE_HWSERIAL1) || defined(HAVE_HWSERIAL2) || defined(HAVE_HWSERIAL3) ||\
31-
defined(HAVE_HWSERIAL4) || defined(HAVE_HWSERIAL5) || defined(HAVE_HWSERIAL6) ||\
32-
defined(HAVE_HWSERIAL7) || defined(HAVE_HWSERIAL8) || defined(HAVE_HWSERIAL9) ||\
33-
defined(HAVE_HWSERIAL10) || defined(HAVE_HWSERIALLP1)
34-
// SerialEvent functions are weak, so when the user doesn't define them,
35-
// the linker just sets their address to 0 (which is checked below).
36-
#if defined(HAVE_HWSERIAL1)
37-
HardwareSerial Serial1(USART1);
38-
void serialEvent1() __attribute__((weak));
39-
#endif
40-
41-
#if defined(HAVE_HWSERIAL2)
42-
HardwareSerial Serial2(USART2);
43-
void serialEvent2() __attribute__((weak));
44-
#endif
45-
46-
#if defined(HAVE_HWSERIAL3)
47-
HardwareSerial Serial3(USART3);
48-
void serialEvent3() __attribute__((weak));
49-
#endif
50-
51-
#if defined(HAVE_HWSERIAL4)
52-
#if defined(USART4)
53-
HardwareSerial Serial4(USART4);
54-
#else
55-
HardwareSerial Serial4(UART4);
56-
#endif
57-
void serialEvent4() __attribute__((weak));
58-
#endif
59-
60-
#if defined(HAVE_HWSERIAL5)
61-
#if defined(USART5)
62-
HardwareSerial Serial5(USART5);
63-
#else
64-
HardwareSerial Serial5(UART5);
65-
#endif
66-
void serialEvent5() __attribute__((weak));
67-
#endif
68-
69-
#if defined(HAVE_HWSERIAL6)
70-
HardwareSerial Serial6(USART6);
71-
void serialEvent6() __attribute__((weak));
72-
#endif
73-
74-
#if defined(HAVE_HWSERIAL7)
75-
#if defined(USART7)
76-
HardwareSerial Serial7(USART7);
77-
#else
78-
HardwareSerial Serial7(UART7);
79-
#endif
80-
void serialEvent7() __attribute__((weak));
81-
#endif
82-
83-
#if defined(HAVE_HWSERIAL8)
84-
#if defined(USART8)
85-
HardwareSerial Serial8(USART8);
86-
#else
87-
HardwareSerial Serial8(UART8);
88-
#endif
89-
void serialEvent8() __attribute__((weak));
90-
#endif
91-
92-
#if defined(HAVE_HWSERIAL9)
93-
HardwareSerial Serial9(UART9);
94-
void serialEvent9() __attribute__((weak));
95-
#endif
96-
97-
#if defined(HAVE_HWSERIAL10)
98-
HardwareSerial Serial10(UART10);
99-
void serialEvent10() __attribute__((weak));
100-
#endif
101-
102-
#if defined(HAVE_HWSERIALLP1)
103-
HardwareSerial SerialLP1(LPUART1);
104-
void serialEventLP1() __attribute__((weak));
105-
#endif
31+
defined(HAVE_HWSERIAL4) || defined(HAVE_HWSERIAL5) || defined(HAVE_HWSERIAL6) ||\
32+
defined(HAVE_HWSERIAL7) || defined(HAVE_HWSERIAL8) || defined(HAVE_HWSERIAL9) ||\
33+
defined(HAVE_HWSERIAL10) || defined(HAVE_HWSERIALLP1)
34+
// SerialEvent functions are weak, so when the user doesn't define them,
35+
// the linker just sets their address to 0 (which is checked below).
36+
#if defined(HAVE_HWSERIAL1)
37+
HardwareSerial Serial1(USART1);
38+
void serialEvent1() __attribute__((weak));
39+
#endif
40+
41+
#if defined(HAVE_HWSERIAL2)
42+
HardwareSerial Serial2(USART2);
43+
void serialEvent2() __attribute__((weak));
44+
#endif
45+
46+
#if defined(HAVE_HWSERIAL3)
47+
HardwareSerial Serial3(USART3);
48+
void serialEvent3() __attribute__((weak));
49+
#endif
50+
51+
#if defined(HAVE_HWSERIAL4)
52+
#if defined(USART4)
53+
HardwareSerial Serial4(USART4);
54+
#else
55+
HardwareSerial Serial4(UART4);
56+
#endif
57+
void serialEvent4() __attribute__((weak));
58+
#endif
59+
60+
#if defined(HAVE_HWSERIAL5)
61+
#if defined(USART5)
62+
HardwareSerial Serial5(USART5);
63+
#else
64+
HardwareSerial Serial5(UART5);
65+
#endif
66+
void serialEvent5() __attribute__((weak));
67+
#endif
68+
69+
#if defined(HAVE_HWSERIAL6)
70+
HardwareSerial Serial6(USART6);
71+
void serialEvent6() __attribute__((weak));
72+
#endif
73+
74+
#if defined(HAVE_HWSERIAL7)
75+
#if defined(USART7)
76+
HardwareSerial Serial7(USART7);
77+
#else
78+
HardwareSerial Serial7(UART7);
79+
#endif
80+
void serialEvent7() __attribute__((weak));
81+
#endif
82+
83+
#if defined(HAVE_HWSERIAL8)
84+
#if defined(USART8)
85+
HardwareSerial Serial8(USART8);
86+
#else
87+
HardwareSerial Serial8(UART8);
88+
#endif
89+
void serialEvent8() __attribute__((weak));
90+
#endif
91+
92+
#if defined(HAVE_HWSERIAL9)
93+
HardwareSerial Serial9(UART9);
94+
void serialEvent9() __attribute__((weak));
95+
#endif
96+
97+
#if defined(HAVE_HWSERIAL10)
98+
HardwareSerial Serial10(UART10);
99+
void serialEvent10() __attribute__((weak));
100+
#endif
101+
102+
#if defined(HAVE_HWSERIALLP1)
103+
HardwareSerial SerialLP1(LPUART1);
104+
void serialEventLP1() __attribute__((weak));
105+
#endif
106106
#endif // HAVE_HWSERIALx
107107

108108
// Constructors ////////////////////////////////////////////////////////////////

Diff for: cores/arduino/HardwareSerial.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@
4141
// often work, but occasionally a race condition can occur that makes
4242
// Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405
4343
#if !defined(SERIAL_TX_BUFFER_SIZE)
44-
#define SERIAL_TX_BUFFER_SIZE 64
44+
#define SERIAL_TX_BUFFER_SIZE 64
4545
#endif
4646
#if !defined(SERIAL_RX_BUFFER_SIZE)
47-
#define SERIAL_RX_BUFFER_SIZE 64
47+
#define SERIAL_RX_BUFFER_SIZE 64
4848
#endif
4949
#if (SERIAL_TX_BUFFER_SIZE>256)
50-
typedef uint16_t tx_buffer_index_t;
50+
typedef uint16_t tx_buffer_index_t;
5151
#else
52-
typedef uint8_t tx_buffer_index_t;
52+
typedef uint8_t tx_buffer_index_t;
5353
#endif
5454
#if (SERIAL_RX_BUFFER_SIZE>256)
55-
typedef uint16_t rx_buffer_index_t;
55+
typedef uint16_t rx_buffer_index_t;
5656
#else
57-
typedef uint8_t rx_buffer_index_t;
57+
typedef uint8_t rx_buffer_index_t;
5858
#endif
5959

6060
// A bool should be enough for this
@@ -78,12 +78,12 @@ typedef enum {
7878
//#define SERIAL_6N2 0x0A
7979

8080
#ifdef UART_WORDLENGTH_7B
81-
#define SERIAL_7N1 0x04
82-
#define SERIAL_7N2 0x0C
83-
#define SERIAL_6E1 0x22
84-
#define SERIAL_6E2 0x2A
85-
#define SERIAL_6O1 0x32
86-
#define SERIAL_6O2 0x3A
81+
#define SERIAL_7N1 0x04
82+
#define SERIAL_7N2 0x0C
83+
#define SERIAL_6E1 0x22
84+
#define SERIAL_6E2 0x2A
85+
#define SERIAL_6O1 0x32
86+
#define SERIAL_6O2 0x3A
8787
#endif
8888
#define SERIAL_8N1 0x06
8989
#define SERIAL_8N2 0x0E

Diff for: cores/arduino/Print.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "Print.h"
3030

3131
#if defined (VIRTIO_LOG)
32-
#include "virtio_log.h"
32+
#include "virtio_log.h"
3333
#endif
3434

3535
// Public Methods //////////////////////////////////////////////////////////////

Diff for: cores/arduino/Tone.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
#define _WIRING_TONE_
2121

2222
#ifdef __cplusplus
23-
/*
24-
* \brief Generate a tone to a pin.
25-
*
26-
* \param _pin
27-
* \param frequency Tone frequency (in hertz)
28-
* \param duration Tone duration (in milliseconds)
29-
*/
30-
extern void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
31-
32-
/*
33-
* \brief Stop tone generation on pin.
34-
*
35-
* \param _pin
36-
*/
37-
extern void noTone(uint8_t _pin, bool destruct = false);
23+
/*
24+
* \brief Generate a tone to a pin.
25+
*
26+
* \param _pin
27+
* \param frequency Tone frequency (in hertz)
28+
* \param duration Tone duration (in milliseconds)
29+
*/
30+
extern void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);
31+
32+
/*
33+
* \brief Stop tone generation on pin.
34+
*
35+
* \param _pin
36+
*/
37+
extern void noTone(uint8_t _pin, bool destruct = false);
3838

3939
#endif
4040

Diff for: cores/arduino/VirtIOSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "core_debug.h"
2828

2929
#if !defined(VIRTIOSERIAL_NUM)
30-
#define VIRTIOSERIAL_NUM 1
30+
#define VIRTIOSERIAL_NUM 1
3131
#endif
3232

3333
VirtIOSerialObj_t *VirtIOSerial_Handle[VIRTIOSERIAL_NUM] = {NULL};

Diff for: cores/arduino/WInterrupts.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
#include <stdint.h>
2323

2424
#ifdef __cplusplus
25-
#include <functional>
25+
#include <functional>
2626

27-
typedef std::function<void(void)> callback_function_t;
28-
void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode);
27+
typedef std::function<void(void)> callback_function_t;
28+
void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode);
2929

3030
#endif
3131

0 commit comments

Comments
 (0)