mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-19 09:12:45 +00:00
Get build (kinda, not really) running on a NRF52
Lots of NO_ESP32 to remove later...
This commit is contained in:
26
src/main.cpp
26
src/main.cpp
@@ -29,14 +29,12 @@
|
||||
#include "PowerFSM.h"
|
||||
#include "configuration.h"
|
||||
#include "error.h"
|
||||
#include "esp32/pm.h"
|
||||
#include "esp_pm.h"
|
||||
#include "power.h"
|
||||
#include "rom/rtc.h"
|
||||
// #include "rom/rtc.h"
|
||||
#include "screen.h"
|
||||
#include "sleep.h"
|
||||
#include <Wire.h>
|
||||
#include <driver/rtc_io.h>
|
||||
// #include <driver/rtc_io.h>
|
||||
|
||||
#ifndef NO_ESP32
|
||||
#include "BluetoothUtil.h"
|
||||
@@ -195,10 +193,24 @@ void axp192Init()
|
||||
#endif
|
||||
}
|
||||
|
||||
void getMacAddr(uint8_t *dmac) {
|
||||
#ifndef NO_ESP32
|
||||
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
||||
#else
|
||||
dmac[0] = 0xde;
|
||||
dmac[1] = 0xad;
|
||||
dmac[2] = 0xbe;
|
||||
dmac[3] = 0xef;
|
||||
dmac[4] = 0x01;
|
||||
dmac[5] = 0x02; // FIXME, macaddr stuff needed for NRF52
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *getDeviceName()
|
||||
{
|
||||
uint8_t dmac[6];
|
||||
assert(esp_efuse_mac_get_default(dmac) == ESP_OK);
|
||||
|
||||
getMacAddr(dmac);
|
||||
|
||||
// Meshtastic_ab3c
|
||||
static char name[20];
|
||||
@@ -239,15 +251,17 @@ void setup()
|
||||
#endif
|
||||
#ifdef LED_PIN
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
digitalWrite(LED_PIN, 1); // turn on for now
|
||||
digitalWrite(LED_PIN, 1 ^ LED_INVERTED); // turn on for now
|
||||
#endif
|
||||
|
||||
// Hello
|
||||
DEBUG_MSG("Meshtastic swver=%s, hwver=%s\n", xstr(APP_VERSION), xstr(HW_VERSION));
|
||||
|
||||
#ifndef NO_ESP32
|
||||
// Don't init display if we don't have one or we are waking headless due to a timer event
|
||||
if (wakeCause == ESP_SLEEP_WAKEUP_TIMER)
|
||||
ssd1306_found = false; // forget we even have the hardware
|
||||
#endif
|
||||
|
||||
// Initialize the screen first so we can show the logo while we start up everything else.
|
||||
if (ssd1306_found)
|
||||
|
||||
Reference in New Issue
Block a user