Skip to content

Commit d274581

Browse files
committed
add clang to pre-commit
1 parent c497d50 commit d274581

File tree

4 files changed

+36
-16
lines changed

4 files changed

+36
-16
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,27 @@
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6+
- repo: https://github.com/pre-commit/mirrors-clang-format
7+
rev: v15.0.7
8+
hooks:
9+
- id: clang-format
10+
exclude: |
11+
(?x)^(
12+
examples/|
13+
src/class|
14+
src/common|
15+
src/device|
16+
src/host|
17+
src/osal|
18+
src/portable|
19+
src/tusb_option.h|
20+
src/tusb.c|
21+
src/tusb.h
22+
)
23+
types_or: [c++, c, header]
24+
625
- repo: https://github.com/codespell-project/codespell
726
rev: v2.2.4
827
hooks:
928
- id: codespell
10-
#args: [-w]
29+
args: [-w]

src/Adafruit_TinyUSB.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
#define ADAFRUIT_TINYUSB_H_
2727

2828
// Error message for Core that must select TinyUSB via menu
29-
#if !defined(USE_TINYUSB) && ( defined(ARDUINO_ARCH_SAMD) || \
30-
(defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)) )
29+
#if !defined(USE_TINYUSB) && \
30+
(defined(ARDUINO_ARCH_SAMD) || \
31+
(defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_ARCH_MBED)))
3132
#error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack"
3233
#endif
3334

@@ -39,23 +40,23 @@
3940
#include "arduino/Adafruit_USBD_Device.h"
4041

4142
#if CFG_TUD_CDC
42-
#include "arduino/Adafruit_USBD_CDC.h"
43+
#include "arduino/Adafruit_USBD_CDC.h"
4344
#endif
4445

4546
#if CFG_TUD_HID
46-
#include "arduino/hid/Adafruit_USBD_HID.h"
47+
#include "arduino/hid/Adafruit_USBD_HID.h"
4748
#endif
4849

4950
#if CFG_TUD_MIDI
50-
#include "arduino/midi/Adafruit_USBD_MIDI.h"
51+
#include "arduino/midi/Adafruit_USBD_MIDI.h"
5152
#endif
5253

5354
#if CFG_TUD_MSC
54-
#include "arduino/msc/Adafruit_USBD_MSC.h"
55+
#include "arduino/msc/Adafruit_USBD_MSC.h"
5556
#endif
5657

5758
#if CFG_TUD_VENDOR
58-
#include "arduino/webusb/Adafruit_USBD_WebUSB.h"
59+
#include "arduino/webusb/Adafruit_USBD_WebUSB.h"
5960
#endif
6061

6162
// Initialize device hardware, stack, also Serial as CDC
@@ -70,11 +71,11 @@ void TinyUSB_Device_Init(uint8_t rhport);
7071
#include "arduino/Adafruit_USBH_Host.h"
7172

7273
#if CFG_TUH_CDC
73-
#include "arduino/cdc/Adafruit_USBH_CDC.h"
74+
#include "arduino/cdc/Adafruit_USBH_CDC.h"
7475
#endif
7576

7677
#if CFG_TUH_MSC
77-
#include "arduino/msc/Adafruit_USBH_MSC.h"
78+
#include "arduino/msc/Adafruit_USBH_MSC.h"
7879
#endif
7980

8081
#endif

src/arduino/Adafruit_USBH_Host.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class Adafruit_USBH_Host {
5959
//
6060
//// USBHost has a high chance to conflict with other usb stack
6161
//// only define if supported BSP
62-
//#ifdef USE_TINYUSB
63-
//#define USBHost TinyUSBHost
64-
//#endif
62+
// #ifdef USE_TINYUSB
63+
// #define USBHost TinyUSBHost
64+
// #endif
6565

6666
#endif /* ADAFRUIT_USBH_HOST_H_ */

src/arduino/ports/rp2040/tusb_config_rp2040.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ extern int serial1_printf(const char *__restrict __format, ...);
101101
#define CFG_TUH_HUB 1
102102

103103
// max device support (excluding hub device): 1 hub typically has 4 ports
104-
#define CFG_TUH_DEVICE_MAX (3*CFG_TUH_HUB + 1)
104+
#define CFG_TUH_DEVICE_MAX (3 * CFG_TUH_HUB + 1)
105105

106106
// Enable tuh_edpt_xfer() API
107-
//#define CFG_TUH_API_EDPT_XFER 1
107+
// #define CFG_TUH_API_EDPT_XFER 1
108108

109109
// Number of mass storage
110110
#define CFG_TUH_MSC 1
111111

112112
// Number of HIDs
113113
// typical keyboard + mouse device can have 3,4 HID interfaces
114-
#define CFG_TUH_HID (3*CFG_TUH_DEVICE_MAX)
114+
#define CFG_TUH_HID (3 * CFG_TUH_DEVICE_MAX)
115115

116116
// Number of CDC interfaces
117117
#define CFG_TUH_CDC 1

0 commit comments

Comments
 (0)