mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-08-05 21:04:29 -04:00
Merge pull request #1 from TheBeadster/codex/fix-narrowing-conversion-and-undefined-reference-errors
Fix header guard issues and add Bluetooth globals
This commit is contained in:
commit
034bde2308
3 changed files with 26 additions and 7 deletions
11
Bluetooth.cpp
Normal file
11
Bluetooth.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "Bluetooth.h"
|
||||
|
||||
#if MCU_VARIANT == MCU_NRF52
|
||||
bool SerialBT_init = false;
|
||||
#endif
|
||||
|
||||
uint32_t bt_pairing_started = 0;
|
||||
uint8_t dev_bt_mac[BT_DEV_ADDR_LEN];
|
||||
char bt_da[BT_DEV_ADDR_LEN];
|
||||
char bt_dh[BT_DEV_HASH_LEN];
|
||||
char bt_devname[11];
|
14
Bluetooth.h
14
Bluetooth.h
|
@ -10,6 +10,8 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
#pragma once
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
@ -33,19 +35,19 @@
|
|||
BLEUart SerialBT(BLE_RX_BUF);
|
||||
BLEDis bledis;
|
||||
BLEBas blebas;
|
||||
bool SerialBT_init = false;
|
||||
extern bool SerialBT_init;
|
||||
#endif
|
||||
|
||||
#define BT_PAIRING_TIMEOUT 35000
|
||||
#define BLE_FLUSH_TIMEOUT 20
|
||||
uint32_t bt_pairing_started = 0;
|
||||
extern uint32_t bt_pairing_started;
|
||||
|
||||
#define BT_DEV_ADDR_LEN 6
|
||||
#define BT_DEV_HASH_LEN 16
|
||||
uint8_t dev_bt_mac[BT_DEV_ADDR_LEN];
|
||||
char bt_da[BT_DEV_ADDR_LEN];
|
||||
char bt_dh[BT_DEV_HASH_LEN];
|
||||
char bt_devname[11];
|
||||
extern uint8_t dev_bt_mac[BT_DEV_ADDR_LEN];
|
||||
extern char bt_da[BT_DEV_ADDR_LEN];
|
||||
extern char bt_dh[BT_DEV_HASH_LEN];
|
||||
extern char bt_devname[11];
|
||||
|
||||
#if MCU_VARIANT == MCU_ESP32
|
||||
#if HAS_BLUETOOTH == true
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Adafruit_GFX.h>
|
||||
|
||||
#define DISP_W 128
|
||||
|
@ -1070,7 +1072,11 @@ void update_disp_area() {
|
|||
void display_recondition() {
|
||||
#if DISPLAY == OLED
|
||||
for (uint8_t iy = 0; iy < disp_area.height(); iy++) {
|
||||
unsigned char rand_seg [] = {random(0xFF),random(0xFF),random(0xFF),random(0xFF),random(0xFF),random(0xFF),random(0xFF),random(0xFF)};
|
||||
uint8_t rand_seg[] = {
|
||||
static_cast<uint8_t>(random(256)), static_cast<uint8_t>(random(256)),
|
||||
static_cast<uint8_t>(random(256)), static_cast<uint8_t>(random(256)),
|
||||
static_cast<uint8_t>(random(256)), static_cast<uint8_t>(random(256)),
|
||||
static_cast<uint8_t>(random(256)), static_cast<uint8_t>(random(256))};
|
||||
stat_area.drawBitmap(0, iy, rand_seg, 64, 1, DISPLAY_WHITE, DISPLAY_BLACK);
|
||||
disp_area.drawBitmap(0, iy, rand_seg, 64, 1, DISPLAY_WHITE, DISPLAY_BLACK);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue