diff --git a/common_features.mk b/common_features.mk index e00f95f8e4e..d3da487e696 100644 --- a/common_features.mk +++ b/common_features.mk @@ -717,7 +717,7 @@ ifeq ($(strip $(USBPD_ENABLE)), yes) endif BLUETOOTH_ENABLE ?= no -VALID_BLUETOOTH_DRIVER_TYPES := AdafruitBLE RN42 custom +VALID_BLUETOOTH_DRIVER_TYPES := BluefruitLE RN42 custom ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) ifeq ($(filter $(strip $(BLUETOOTH_DRIVER)),$(VALID_BLUETOOTH_DRIVER_TYPES)),) $(error "$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type) @@ -727,15 +727,15 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) COMMON_VPATH += $(DRIVER_PATH)/bluetooth SRC += outputselect.c - ifeq ($(strip $(BLUETOOTH_DRIVER)), AdafruitBLE) - OPT_DEFS += -DMODULE_ADAFRUIT_BLE + ifeq ($(strip $(BLUETOOTH_DRIVER)), BluefruitLE) + OPT_DEFS += -DBLUETOOTH_BLUEFRUIT_LE SRC += analog.c - SRC += $(DRIVER_PATH)/bluetooth/adafruit_ble.cpp + SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp QUANTUM_LIB_SRC += spi_master.c endif ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42) - OPT_DEFS += -DMODULE_RN42 + OPT_DEFS += -DBLUETOOTH_RN42 SRC += $(DRIVER_PATH)/bluetooth/rn42.c QUANTUM_LIB_SRC += uart.c endif diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 547df94d1f3..132484b708a 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -45,7 +45,7 @@ "properties": { "driver": { "type": "string", - "enum": ["AdafruitBLE", "RN42"] + "enum": ["BluefruitLE", "RN42"] }, "lto": {"type": "boolean"}, } diff --git a/docs/config_options.md b/docs/config_options.md index 7657fae02e5..832af78b22c 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -429,8 +429,8 @@ Use these to enable or disable building certain features. The more you have enab * MIDI controls * `UNICODE_ENABLE` * Unicode -* `BLUETOOTH` - * Current options are AdafruitBLE, RN42 +* `BLUETOOTH_ENABLE` + * Current options are BluefruitLE, RN42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common * `CUSTOM_MATRIX` diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md index f6fb02d948b..d4ed494053b 100644 --- a/docs/feature_bluetooth.md +++ b/docs/feature_bluetooth.md @@ -7,7 +7,7 @@ Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1, QM |Board |Bluetooth Protocol |Connection Type|rules.mk |Bluetooth Chip| |----------------------------------------------------------------|--------------------|---------------|--------------------------------|--------------| |Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic |UART |`BLUETOOTH_DRIVER = RN42` |RN-42 | -|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = AdafruitBLE`|nRF51822 | +|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = BluefruitLE`|nRF51822 | Not Supported Yet but possible: * [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514) @@ -17,9 +17,9 @@ Not Supported Yet but possible: ### Adafruit BLE SPI Friend Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF51822 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines: -* `#define ADAFRUIT_BLE_RST_PIN D4` -* `#define ADAFRUIT_BLE_CS_PIN B4` -* `#define ADAFRUIT_BLE_IRQ_PIN E6` +* `#define BLUEFRUIT_LE_RST_PIN D4` +* `#define BLUEFRUIT_LE_CS_PIN B4` +* `#define BLUEFRUIT_LE_IRQ_PIN E6` A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip. @@ -32,7 +32,7 @@ Add the following to your `rules.mk`: ```make BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE # or RN42 +BLUETOOTH_DRIVER = BluefruitLE # or RN42 ``` ## Bluetooth Keycodes diff --git a/drivers/bluetooth/adafruit_ble.cpp b/drivers/bluetooth/bluefruit_le.cpp similarity index 92% rename from drivers/bluetooth/adafruit_ble.cpp rename to drivers/bluetooth/bluefruit_le.cpp index 34a780e9a5c..86581a1a489 100644 --- a/drivers/bluetooth/adafruit_ble.cpp +++ b/drivers/bluetooth/bluefruit_le.cpp @@ -1,4 +1,4 @@ -#include "adafruit_ble.h" +#include "bluefruit_le.h" #include #include @@ -16,20 +16,20 @@ // These are the pin assignments for the 32u4 boards. // You may define them to something else in your config.h // if yours is wired up differently. -#ifndef ADAFRUIT_BLE_RST_PIN -# define ADAFRUIT_BLE_RST_PIN D4 +#ifndef BLUEFRUIT_LE_RST_PIN +# define BLUEFRUIT_LE_RST_PIN D4 #endif -#ifndef ADAFRUIT_BLE_CS_PIN -# define ADAFRUIT_BLE_CS_PIN B4 +#ifndef BLUEFRUIT_LE_CS_PIN +# define BLUEFRUIT_LE_CS_PIN B4 #endif -#ifndef ADAFRUIT_BLE_IRQ_PIN -# define ADAFRUIT_BLE_IRQ_PIN E6 +#ifndef BLUEFRUIT_LE_IRQ_PIN +# define BLUEFRUIT_LE_IRQ_PIN E6 #endif -#ifndef ADAFRUIT_BLE_SCK_DIVISOR -# define ADAFRUIT_BLE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE +#ifndef BLUEFRUIT_LE_SCK_DIVISOR +# define BLUEFRUIT_LE_SCK_DIVISOR 2 // 4MHz SCK/8MHz CPU, calculated for Feather 32U4 BLE #endif #define SAMPLE_BATTERY @@ -143,7 +143,7 @@ static bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool ver // Send a single SDEP packet static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); uint16_t timerStart = timer_read(); bool success = false; bool ready = false; @@ -157,7 +157,7 @@ static bool sdep_send_pkt(const struct sdep_msg *msg, uint16_t timeout) { // Release it and let it initialize spi_stop(); wait_us(SdepBackOff); - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); } while (timer_elapsed(timerStart) < timeout); if (ready) { @@ -190,7 +190,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { bool ready = false; do { - ready = readPin(ADAFRUIT_BLE_IRQ_PIN); + ready = readPin(BLUEFRUIT_LE_IRQ_PIN); if (ready) { break; } @@ -198,7 +198,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { } while (timer_elapsed(timerStart) < timeout); if (ready) { - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); do { // Read the command type, waiting for the data to be ready @@ -207,7 +207,7 @@ static bool sdep_recv_pkt(struct sdep_msg *msg, uint16_t timeout) { // Release it and let it initialize spi_stop(); wait_us(SdepBackOff); - spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, ADAFRUIT_BLE_SCK_DIVISOR); + spi_start(BLUEFRUIT_LE_CS_PIN, false, 0, BLUEFRUIT_LE_SCK_DIVISOR); continue; } @@ -233,7 +233,7 @@ static void resp_buf_read_one(bool greedy) { return; } - if (readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (readPin(BLUEFRUIT_LE_IRQ_PIN)) { struct sdep_msg msg; again: @@ -244,7 +244,7 @@ static void resp_buf_read_one(bool greedy) { dprintf("recv latency %dms\n", TIMER_DIFF_16(timer_read(), last_send)); } - if (greedy && resp_buf.peek(last_send) && readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (greedy && resp_buf.peek(last_send) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { goto again; } } @@ -295,16 +295,16 @@ static bool ble_init(void) { state.configured = false; state.is_connected = false; - setPinInput(ADAFRUIT_BLE_IRQ_PIN); + setPinInput(BLUEFRUIT_LE_IRQ_PIN); spi_init(); // Perform a hardware reset - setPinOutput(ADAFRUIT_BLE_RST_PIN); - writePinHigh(ADAFRUIT_BLE_RST_PIN); - writePinLow(ADAFRUIT_BLE_RST_PIN); + setPinOutput(BLUEFRUIT_LE_RST_PIN); + writePinHigh(BLUEFRUIT_LE_RST_PIN); + writePinLow(BLUEFRUIT_LE_RST_PIN); wait_ms(10); - writePinHigh(ADAFRUIT_BLE_RST_PIN); + writePinHigh(BLUEFRUIT_LE_RST_PIN); wait_ms(1000); // Give it a second to initialize @@ -424,9 +424,9 @@ bool at_command_P(const char *cmd, char *resp, uint16_t resplen, bool verbose) { return at_command(cmdbuf, resp, resplen, verbose); } -bool adafruit_ble_is_connected(void) { return state.is_connected; } +bool bluefruit_le_is_connected(void) { return state.is_connected; } -bool adafruit_ble_enable_keyboard(void) { +bool bluefruit_le_enable_keyboard(void) { char resbuf[128]; if (!state.initialized && !ble_init()) { @@ -498,16 +498,16 @@ static void set_connected(bool connected) { } } -void adafruit_ble_task(void) { +void bluefruit_le_task(void) { char resbuf[48]; - if (!state.configured && !adafruit_ble_enable_keyboard()) { + if (!state.configured && !bluefruit_le_enable_keyboard()) { return; } resp_buf_read_one(true); send_buf_send_one(SdepShortTimeout); - if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(ADAFRUIT_BLE_IRQ_PIN)) { + if (resp_buf.empty() && (state.event_flags & UsingEvents) && readPin(BLUEFRUIT_LE_IRQ_PIN)) { // Must be an event update if (at_command_P(PSTR("AT+EVENTSTATUS"), resbuf, sizeof(resbuf))) { uint32_t mask = strtoul(resbuf, NULL, 16); @@ -609,7 +609,7 @@ static bool process_queue_item(struct queue_item *item, uint16_t timeout) { } } -void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys) { +void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys) { struct queue_item item; bool didWait = false; @@ -643,7 +643,7 @@ void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nk } } -void adafruit_ble_send_consumer_key(uint16_t usage) { +void bluefruit_le_send_consumer_key(uint16_t usage) { struct queue_item item; item.queue_type = QTConsumer; @@ -655,7 +655,7 @@ void adafruit_ble_send_consumer_key(uint16_t usage) { } #ifdef MOUSE_ENABLE -void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons) { +void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons) { struct queue_item item; item.queue_type = QTMouseMove; @@ -671,9 +671,9 @@ void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, } #endif -uint32_t adafruit_ble_read_battery_voltage(void) { return state.vbat; } +uint32_t bluefruit_le_read_battery_voltage(void) { return state.vbat; } -bool adafruit_ble_set_mode_leds(bool on) { +bool bluefruit_le_set_mode_leds(bool on) { if (!state.configured) { return false; } @@ -689,7 +689,7 @@ bool adafruit_ble_set_mode_leds(bool on) { } // https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/ble-generic#at-plus-blepowerlevel -bool adafruit_ble_set_power_level(int8_t level) { +bool bluefruit_le_set_power_level(int8_t level) { char cmd[46]; if (!state.configured) { return false; diff --git a/drivers/bluetooth/adafruit_ble.h b/drivers/bluetooth/bluefruit_le.h similarity index 70% rename from drivers/bluetooth/adafruit_ble.h rename to drivers/bluetooth/bluefruit_le.h index b43e0771d99..de301c6167a 100644 --- a/drivers/bluetooth/adafruit_ble.h +++ b/drivers/bluetooth/bluefruit_le.h @@ -16,43 +16,43 @@ extern "C" { #endif /* Instruct the module to enable HID keyboard support and reset */ -extern bool adafruit_ble_enable_keyboard(void); +extern bool bluefruit_le_enable_keyboard(void); /* Query to see if the BLE module is connected */ -extern bool adafruit_ble_query_is_connected(void); +extern bool bluefruit_le_query_is_connected(void); /* Returns true if we believe that the BLE module is connected. * This uses our cached understanding that is maintained by * calling ble_task() periodically. */ -extern bool adafruit_ble_is_connected(void); +extern bool bluefruit_le_is_connected(void); /* Call this periodically to process BLE-originated things */ -extern void adafruit_ble_task(void); +extern void bluefruit_le_task(void); /* Generates keypress events for a set of keys. * The hid modifier mask specifies the state of the modifier keys for * this set of keys. * Also sends a key release indicator, so that the keys do not remain * held down. */ -extern void adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys); +extern void bluefruit_le_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys); /* Send a consumer usage. * (milliseconds) */ -extern void adafruit_ble_send_consumer_key(uint16_t usage); +extern void bluefruit_le_send_consumer_key(uint16_t usage); #ifdef MOUSE_ENABLE /* Send a mouse/wheel movement report. * The parameters are signed and indicate positive or negative direction * change. */ -extern void adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); +extern void bluefruit_le_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons); #endif /* Compute battery voltage by reading an analog pin. * Returns the integer number of millivolts */ -extern uint32_t adafruit_ble_read_battery_voltage(void); +extern uint32_t bluefruit_le_read_battery_voltage(void); -extern bool adafruit_ble_set_mode_leds(bool on); -extern bool adafruit_ble_set_power_level(int8_t level); +extern bool bluefruit_le_set_mode_leds(bool on); +extern bool bluefruit_le_set_power_level(int8_t level); #ifdef __cplusplus } diff --git a/drivers/bluetooth/outputselect.c b/drivers/bluetooth/outputselect.c index f758c652809..cdd2e64cfdb 100644 --- a/drivers/bluetooth/outputselect.c +++ b/drivers/bluetooth/outputselect.c @@ -18,8 +18,8 @@ along with this program. If not, see . # include "lufa.h" #endif -#ifdef MODULE_ADAFRUIT_BLE -# include "adafruit_ble.h" +#ifdef BLUETOOTH_BLUEFRUIT_LE +# include "bluefruit_le.h" #endif uint8_t desired_output = OUTPUT_DEFAULT; @@ -54,8 +54,8 @@ uint8_t auto_detect_output(void) { return OUTPUT_USB; } -#ifdef MODULE_ADAFRUIT_BLE - if (adafruit_ble_is_connected()) { +#ifdef BLUETOOTH_BLUEFRUIT_LE + if (bluefruit_le_is_connected()) { return OUTPUT_BLUETOOTH; } #endif diff --git a/keyboards/10bleoledhub/rules.mk b/keyboards/10bleoledhub/rules.mk index 33170c43a23..bd10e11022f 100644 --- a/keyboards/10bleoledhub/rules.mk +++ b/keyboards/10bleoledhub/rules.mk @@ -20,7 +20,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE OLED_ENABLE = yes OLED_DRIVER = SSD1306 ENCODER_ENABLE = yes diff --git a/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk index 160b3684b3c..975c5818833 100644 --- a/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk +++ b/keyboards/40percentclub/mf68/keymaps/mf68_ble/rules.mk @@ -5,5 +5,5 @@ F_CPU = 8000000 # change yes to no to disable # BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE BACKLIGHT_ENABLE = no diff --git a/keyboards/atreus/feather/rules.mk b/keyboards/atreus/feather/rules.mk index ad0b4a5046b..6280275c1e5 100644 --- a/keyboards/atreus/feather/rules.mk +++ b/keyboards/atreus/feather/rules.mk @@ -11,5 +11,5 @@ BOOTLOADER = caterina # change yes to no to disable # BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE CONSOLE_ENABLE = no diff --git a/keyboards/bioi/main.c b/keyboards/bioi/main.c index 7c8922c0a05..54caf6937b5 100644 --- a/keyboards/bioi/main.c +++ b/keyboards/bioi/main.c @@ -45,8 +45,8 @@ extern keymap_config_t keymap_config; #endif #ifdef BLUETOOTH_ENABLE -#ifdef MODULE_ADAFRUIT_BLE -#include "adafruit_ble.h" +#ifdef BLUETOOTH_BLUEFRUIT_LE +#include "bluefruit_le.h" #else #include "bluetooth.h" #endif @@ -319,7 +319,7 @@ int main(void) setup_usb(); sei(); -#if defined(MODULE_ADAFRUIT_EZKEY) || defined(MODULE_RN42) +#if defined(BLUETOOTH_RN42) serial_init(); #endif diff --git a/keyboards/converter/m0110_usb/readme.md b/keyboards/converter/m0110_usb/readme.md index a148091cd97..d066aa5a7cd 100644 --- a/keyboards/converter/m0110_usb/readme.md +++ b/keyboards/converter/m0110_usb/readme.md @@ -5,7 +5,7 @@ This is a port of the original M0110 converter from TMK to QMK. The original con ## Enabling Bluetooth for the Adafruit Feather 32U4 BLE -Simply add `BLUETOOTH = AdafruitBLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` value from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name. +Simply add `BLUETOOTH = BluefruitLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` value from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name. ## Pins diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h index 80e4968c41d..92df24d0037 100644 --- a/keyboards/converter/usb_usb/ble/config.h +++ b/keyboards/converter/usb_usb/ble/config.h @@ -4,8 +4,8 @@ #define PRODUCT QMK BLE Adapter // Turn off the mode leds on the BLE module -#define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0 -#define ADAFRUIT_BLE_ENABLE_POWER_LED 0 +#define BLUEFRUIT_LE_ENABLE_MODE_LEDS 0 +#define BLUEFRUIT_LE_ENABLE_POWER_LED 0 #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk index 596f7196302..df5bc36635b 100644 --- a/keyboards/converter/usb_usb/ble/rules.mk +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -12,6 +12,6 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LTO_ENABLE = yes diff --git a/keyboards/dtisaac/dosa40rgb/readme.md b/keyboards/dtisaac/dosa40rgb/readme.md index 5f288c6b760..a2995a5c0f7 100644 --- a/keyboards/dtisaac/dosa40rgb/readme.md +++ b/keyboards/dtisaac/dosa40rgb/readme.md @@ -5,7 +5,7 @@ A 40 percent keyboard dosa40rgb Bluetooth Low Energy * Keyboard Maintainer: [DTIsaac](https://github.com/daotakisaac) -* Hardware Supported: ATmega32U4 + AdafruitBLE SPI +* Hardware Supported: ATmega32U4 + Bluefruit LE SPI Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/dtisaac/dosa40rgb/rules.mk b/keyboards/dtisaac/dosa40rgb/rules.mk index 91d3c94ba5d..caecba365e4 100644 --- a/keyboards/dtisaac/dosa40rgb/rules.mk +++ b/keyboards/dtisaac/dosa40rgb/rules.mk @@ -17,7 +17,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes # Enable Bluetooth -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 diff --git a/keyboards/handwired/42/rules.mk b/keyboards/handwired/42/rules.mk index 5742e84bf57..655ce00befd 100644 --- a/keyboards/handwired/42/rules.mk +++ b/keyboards/handwired/42/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/bdn9_ble/rules.mk b/keyboards/handwired/bdn9_ble/rules.mk index e5abbcfb889..a3082cf3642 100644 --- a/keyboards/handwired/bdn9_ble/rules.mk +++ b/keyboards/handwired/bdn9_ble/rules.mk @@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = no BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/fruity60/rules.mk b/keyboards/handwired/fruity60/rules.mk index 74628e3e6fd..c84f68f0bf0 100644 --- a/keyboards/handwired/fruity60/rules.mk +++ b/keyboards/handwired/fruity60/rules.mk @@ -20,6 +20,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = 60_tsangan_hhkb diff --git a/keyboards/handwired/prkl30/feather/rules.mk b/keyboards/handwired/prkl30/feather/rules.mk index f83173fa0ba..7578dcef743 100644 --- a/keyboards/handwired/prkl30/feather/rules.mk +++ b/keyboards/handwired/prkl30/feather/rules.mk @@ -22,4 +22,4 @@ AUDIO_ENABLE = no # This can be enabled if a speaker is connected to t RGBLIGHT_ENABLE = no # This can be enabled if a ws2812 strip is connected to the expansion port. BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/handwired/promethium/keymaps/default/keymap.c b/keyboards/handwired/promethium/keymaps/default/keymap.c index 14a293bb39c..e12142c50ba 100644 --- a/keyboards/handwired/promethium/keymaps/default/keymap.c +++ b/keyboards/handwired/promethium/keymaps/default/keymap.c @@ -137,7 +137,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1261,7 +1261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1285,7 +1285,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 094eb157621..94b505aa2c5 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -140,7 +140,7 @@ enum planck_keycodes { #ifndef FAUXCLICKY_ENABLE FC_TOG, #endif -#ifndef MODULE_ADAFRUIT_BLE +#ifndef BLUETOOTH_BLUEFRUIT_LE OUT_BT, #endif RGBDEMO, @@ -1264,7 +1264,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } void set_output_user(uint8_t output) { -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE switch(output) { case OUTPUT_USB: led_set_output_usb(); @@ -1288,7 +1288,7 @@ void matrix_init_user() { #endif // auto detect output on init -#ifdef MODULE_ADAFRUIT_BLE +#ifdef BLUETOOTH_BLUEFRUIT_LE uint8_t output = auto_detect_output(); if (output == OUTPUT_USB) { set_output(OUTPUT_USB); diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 8eb1680d847..0df6c28e9b0 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c @@ -3,7 +3,7 @@ #include "timer.h" #include "matrix.h" #include "musical_notes.h" -#include "adafruit_ble.h" +#include "bluefruit_le.h" float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); @@ -12,7 +12,7 @@ float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} uint8_t battery_level(void) { - float voltage = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024; + float voltage = bluefruit_le_read_battery_voltage() * 2 * 3.3 / 1024; if (voltage < MIN_VOLTAGE) return 0; if (voltage > MAX_VOLTAGE) return 255; return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index f41e88b0c46..383800ee014 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -23,7 +23,7 @@ PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += ws2812.c SRC += rgbsps.c diff --git a/keyboards/handwired/pterodactyl/rules.mk b/keyboards/handwired/pterodactyl/rules.mk index 629b30e385a..fd63e2ad48d 100644 --- a/keyboards/handwired/pterodactyl/rules.mk +++ b/keyboards/handwired/pterodactyl/rules.mk @@ -22,7 +22,7 @@ AUDIO_ENABLE = no # Audio output UNICODE_ENABLE = yes CUSTOM_MATRIX = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += matrix.c QUANTUM_LIB_SRC += i2c_master.c diff --git a/keyboards/handwired/slash/rules.mk b/keyboards/handwired/slash/rules.mk index 275a2eb7ebd..53d114978f8 100644 --- a/keyboards/handwired/slash/rules.mk +++ b/keyboards/handwired/slash/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/latin47ble/rules.mk b/keyboards/latin47ble/rules.mk index 95044a18bd0..015c4547288 100644 --- a/keyboards/latin47ble/rules.mk +++ b/keyboards/latin47ble/rules.mk @@ -20,6 +20,6 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = planck_mit diff --git a/keyboards/latin64ble/rules.mk b/keyboards/latin64ble/rules.mk index 30f105ef490..97717333de7 100644 --- a/keyboards/latin64ble/rules.mk +++ b/keyboards/latin64ble/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/latinpadble/rules.mk b/keyboards/latinpadble/rules.mk index aac9dde15fa..06816c2ef8c 100644 --- a/keyboards/latinpadble/rules.mk +++ b/keyboards/latinpadble/rules.mk @@ -21,7 +21,7 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE OLED_ENABLE = yes OLED_DRIVER = SSD1306 ENCODER_ENABLE = yes diff --git a/keyboards/meira/featherble/rules.mk b/keyboards/meira/featherble/rules.mk index d3e985e8c23..01f1af1ae8a 100644 --- a/keyboards/meira/featherble/rules.mk +++ b/keyboards/meira/featherble/rules.mk @@ -2,4 +2,4 @@ F_CPU = 8000000 BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/keyboards/nek_type_a/rules.mk b/keyboards/nek_type_a/rules.mk index ea79c962dae..0a8adccb52e 100644 --- a/keyboards/nek_type_a/rules.mk +++ b/keyboards/nek_type_a/rules.mk @@ -22,6 +22,6 @@ AUDIO_ENABLE = no # Audio output CUSTOM_MATRIX = yes DEBUG_ENABLE = yes BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE SRC += matrix.c mcp23017.c diff --git a/keyboards/spaceman/pancake/rev1/feather/rules.mk b/keyboards/spaceman/pancake/rev1/feather/rules.mk index 65304227343..c213c70872b 100644 --- a/keyboards/spaceman/pancake/rev1/feather/rules.mk +++ b/keyboards/spaceman/pancake/rev1/feather/rules.mk @@ -20,7 +20,7 @@ BACKLIGHT_ENABLE = no # Custom backlighting code is used, so this should not b AUDIO_ENABLE = no # This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below RGBLIGHT_ENABLE = no # This can be enabled if a ws2812 strip is connected to the expansion port. BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE LAYOUTS = ortho_4x12 planck_mit diff --git a/keyboards/tokyokeyboard/alix40/rules.mk b/keyboards/tokyokeyboard/alix40/rules.mk index f9e5e2485a3..358de97c5a3 100644 --- a/keyboards/tokyokeyboard/alix40/rules.mk +++ b/keyboards/tokyokeyboard/alix40/rules.mk @@ -20,4 +20,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output BLUETOOTH_ENABLE = yes -BLUETOOTH_DRIVER = AdafruitBLE +BLUETOOTH_DRIVER = BluefruitLE diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index b9c2616058d..3943f8c92b5 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -67,9 +67,9 @@ extern keymap_config_t keymap_config; #ifdef BLUETOOTH_ENABLE # include "outputselect.h" -# ifdef MODULE_ADAFRUIT_BLE -# include "adafruit_ble.h" -# elif MODULE_RN42 +# ifdef BLUETOOTH_BLUEFRUIT_LE +# include "bluefruit_le.h" +# elif BLUETOOTH_RN42 # include "rn42.h" # endif #endif @@ -645,9 +645,9 @@ static void send_keyboard(report_keyboard_t *report) { #ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); -# elif MODULE_RN42 +# ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_send_keys(report->mods, report->keys, sizeof(report->keys)); +# elif BLUETOOTH_RN42 rn42_send_keyboard(report); # endif return; @@ -691,10 +691,10 @@ static void send_mouse(report_mouse_t *report) { # ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE +# ifdef BLUETOOTH_BLUEFRUIT_LE // FIXME: mouse buttons - adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); -# elif MODULE_RN42 + bluefruit_le_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); +# elif BLUETOOTH_RN42 rn42_send_mouse(report); # endif return; @@ -763,9 +763,9 @@ static void send_consumer(uint16_t data) { #ifdef EXTRAKEY_ENABLE # ifdef BLUETOOTH_ENABLE if (where_to_send() == OUTPUT_BLUETOOTH) { -# ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_send_consumer_key(data); -# elif MODULE_RN42 +# ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_send_consumer_key(data); +# elif BLUETOOTH_RN42 rn42_send_consumer(data); # endif return; @@ -1013,7 +1013,7 @@ void protocol_pre_init(void) { setup_usb(); sei(); -#if defined(MODULE_RN42) +#if defined(BLUETOOTH_RN42) rn42_init(); #endif @@ -1066,8 +1066,8 @@ void protocol_post_task(void) { MIDI_Device_USBTask(&USB_MIDI_Interface); #endif -#ifdef MODULE_ADAFRUIT_BLE - adafruit_ble_task(); +#ifdef BLUETOOTH_BLUEFRUIT_LE + bluefruit_le_task(); #endif #ifdef VIRTSER_ENABLE diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 410803512d7..de4decf78a3 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -22,7 +22,7 @@ ifeq ($(strip $(BT)), yes) OPT_DEFS += -DBLUEFRUIT #Adafruit Bluefruit controller settings BLUETOOTH_ENABLE = yes - BLUETOOTH_DRIVER = AdafruitBLE + BLUETOOTH_DRIVER = BluefruitLE F_CPU = 8000000 CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration