1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

16 Commits

Author SHA1 Message Date
Maxim Prokhorov
19b7a29720 Migrate from astyle to clang-format (#8464) 2022-03-04 02:28:47 +03:00
Earle F. Philhower, III
60fe7b4ca8
Add code-spell spelling checks to CI (#8067)
Help find and fix silly spelling errors as they are added to the repo.
2021-05-23 08:53:04 -07:00
Earle F. Philhower, III
83166f948b
Deprecate SPIFFS, move examples to LittleFS (#7263)
* Deprecate SPIFFS, move examples to LittleFS

SPIFFS has been a great filesystem, but it has significant problems in
many cases (and it's also pretty slow).  Development seems to have
slowed/stopped on the upstream version, and we're not able to provide
support or fix the known issues with it as-is.

Deprecate SPIFFS variable.

Update all examples to use LittleFS instead of SPIFFS.

Also, minor cleanup on very old examples which has obsolete delays
waiting for the Serial port to come up, or which were stuck at 9600 baud
because of their ancient AVR heritage.

Fixes #7095

* Remove leftover debug code

* Clean up comments in some examples

* Update documentation on SPIFFS deprecation

* Fix host tests to avoid deprecation warnings

* Fix cut-n-paste error

* Restore SpeedTest.ino, adjust to allow custom FSes

Co-authored-by: Develo <deveyes@gmail.com>
2020-05-04 14:22:50 -04:00
vdeconinck
a9cf12fcf0
Make getContentType available for 3rd party usage (#7254)
* Refactored to make getContentType public for 3rd party use.

* Added missing "jpeg" extension

* Use getContentType() from mime namespace.

* Also add .jpeg extension
2020-04-29 23:36:42 -04:00
vdeconinck
668b33ddf1
Revamp of the FSBrowser and SDWebServer examples (#7182)
* Minimal file with a few ESP8266-specific keywords - github issue #3701

* Renamed "SDWebServer" to the more universal "WebFileManager"

* SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
LittleFS based on a #define logic (required adding a second param to open() and
replacing 'FILE_WRITE' by "w") + Added size information to file list and a /status request handler to return filesystem status

* Tree panel width is now proportional to window. Changed icons (lighter and
more neutral), including one for files. Show size of files. Fill
"filename" box upon clicking on a file. Sort files alphabetically.

* Replaced by a lighter version

* Return the filesystem time in the status object
+ Massive cleanup/merge/align with some code from the FSBrowser example
and misc refactorings

* Fixed folder handling

* Replaced the FILESYSTEM #define by a filesystem variable, and introduced FSConfig to prevent FS formating.
Fixed recursive deletion.
Got rid of specific isDir() for SPIFFS.

* Made 8.3 lowercase filenames formating optional (disabled by default).
Refresh only part of the tree when possible.
Selecting a file for upload defaults to the same folder as the last
clicked file.
Removed the Mkdir button on SPIFFS.

* Added 'wait' cursor during asynchronous operations.
Slight refactoring of XMLHttpRequest completion handling

* Removed limitation "files must have an extension, folders may not".
Case insensivity of the extension for the editor and preview.

* Support Filenames without extension, Dirnames with extension.
Added Save/Discard/Help buttons to Editor, discard confirmation on leave, and refresh tree/status upon save.
Removed redundant Ctrl-Z + Ctrl-Shift-Z shortcut declarations.
Small bug fixes.
+ some refactoring

* Fixed tree refresh on delete in all cases by returning the remaining path as response to the delete request.
Refactoring

* Changed FS status in text by a percentage graph, with numbers as tooltip.
Unsupported files on SPIFFS (files at root not sarting with "/", files with double "/", files ending with "/") are now detected and reported in the page.

* Small fix + refactoring

* Restrict filename support check to SPIFFS.

* Implemented Move/Rename.
Added "loading" screen during async operations (dim with spinner and status).
Fixed "discard" feature that kept prompting even after an image was loaded.
Improved refresh of parts of the tree, with recursive listing.
Moved the "path" id attribute to the "li" elements for folders (was already the case for files).
Refactoring and cleanup.

* Fixed broken spinner

* Cosmetic improvements.
Removed non-functional Upload context menu.
Fixed error in response to move requests.
Added minified version.

* Added specific icons for text and image files.
Fixed incompatibilities with SPIFFS.
Fixed a race condition between deletion and reinsertion of nodes when multiple folders are refreshed.
Fixed missing URL decoding for files with special chars (e.g. space char).
Moved info from source code comment to a readme.md file.
Added source PNG to git.
Cleanup.

* Added favicon.ico.

* Renamed project

* Small changes

* Add a note about the ace.js dependency

* Minor changes

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Restyled version

* (dummy edit to retrigger broken CI)

* Using unsigned int for comparison with String.length()

* Return an error when upload fails (e.g. filesystem full)

* Trying to reorder functions to please CI

* Reordered functions to please CI.

* Moved file

* Renamed "SDWebServer" to the more universal "WebFileManager"

* SD was replaced by SDFS, and sketch now works on either SDFS, SPIFFS or
LittleFS based on a #define logic (required adding a second param to open() and
replacing 'FILE_WRITE' by "w") + Added size information to file list and a /status request handler to return filesystem status

* Tree panel width is now proportional to window. Changed icons (lighter and
more neutral), including one for files. Show size of files. Fill
"filename" box upon clicking on a file. Sort files alphabetically.

* Replaced by a lighter version

* Return the filesystem time in the status object
+ Massive cleanup/merge/align with some code from the FSBrowser example
and misc refactorings

* Fixed folder handling

* Replaced the FILESYSTEM #define by a filesystem variable, and introduced FSConfig to prevent FS formating.
Fixed recursive deletion.
Got rid of specific isDir() for SPIFFS.

* Made 8.3 lowercase filenames formating optional (disabled by default).
Refresh only part of the tree when possible.
Selecting a file for upload defaults to the same folder as the last
clicked file.
Removed the Mkdir button on SPIFFS.

* Added 'wait' cursor during asynchronous operations.
Slight refactoring of XMLHttpRequest completion handling

* Removed limitation "files must have an extension, folders may not".
Case insensivity of the extension for the editor and preview.

* Support Filenames without extension, Dirnames with extension.
Added Save/Discard/Help buttons to Editor, discard confirmation on leave, and refresh tree/status upon save.
Removed redundant Ctrl-Z + Ctrl-Shift-Z shortcut declarations.
Small bug fixes.
+ some refactoring

* Fixed tree refresh on delete in all cases by returning the remaining path as response to the delete request.
Refactoring

* Changed FS status in text by a percentage graph, with numbers as tooltip.
Unsupported files on SPIFFS (files at root not sarting with "/", files with double "/", files ending with "/") are now detected and reported in the page.

* Small fix + refactoring

* Restrict filename support check to SPIFFS.

* Implemented Move/Rename.
Added "loading" screen during async operations (dim with spinner and status).
Fixed "discard" feature that kept prompting even after an image was loaded.
Improved refresh of parts of the tree, with recursive listing.
Moved the "path" id attribute to the "li" elements for folders (was already the case for files).
Refactoring and cleanup.

* Fixed broken spinner

* Cosmetic improvements.
Removed non-functional Upload context menu.
Fixed error in response to move requests.
Added minified version.

* Added specific icons for text and image files.
Fixed incompatibilities with SPIFFS.
Fixed a race condition between deletion and reinsertion of nodes when multiple folders are refreshed.
Fixed missing URL decoding for files with special chars (e.g. space char).
Moved info from source code comment to a readme.md file.
Added source PNG to git.
Cleanup.

* Added favicon.ico.

* Renamed project

* Small changes

* Add a note about the ace.js dependency

* Minor changes

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Define LittleFS by default.
If both uncompressed and gz versions exist, use uncompressed version.
Small fixes.

* Restyled version

* (dummy edit to retrigger broken CI)

* Using unsigned int for comparison with String.length()

* Return an error when upload fails (e.g. filesystem full)

* Trying to reorder functions to please CI

* Reordered functions to please CI.

* Update to use chunked response API

* Removed temp files commited by mistake

* Avoid using args() as requested

* Use html entity for non-breaking space to avoid losing char when minifying

* Script to preprocess index.htm

* (reformated code)

* (comments)

* Preprocessed files

* Fixed dump to create an actual include file

* Optionally embed index.htm in code.
(+ documentation and preprocessing script)

* (reformated)

* If editor cannot be loaded from the web, try a local version, or default
to a text viewer if not present

* (removed a TODO item :-))

* (forgot to reprocess files after last commit)

* (reprocess should be ok this time)

* Return error 500 when upload fails immediately (e.g. filesystem full)

* Use standard <meter> tag for filesystem use

* (updated following changes to index.htm)

* Do not include gzipped version in the data folder by default. Leave it in the extras folder and change readme accordingly (plus some reformatingi of the readme file)

* Gzipped index file not included in data/edit by default. It is now left in the extras folder.
Readme file was updated accordingly (+ some reformating)

* Reduce String clutter by reserving and concatenating elements one by one.

* Use clear() to reset String.

* Avoid comparisons against empty String.

* Use char instead of single-char String where possible.

* Prefer direct logic over inverted.

* Rename returnBlah to replyBlah.

* Renamed h2int to hexDigitToInt

* Renamed getFileError() to checkForUnsupportedPath(), to avoid confusion
with a getter.

* Misc improvements.

* Added comments about mandatory rebuilding gz and h files in case of update
to index.htm.

* Addressed a few comments.

* Improve replies: bad requests vs server error

* (reformated)

* Reduce clutter by reserving String size beforehand.

* Moved most Strings of more than 10 chars to flash.

* Use lib version of urlDecode() instead of a local one, and only call it when required.

* Added a comment about the dangers of recursion on embedded devices.

* Added a more explicit warning in the .h header comment.

* Added a typical set of required files to load ace editor from the ESP.

* (reformated)

* More explicit warning at the beginning of the .h version.

Co-authored-by: david gauchard <gauchard@laas.fr>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Co-authored-by: Develo <deveyes@gmail.com>
2020-04-29 12:03:24 -04:00
david gauchard
d600cc7fa6
Expose webserver's chunk api (#7134)
* expose hidden WebServer's chunked API
2020-04-06 20:49:34 -04:00
Dirk Mueller
698ffc3498 Various String handling cleanups (#6945)
Use the proper api (::clear(), isEmpty()) instead of doing
comparisons/assignments of empty strings. Also fix mixture
of tabs and spaces in the source code.
2019-12-26 17:03:18 -03:00
david gauchard
fc77f2e89c
littlefs: fixes for mock/emulation, use in FSBrowser example (#6211)
* littlefs: fixes for mock/emulation, use in FSBrowser example
* emulation: makefile: integrate arch size into object file names
2019-06-20 23:34:27 +02:00
david gauchard
6bd26a3b4a
host emulation: improve udp, persistent spiffs (#5605) 2019-01-15 22:56:54 +01:00
Develo
e9d052c621
WIP - Update ArduinoOTA and examples with MDNS.update() calls (#5494)
* ArduinoOTA: allow use without MDNS, add MDNS.update() in handle()

* Update examples with MDNS.update() in loop

* Update CaptivePortalAdvanced.ino

Fix typo

* Update CaptivePortalAdvanced.ino

astyle

* Update Arduino_Wifi_AVRISP.ino

astyle
2018-12-14 03:29:32 -03:00
david gauchard
92373a9837 Deprecate axTLS, update examples (#5366)
* update examples

* fix serial<->tcp example, use STASSID instead of SSID (name collision)

* fix HTTPSRequest.ino

* update AxTLS HTTPS examples, update AxTLS API to deprecated

* fixes

* fixes + fix astyle (no preproc directives) + restyling script

* fix HTTPClient library

* fixes

* common.sh: do not reload arduino when already present (for locally CI testing)

* common.sh: do not reload ArduinoJson when already present (for locally CI testing)

* fix

* fix

* fix deprecated example

* fix WiFiHTTPSServer.ino

* reduce footprint

* wipfix

* fix led builtin

* fix example

* finished updating APSSID on all examples

* style

* restyle examples

* helper to run CI test locally

* local CI runner more verbose

* +const

* deprecation deprecation

* deprecation

* Update NTPClient.ino

const char[] => const char *

* Update interactive.ino

const char[] => const char *
2018-11-29 20:49:27 -08:00
Ivan Grokhotkov
61cd8d8385 examples: format all .ino files
This formats all the example source files using Arduino style rules.
2018-03-08 14:32:06 +08:00
Earle F. Philhower, III
f9ac524b13
Add -Werror to acceptance builds for C and CPP (#4369)
Use platform.local.txt to add -Werror to GCC for the build of all
code.  Any warnings on a submitted patch will cause an error.

Several examples and libraries had warnings/errors (missing returns
on functions, types, etc.).  Clean those up with this commit as well.
2018-02-17 18:47:10 -08:00
James Stanley
2abbc36da4 Put WiFi into station mode in examples (#3731) 2017-10-22 13:53:01 +08:00
Me No Dev
0063d80c74 "Fix" sketches and libs to use the new upload api 2015-11-19 23:20:03 +02:00
Me No Dev
4c078799ca Add SPIFFS WebServer Example 2015-10-21 14:09:55 +03:00