MCPcopy Create free account
hub / github.com/SmingHub/Sming / init

Function init

samples/Basic_WebSkeletonApp/app/application.cpp:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41} // namespace
42
43void init()
44{
45 Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
46 Serial.systemDebugOutput(true);
47
48#ifndef ENABLE_FLASHSTRING_MAP
49 spiffs_mount(); // Mount file system, in order to work with files
50#endif
51
52 // Set higher CPU freq & disable wifi sleep
53 // System.setCpuFrequency(CpuCycleClockFast::cpuFrequency());
54 wifi_set_sleep_type(NONE_SLEEP_T);
55
56 activeConfig = loadConfig();
57 if(activeConfig.StaSSID) {
58 WifiStation.enable(true);
59 WifiStation.config(activeConfig.StaSSID, activeConfig.StaPassword);
60 }
61
62 // Attach Wifi events handlers
63 WifiEvents.onStationDisconnect(STADisconnect);
64 WifiEvents.onStationGotIP(STAGotIP);
65
66 System.onReady(startWebServer);
67
68 counterTimer.initializeMs<1000>(counterCallback).start();
69}

Callers

nothing calls this directly

Calls 11

spiffs_mountFunction · 0.85
systemDebugOutputMethod · 0.80
onStationDisconnectMethod · 0.80
onStationGotIPMethod · 0.80
onReadyMethod · 0.80
loadConfigFunction · 0.70
wifi_set_sleep_typeFunction · 0.50
beginMethod · 0.45
enableMethod · 0.45
configMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected