Added RAK4631 e-ink display support
This commit is contained in:
parent
f3558b66fc
commit
055083ffba
17
Bluetooth.h
17
Bluetooth.h
@ -13,12 +13,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#if MCU_VARIANT == MCU_ESP32
|
||||
|
||||
|
||||
#elif MCU_VARIANT == MCU_NRF52
|
||||
#endif
|
||||
|
||||
#if MCU_VARIANT == MCU_ESP32
|
||||
#if HAS_BLUETOOTH == true
|
||||
#include "BluetoothSerial.h"
|
||||
@ -265,6 +259,8 @@ void bt_disable_pairing() {
|
||||
|
||||
void bt_pairing_complete(uint16_t conn_handle, uint8_t auth_status) {
|
||||
if (auth_status == BLE_GAP_SEC_STATUS_SUCCESS) {
|
||||
bt_state = BT_STATE_CONNECTED;
|
||||
cable_state = CABLE_STATE_DISCONNECTED;
|
||||
bt_disable_pairing();
|
||||
} else {
|
||||
bt_ssp_pin = 0;
|
||||
@ -285,11 +281,6 @@ bool bt_passkey_callback(uint16_t conn_handle, uint8_t const passkey[6], bool ma
|
||||
return false;
|
||||
}
|
||||
|
||||
void bt_connect_callback(uint16_t conn_handle) {
|
||||
bt_state = BT_STATE_CONNECTED;
|
||||
cable_state = CABLE_STATE_DISCONNECTED;
|
||||
}
|
||||
|
||||
void bt_disconnect_callback(uint16_t conn_handle, uint8_t reason) {
|
||||
bt_state = BT_STATE_ON;
|
||||
}
|
||||
@ -308,10 +299,9 @@ bool bt_setup_hw() {
|
||||
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
|
||||
Bluefruit.autoConnLed(false);
|
||||
if (Bluefruit.begin()) {
|
||||
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
|
||||
Bluefruit.setTxPower(8); // Check bluefruit.h for supported values
|
||||
Bluefruit.Security.setIOCaps(true, true, false);
|
||||
Bluefruit.Security.setPairPasskeyCallback(bt_passkey_callback);
|
||||
Bluefruit.Periph.setConnectCallback(bt_connect_callback);
|
||||
Bluefruit.Periph.setDisconnectCallback(bt_disconnect_callback);
|
||||
Bluefruit.Security.setPairCompleteCallback(bt_pairing_complete);
|
||||
const ble_gap_addr_t gap_addr = Bluefruit.getAddr();
|
||||
@ -348,7 +338,6 @@ void bt_start() {
|
||||
|
||||
blebas.begin();
|
||||
|
||||
// non-connectable advertising
|
||||
Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
|
||||
Bluefruit.Advertising.addTxPower();
|
||||
|
||||
|
||||
24
Boards.h
24
Boards.h
@ -43,6 +43,10 @@
|
||||
#define BOARD_GENERIC_NRF52 0x50
|
||||
#define BOARD_RAK4631 0x51
|
||||
|
||||
#define OLED 0x01
|
||||
#define EINK_BW 0x02
|
||||
#define EINK_3C 0x03
|
||||
|
||||
#if defined(__AVR_ATmega1284P__)
|
||||
#define PLATFORM PLATFORM_AVR
|
||||
#define MCU_VARIANT MCU_1284P
|
||||
@ -147,6 +151,7 @@
|
||||
|
||||
#elif BOARD_MODEL == BOARD_TBEAM
|
||||
#define HAS_DISPLAY true
|
||||
#define DISPLAY OLED
|
||||
#define HAS_PMU true
|
||||
#define HAS_BLUETOOTH true
|
||||
#define HAS_BLE true
|
||||
@ -184,6 +189,7 @@
|
||||
|
||||
#elif BOARD_MODEL == BOARD_LORA32_V1_0
|
||||
#define HAS_DISPLAY true
|
||||
#define DISPLAY OLED
|
||||
#define HAS_BLUETOOTH true
|
||||
#define HAS_BLE true
|
||||
#define HAS_CONSOLE true
|
||||
@ -201,6 +207,7 @@
|
||||
|
||||
#elif BOARD_MODEL == BOARD_LORA32_V2_0
|
||||
#define HAS_DISPLAY true
|
||||
#define DISPLAY OLED
|
||||
#define HAS_BLUETOOTH true
|
||||