summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-02-12 10:29:31 -0800
committerGitHub <noreply@github.com>2022-02-12 18:29:31 +0000
commit63646e8906e062d1c1de3925cba70c4e3426a855 (patch)
tree4e91648b77b838e1125cf86331d7e84bde6d07a9 /drivers/bluetooth
parentafcdd7079c774dec2aa4b7f2d08adf8b7310919b (diff)
downloadqmk_firmware-63646e8906e062d1c1de3925cba70c4e3426a855.tar.gz
qmk_firmware-63646e8906e062d1c1de3925cba70c4e3426a855.zip
Format code according to conventions (#16322)
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bluefruit_le.cpp26
-rw-r--r--drivers/bluetooth/outputselect.c2
-rw-r--r--drivers/bluetooth/rn42.c8
3 files changed, 22 insertions, 14 deletions
diff --git a/drivers/bluetooth/bluefruit_le.cpp b/drivers/bluetooth/bluefruit_le.cpp
index 86581a1a48..19310767cf 100644
--- a/drivers/bluetooth/bluefruit_le.cpp
+++ b/drivers/bluetooth/bluefruit_le.cpp
@@ -29,7 +29,7 @@
#endif
#ifndef BLUEFRUIT_LE_SCK_DIVISOR
-# define BLUEFRUIT_LE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE
+# define BLUEFRUIT_LE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE
#endif
#define SAMPLE_BATTERY
@@ -77,10 +77,10 @@ struct sdep_msg {
// information here.
enum queue_type {
- QTKeyReport, // 1-byte modifier + 6-byte key report
- QTConsumer, // 16-bit key code
+ QTKeyReport, // 1-byte modifier + 6-byte key report
+ QTConsumer, // 16-bit key code
#ifdef MOUSE_ENABLE
- QTMouseMove, // 4-byte mouse report
+ QTMouseMove, // 4-byte mouse report
#endif
};
@@ -115,8 +115,8 @@ enum sdep_type {
SdepResponse = 0x20,
SdepAlert = 0x40,
SdepError = 0x80,
- SdepSlaveNotReady = 0xFE, // Try again later
- SdepSlaveOverflow = 0xFF, // You read more data than is available
+ SdepSlaveNotReady = 0xFE, // Try again later
+ SdepSlaveOverflow = 0xFF, // You read more data than is available
};
enum ble_cmd {
@@ -306,13 +306,15 @@ static bool ble_init(void) {
wait_ms(10);
writePinHigh(BLUEFRUIT_LE_RST_PIN);
- wait_ms(1000); // Give it a second to initialize
+ wait_ms(1000); // Give it a second to initialize
state.initialized = true;
return state.initialized;
}
-static inline uint8_t min(uint8_t a, uint8_t b) { return a < b ? a : b; }
+static inline uint8_t min(uint8_t a, uint8_t b) {
+ return a < b ? a : b;
+}
static bool read_response(char *resp, uint16_t resplen, bool verbose) {
char *dest = resp;
@@ -424,7 +426,9 @@ bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool verbose) {
return at_command(cmdbuf, resp, resplen, verbose);
}
-bool bluefruit_le_is_connected(void) { return state.is_connected; }
+bool bluefruit_le_is_connected(void) {
+ return state.is_connected;
+}
bool bluefruit_le_enable_keyboard(void) {
char resbuf[128];
@@ -671,7 +675,9 @@ void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan,
}
#endif
-uint32_t bluefruit_le_read_battery_voltage(void) { return state.vbat; }
+uint32_t bluefruit_le_read_battery_voltage(void) {
+ return state.vbat;
+}
bool bluefruit_le_set_mode_leds(bool on) {
if (!state.configured) {
diff --git a/drivers/bluetooth/outputselect.c b/drivers/bluetooth/outputselect.c
index 44bc4a9aa3..b986ba274e 100644
--- a/drivers/bluetooth/outputselect.c
+++ b/drivers/bluetooth/outputselect.c
@@ -52,7 +52,7 @@ uint8_t auto_detect_output(void) {
#endif
#ifdef BLUETOOTH_ENABLE
- return OUTPUT_BLUETOOTH; // should check if BT is connected here
+ return OUTPUT_BLUETOOTH; // should check if BT is connected here
#endif
return OUTPUT_NONE;
diff --git a/drivers/bluetooth/rn42.c b/drivers/bluetooth/rn42.c
index 2ef40bb7e0..5d497cda20 100644
--- a/drivers/bluetooth/rn42.c
+++ b/drivers/bluetooth/rn42.c
@@ -61,7 +61,9 @@ static inline uint16_t rn42_consumer_usage_to_bitmap(uint16_t usage) {
}
}
-void rn42_init(void) { uart_init(RN42_BAUD_RATE); }
+void rn42_init(void) {
+ uart_init(RN42_BAUD_RATE);
+}
void rn42_send_keyboard(report_keyboard_t *report) {
uart_write(0xFD);
@@ -81,8 +83,8 @@ void rn42_send_mouse(report_mouse_t *report) {
uart_write(report->buttons);
uart_write(report->x);
uart_write(report->y);
- uart_write(report->v); // should try sending the wheel v here
- uart_write(report->h); // should try sending the wheel h here
+ uart_write(report->v); // should try sending the wheel v here
+ uart_write(report->h); // should try sending the wheel h here
uart_write(0x00);
}