firmware/src/main.h

57 lines
1.5 KiB
C
Raw Normal View History

#pragma once
#include <map>
#include "GPSStatus.h"
#include "NodeStatus.h"
2020-10-10 01:57:57 +00:00
#include "PowerStatus.h"
#include "graphics/Screen.h"
#include "mesh/generated/telemetry.pb.h"
2022-10-13 11:01:24 +00:00
#ifndef ARCH_PORTDUINO
#include <SparkFun_ATECCX08a_Arduino_Library.h>
2022-10-13 11:01:24 +00:00
#endif
extern uint8_t screen_found;
extern uint8_t screen_model;
extern uint8_t cardkb_found;
2022-05-09 18:12:49 +00:00
extern uint8_t kb_model;
extern uint8_t rtc_found;
extern uint8_t keystore_found;
extern bool rIf_wide_lora;
extern bool eink_found;
extern bool pmu_found;
extern bool isCharging;
extern bool isUSBPowered;
2022-10-13 11:01:24 +00:00
#ifndef ARCH_PORTDUINO
extern ATECCX08A atecc;
2022-10-13 11:01:24 +00:00
#endif
extern uint8_t nodeTelemetrySensorsMap[TelemetrySensorType_QMI8658+1];
2022-10-01 10:02:29 +00:00
extern int TCPPort; // set by Portduino
// Global Screen singleton.
2020-10-10 01:57:57 +00:00
extern graphics::Screen *screen;
// extern Observable<meshtastic::PowerStatus> newPowerStatus; //TODO: move this to main-esp32.cpp somehow or a helper class
2020-10-10 01:57:57 +00:00
// extern meshtastic::PowerStatus *powerStatus;
// extern meshtastic::GPSStatus *gpsStatus;
// extern meshtastic::NodeStatusHandler *nodeStatusHandler;
// Return a human readable string of the form "Meshtastic_ab13"
const char *getDeviceName();
2020-04-23 23:55:25 +00:00
extern uint32_t timeLastPowered;
2021-03-27 02:19:59 +00:00
extern uint32_t rebootAtMsec;
extern uint32_t shutdownAtMsec;
2021-03-27 02:19:59 +00:00
extern uint32_t serialSinceMsec;
// If a thread does something that might need for it to be rescheduled ASAP it can set this flag
// This will supress the current delay and instead try to run ASAP.
extern bool runASAP;
void nrf52Setup(), esp32Setup(), nrf52Loop(), esp32Loop(), clearBonds();