-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (36 loc) · 1.14 KB
/
main.cpp
File metadata and controls
48 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <Arduino.h>
#include <Terminal/Terminal.h>
#include <Utils/BootMessages.h>
#include <FileSystem/FileSystem.h>
Terminal *terminalFrame;
void setup()
{
Serial.begin(250000);
delay(300);
BootMessages::PrintBanner();
BootMessages::PrintInfo("Espnix version 1.0 booting...");
BootMessages::PrintInfo("Platform: ESP32");
BootMessages::PrintInfo("Initializing hardware");
BootMessages::PrintOK("CPU frequency: " + std::to_string(getCpuFrequencyMhz()) + " MHz");
BootMessages::PrintOK("Free heap: " + std::to_string(ESP.getFreeHeap()) + " bytes");
FileSystem *fileSystem = FileSystem::GetInstance();
fileSystem->InitializeInitramfs();
bool sdMounted = fileSystem->MountSDCard();
if (sdMounted)
{
fileSystem->LoadFromSD();
}
if (fileSystem->inInitramfs)
{
BootMessages::PrintWarn("Running in initramfs mode - changes will not persist!");
}
else
{
BootMessages::PrintOK("Persistent storage available on SD card");
}
terminalFrame = new Terminal(250000, 1);
}
void loop()
{
terminalFrame->Read();
}