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

Function init

samples/Basic_Ota/app/application.cpp:237–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235} // namespace
236
237void init()
238{
239 Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
240 Serial.systemDebugOutput(true); // Debug output to serial
241
242 // mount spiffs
243 auto partition = ota.getRunningPartition();
244 spiffsPartition = findSpiffsPartition(partition);
245 if(spiffsPartition) {
246 debugf("trying to mount %s @ 0x%08x, length %d", spiffsPartition.name().c_str(), spiffsPartition.address(),
247 spiffsPartition.size());
248 spiffs_mount(spiffsPartition);
249 }
250
251 WifiAccessPoint.enable(false);
252 WifiEvents.onStationGotIP([](IpAddress ip, IpAddress netmask, IpAddress gateway) { showPrompt(); });
253
254 Serial << endl
255 << _F("Currently running ") << partition.name() << " @ 0x" << String(partition.address(), HEX) << '.' << endl
256 << _F("Type 'help' and press enter for instructions.") << endl
257 << endl;
258
259 showPrompt();
260
261 Serial.onDataReceived(serialCallBack);
262}

Callers

nothing calls this directly

Calls 14

findSpiffsPartitionFunction · 0.85
spiffs_mountFunction · 0.85
systemDebugOutputMethod · 0.80
addressMethod · 0.80
onStationGotIPMethod · 0.80
onDataReceivedMethod · 0.80
showPromptFunction · 0.70
StringClass · 0.50
beginMethod · 0.45
getRunningPartitionMethod · 0.45
c_strMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected