mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-24 03:31:14 +00:00
add beginnings of mesh radio
This commit is contained in:
15
src/main.ino
15
src/main.ino
@@ -26,6 +26,7 @@
|
||||
#include <TinyGPS++.h>
|
||||
#include <Wire.h>
|
||||
#include "BluetoothUtil.h"
|
||||
#include "MeshRadio.h"
|
||||
|
||||
#ifdef T_BEAM_V10
|
||||
#include "axp20x.h"
|
||||
@@ -39,14 +40,6 @@ bool axp192_found = false;
|
||||
|
||||
bool packetSent, packetQueued;
|
||||
|
||||
#if defined(PAYLOAD_USE_FULL)
|
||||
// includes number of satellites and accuracy
|
||||
static uint8_t txBuffer[10];
|
||||
#elif defined(PAYLOAD_USE_CAYENNE)
|
||||
// CAYENNE DF
|
||||
static uint8_t txBuffer[11] = {0x03, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
#endif
|
||||
|
||||
// deep sleep support
|
||||
RTC_DATA_ATTR int bootCount = 0;
|
||||
esp_sleep_source_t wakeCause; // the reason we booted this time
|
||||
@@ -63,7 +56,8 @@ void doDeepSleep(uint64_t msecToWake)
|
||||
// esp_wifi_stop();
|
||||
|
||||
screen_off(); // datasheet says this will draw only 10ua
|
||||
LMIC_shutdown(); // cleanly shutdown the radio
|
||||
|
||||
// FIXME, shutdown radio headinterups before powering off device
|
||||
|
||||
if(axp192_found) {
|
||||
// turn on after initial testing with real hardware
|
||||
@@ -271,11 +265,14 @@ void setup() {
|
||||
}
|
||||
|
||||
initBLE("KHBT Test"); // FIXME, use a real name based on the macaddr
|
||||
|
||||
mesh_init();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
gps_loop();
|
||||
screen_loop();
|
||||
mesh_loop();
|
||||
loopBLE();
|
||||
|
||||
if(packetSent) {
|
||||
|
||||
Reference in New Issue
Block a user