mirror of
https://github.com/liberatedsystems/RNode_Firmware_CE.git
synced 2025-08-06 05:14:35 -04:00
Add include guards and extern declarations
This commit is contained in:
parent
2a4d6c7a7f
commit
558ffd3a6f
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
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
@ -33,19 +35,19 @@
|
||||||
BLEUart SerialBT(BLE_RX_BUF);
|
BLEUart SerialBT(BLE_RX_BUF);
|
||||||
BLEDis bledis;
|
BLEDis bledis;
|
||||||
BLEBas blebas;
|
BLEBas blebas;
|
||||||
bool SerialBT_init = false;
|
extern bool SerialBT_init;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BT_PAIRING_TIMEOUT 35000
|
#define BT_PAIRING_TIMEOUT 35000
|
||||||
#define BLE_FLUSH_TIMEOUT 20
|
#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_ADDR_LEN 6
|
||||||
#define BT_DEV_HASH_LEN 16
|
#define BT_DEV_HASH_LEN 16
|
||||||
uint8_t dev_bt_mac[BT_DEV_ADDR_LEN];
|
extern uint8_t dev_bt_mac[BT_DEV_ADDR_LEN];
|
||||||
char bt_da[BT_DEV_ADDR_LEN];
|
extern char bt_da[BT_DEV_ADDR_LEN];
|
||||||
char bt_dh[BT_DEV_HASH_LEN];
|
extern char bt_dh[BT_DEV_HASH_LEN];
|
||||||
char bt_devname[11];
|
extern char bt_devname[11];
|
||||||
|
|
||||||
#if MCU_VARIANT == MCU_ESP32
|
#if MCU_VARIANT == MCU_ESP32
|
||||||
#if HAS_BLUETOOTH == true
|
#if HAS_BLUETOOTH == true
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <Adafruit_GFX.h>
|
#include <Adafruit_GFX.h>
|
||||||
|
|
||||||
#define DISP_W 128
|
#define DISP_W 128
|
||||||
|
@ -1070,7 +1072,11 @@ void update_disp_area() {
|
||||||
void display_recondition() {
|
void display_recondition() {
|
||||||
#if DISPLAY == OLED
|
#if DISPLAY == OLED
|
||||||
for (uint8_t iy = 0; iy < disp_area.height(); iy++) {
|
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);
|
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);
|
disp_area.drawBitmap(0, iy, rand_seg, 64, 1, DISPLAY_WHITE, DISPLAY_BLACK);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue