Skip to content

Commit 8c48f27

Browse files
committed
clang format
1 parent f790358 commit 8c48f27

File tree

3 files changed

+30
-34
lines changed

3 files changed

+30
-34
lines changed

src/arduino/Adafruit_USBD_Device.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,36 @@
4040
// if defined, mostly on mbed core
4141

4242
#ifndef USB_VID
43-
#ifdef BOARD_VENDORID
44-
#define USB_VID BOARD_VENDORID
45-
#else
46-
#define USB_VID 0x239a
47-
#endif
43+
#ifdef BOARD_VENDORID
44+
#define USB_VID BOARD_VENDORID
45+
#else
46+
#define USB_VID 0x239a
47+
#endif
4848
#endif
4949

5050
#ifndef USB_PID
51-
#ifdef BOARD_PRODUCTID
52-
#define USB_PID BOARD_PRODUCTID
53-
#else
54-
#define USB_PID 0xcafe
55-
#endif
51+
#ifdef BOARD_PRODUCTID
52+
#define USB_PID BOARD_PRODUCTID
53+
#else
54+
#define USB_PID 0xcafe
55+
#endif
5656
#endif
5757

5858
#ifndef USB_MANUFACTURER
5959

60-
#ifdef BOARD_MANUFACTURER
61-
#define USB_MANUFACTURER BOARD_MANUFACTURER
62-
#else
63-
#define USB_MANUFACTURER "Adafruit"
64-
#endif
60+
#ifdef BOARD_MANUFACTURER
61+
#define USB_MANUFACTURER BOARD_MANUFACTURER
62+
#else
63+
#define USB_MANUFACTURER "Adafruit"
64+
#endif
6565
#endif
6666

6767
#ifndef USB_PRODUCT
68-
#ifdef BOARD_NAME
69-
#define USB_PRODUCT BOARD_NAME
70-
#else
71-
#define USB_PRODUCT "Unknown"
72-
#endif
68+
#ifdef BOARD_NAME
69+
#define USB_PRODUCT BOARD_NAME
70+
#else
71+
#define USB_PRODUCT "Unknown"
72+
#endif
7373
#endif
7474

7575
#ifndef USB_LANGUAGE

src/arduino/Adafruit_USBD_Device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ extern Adafruit_USBD_Device TinyUSBDevice;
112112
// USBDevice has a high chance to conflict with other usb stack
113113
// only define if supported BSP
114114
#ifdef USE_TINYUSB
115-
#define USBDevice TinyUSBDevice
115+
#define USBDevice TinyUSBDevice
116116
#endif
117117

118118
#endif /* ADAFRUIT_USBD_DEVICE_H_ */

src/arduino/ports/rp2040/Adafruit_TinyUSB_rp2040.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
// mbed old pico-sdk need to wrap with cpp
3232
extern "C" {
33+
#include "hardware/flash.h"
3334
#include "hardware/irq.h"
3435
#include "pico/bootrom.h"
3536
#include "pico/mutex.h"
3637
#include "pico/time.h"
37-
#include "hardware/flash.h"
3838
}
3939

4040
#include "arduino/Adafruit_TinyUSB_API.h"
@@ -60,31 +60,27 @@ extern "C" {
6060
#include "mbed.h"
6161
static mbed::Ticker _usb_ticker;
6262

63-
#define get_unique_id(_serial) flash_get_unique_id(_serial)
63+
#define get_unique_id(_serial) flash_get_unique_id(_serial)
6464

65-
static void ticker_task(void)
66-
{
67-
irq_set_pending(USB_TASK_IRQ);
68-
}
65+
static void ticker_task(void) { irq_set_pending(USB_TASK_IRQ); }
6966

70-
static void setup_periodic_usb_hanlder(uint64_t us)
71-
{
72-
_usb_ticker.attach(ticker_task, (std::chrono::microseconds) us);
67+
static void setup_periodic_usb_hanlder(uint64_t us) {
68+
_usb_ticker.attach(ticker_task, (std::chrono::microseconds)us);
7369
}
7470

7571
#else
7672

7773
#include "pico/unique_id.h"
7874

79-
#define get_unique_id(_serial) pico_get_unique_board_id((pico_unique_board_id_t *)_serial);
75+
#define get_unique_id(_serial) \
76+
pico_get_unique_board_id((pico_unique_board_id_t *)_serial);
8077

8178
static int64_t timer_task(__unused alarm_id_t id, __unused void *user_data) {
8279
irq_set_pending(USB_TASK_IRQ);
8380
return USB_TASK_INTERVAL;
8481
}
8582

86-
static void setup_periodic_usb_hanlder(uint64_t us)
87-
{
83+
static void setup_periodic_usb_hanlder(uint64_t us) {
8884
add_alarm_in_us(us, timer_task, NULL, true);
8985
}
9086

@@ -115,7 +111,7 @@ void TinyUSB_Port_InitDevice(uint8_t rhport) {
115111

116112
irq_set_enabled(USBCTRL_IRQ, false);
117113
irq_handler_t current_handler = irq_get_exclusive_handler(USBCTRL_IRQ);
118-
if(current_handler) {
114+
if (current_handler) {
119115
irq_remove_handler(USBCTRL_IRQ, current_handler);
120116
}
121117

0 commit comments

Comments
 (0)