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

Function init

samples/FtpServer_Files/app/application.cpp:33–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31} // namespace
32
33void init()
34{
35 Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
36 Serial.systemDebugOutput(true); // Enable debug output to serial
37
38 /*
39 * Mount file system, in order to work with files.
40 *
41 * This sample uses an FWFS (Firmware FileSystem) partition to store
42 * files which don't change. This considerably reduces the amount of data
43 * which might be erased in the event of write failure, etc.
44 */
45
46 // This option mounts just the SPIFFS partition
47 // spiffs_mount();
48
49 // Mount only the FWFS partition
50 // fwfs_mount();
51
52 /*
53 * Use the 'Hybrid' filesystem, with SPIFFS layered over FWFS.
54 *
55 * When a file is opened for writing it is transparently copied to the SPIFFS partition so it can be updated.
56 * Wiping the SPIFFS partition reverts the filesystem to its original state.
57 *
58 * Note that files marked as 'read-only' may not be written in this manner.
59 */
60 hyfs_mount();
61
62 fileSetContent("example.txt", "hello world!");
63 fileSetContent("data.bin", "\1\2\3\4\5");
64
65 WifiStation.enable(true);
66 WifiStation.config(WIFI_SSID, WIFI_PWD);
67 WifiAccessPoint.enable(false);
68
69 // Run our method when station was connected to AP (or not connected)
70 WifiEvents.onStationDisconnect(connectFail);
71 WifiEvents.onStationGotIP(gotIP);
72}

Callers

nothing calls this directly

Calls 8

hyfs_mountFunction · 0.85
fileSetContentFunction · 0.85
systemDebugOutputMethod · 0.80
onStationDisconnectMethod · 0.80
onStationGotIPMethod · 0.80
beginMethod · 0.45
enableMethod · 0.45
configMethod · 0.45

Tested by

no test coverage detected