Skip to content

Astyle indent preproc block #1007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CI/astyle/.astylerc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ indent-classes
indent-switches
indent-cases
indent-col1-comments
indent-preproc-block

# Remove spaces in and around parentheses
unpad-paren
Expand Down
4 changes: 2 additions & 2 deletions cores/arduino/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
+ __GNUC_PATCHLEVEL__)
#endif
#if GCC_VERSION < 60300
#error "GCC version 6.3 or higher is required"
#error "GCC version 6.3 or higher is required"
#endif

#ifdef __IN_ECLIPSE__
#include "SrcWrapper.h"
#include "SrcWrapper.h"
#endif

#include "wiring.h"
Expand Down
150 changes: 75 additions & 75 deletions cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,81 +28,81 @@

#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
#if defined(HAVE_HWSERIAL1) || defined(HAVE_HWSERIAL2) || defined(HAVE_HWSERIAL3) ||\
defined(HAVE_HWSERIAL4) || defined(HAVE_HWSERIAL5) || defined(HAVE_HWSERIAL6) ||\
defined(HAVE_HWSERIAL7) || defined(HAVE_HWSERIAL8) || defined(HAVE_HWSERIAL9) ||\
defined(HAVE_HWSERIAL10) || defined(HAVE_HWSERIALLP1)
// SerialEvent functions are weak, so when the user doesn't define them,
// the linker just sets their address to 0 (which is checked below).
#if defined(HAVE_HWSERIAL1)
HardwareSerial Serial1(USART1);
void serialEvent1() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL2)
HardwareSerial Serial2(USART2);
void serialEvent2() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL3)
HardwareSerial Serial3(USART3);
void serialEvent3() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL4)
#if defined(USART4)
HardwareSerial Serial4(USART4);
#else
HardwareSerial Serial4(UART4);
#endif
void serialEvent4() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL5)
#if defined(USART5)
HardwareSerial Serial5(USART5);
#else
HardwareSerial Serial5(UART5);
#endif
void serialEvent5() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL6)
HardwareSerial Serial6(USART6);
void serialEvent6() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL7)
#if defined(USART7)
HardwareSerial Serial7(USART7);
#else
HardwareSerial Serial7(UART7);
#endif
void serialEvent7() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL8)
#if defined(USART8)
HardwareSerial Serial8(USART8);
#else
HardwareSerial Serial8(UART8);
#endif
void serialEvent8() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL9)
HardwareSerial Serial9(UART9);
void serialEvent9() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL10)
HardwareSerial Serial10(UART10);
void serialEvent10() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIALLP1)
HardwareSerial SerialLP1(LPUART1);
void serialEventLP1() __attribute__((weak));
#endif
defined(HAVE_HWSERIAL4) || defined(HAVE_HWSERIAL5) || defined(HAVE_HWSERIAL6) ||\
defined(HAVE_HWSERIAL7) || defined(HAVE_HWSERIAL8) || defined(HAVE_HWSERIAL9) ||\
defined(HAVE_HWSERIAL10) || defined(HAVE_HWSERIALLP1)
// SerialEvent functions are weak, so when the user doesn't define them,
// the linker just sets their address to 0 (which is checked below).
#if defined(HAVE_HWSERIAL1)
HardwareSerial Serial1(USART1);
void serialEvent1() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL2)
HardwareSerial Serial2(USART2);
void serialEvent2() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL3)
HardwareSerial Serial3(USART3);
void serialEvent3() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL4)
#if defined(USART4)
HardwareSerial Serial4(USART4);
#else
HardwareSerial Serial4(UART4);
#endif
void serialEvent4() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL5)
#if defined(USART5)
HardwareSerial Serial5(USART5);
#else
HardwareSerial Serial5(UART5);
#endif
void serialEvent5() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL6)
HardwareSerial Serial6(USART6);
void serialEvent6() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL7)
#if defined(USART7)
HardwareSerial Serial7(USART7);
#else
HardwareSerial Serial7(UART7);
#endif
void serialEvent7() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL8)
#if defined(USART8)
HardwareSerial Serial8(USART8);
#else
HardwareSerial Serial8(UART8);
#endif
void serialEvent8() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL9)
HardwareSerial Serial9(UART9);
void serialEvent9() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIAL10)
HardwareSerial Serial10(UART10);
void serialEvent10() __attribute__((weak));
#endif

#if defined(HAVE_HWSERIALLP1)
HardwareSerial SerialLP1(LPUART1);
void serialEventLP1() __attribute__((weak));
#endif
#endif // HAVE_HWSERIALx

// Constructors ////////////////////////////////////////////////////////////////
Expand Down
24 changes: 12 additions & 12 deletions cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
// often work, but occasionally a race condition can occur that makes
// Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405
#if !defined(SERIAL_TX_BUFFER_SIZE)
#define SERIAL_TX_BUFFER_SIZE 64
#define SERIAL_TX_BUFFER_SIZE 64
#endif
#if !defined(SERIAL_RX_BUFFER_SIZE)
#define SERIAL_RX_BUFFER_SIZE 64
#define SERIAL_RX_BUFFER_SIZE 64
#endif
#if (SERIAL_TX_BUFFER_SIZE>256)
typedef uint16_t tx_buffer_index_t;
typedef uint16_t tx_buffer_index_t;
#else
typedef uint8_t tx_buffer_index_t;
typedef uint8_t tx_buffer_index_t;
#endif
#if (SERIAL_RX_BUFFER_SIZE>256)
typedef uint16_t rx_buffer_index_t;
typedef uint16_t rx_buffer_index_t;
#else
typedef uint8_t rx_buffer_index_t;
typedef uint8_t rx_buffer_index_t;
#endif

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

#ifdef UART_WORDLENGTH_7B
#define SERIAL_7N1 0x04
#define SERIAL_7N2 0x0C
#define SERIAL_6E1 0x22
#define SERIAL_6E2 0x2A
#define SERIAL_6O1 0x32
#define SERIAL_6O2 0x3A
#define SERIAL_7N1 0x04
#define SERIAL_7N2 0x0C
#define SERIAL_6E1 0x22
#define SERIAL_6E2 0x2A
#define SERIAL_6O1 0x32
#define SERIAL_6O2 0x3A
#endif
#define SERIAL_8N1 0x06
#define SERIAL_8N2 0x0E
Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "Print.h"

#if defined (VIRTIO_LOG)
#include "virtio_log.h"
#include "virtio_log.h"
#endif

// Public Methods //////////////////////////////////////////////////////////////
Expand Down
30 changes: 15 additions & 15 deletions cores/arduino/Tone.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
#define _WIRING_TONE_

#ifdef __cplusplus
/*
* \brief Generate a tone to a pin.
*
* \param _pin
* \param frequency Tone frequency (in hertz)
* \param duration Tone duration (in milliseconds)
*/
extern void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);

/*
* \brief Stop tone generation on pin.
*
* \param _pin
*/
extern void noTone(uint8_t _pin, bool destruct = false);
/*
* \brief Generate a tone to a pin.
*
* \param _pin
* \param frequency Tone frequency (in hertz)
* \param duration Tone duration (in milliseconds)
*/
extern void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0);

/*
* \brief Stop tone generation on pin.
*
* \param _pin
*/
extern void noTone(uint8_t _pin, bool destruct = false);

#endif

Expand Down
2 changes: 1 addition & 1 deletion cores/arduino/VirtIOSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "core_debug.h"

#if !defined(VIRTIOSERIAL_NUM)
#define VIRTIOSERIAL_NUM 1
#define VIRTIOSERIAL_NUM 1
#endif

VirtIOSerialObj_t *VirtIOSerial_Handle[VIRTIOSERIAL_NUM] = {NULL};
Expand Down
6 changes: 3 additions & 3 deletions cores/arduino/WInterrupts.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#include <stdint.h>

#ifdef __cplusplus
#include <functional>
#include <functional>

typedef std::function<void(void)> callback_function_t;
void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode);
typedef std::function<void(void)> callback_function_t;
void attachInterrupt(uint32_t pin, callback_function_t callback, uint32_t mode);

#endif

Expand Down
Loading