diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a7c72a0c41..977570aad8 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -24,5 +24,8 @@ jobs: python-version: '3.x' - name: Build documentation run: | - pip install --user -r doc/requirements.txt - bash ./tests/ci/build_docs.sh + pushd doc/ + python3 -mvenv _venv + ./_venv/bin/pip install -r requirements.txt + env SPHINXBUILD=$(pwd)/_venv/bin/sphinx-build ../tests/ci/build_docs.sh + popd diff --git a/.github/workflows/style-check.yml b/.github/workflows/style-check.yml index 263278e14e..c371c2f252 100644 --- a/.github/workflows/style-check.yml +++ b/.github/workflows/style-check.yml @@ -27,7 +27,7 @@ jobs: run: | sudo apt update python ./tests/test_restyle.py --quiet - bash ./tests/ci/style_check.sh + env CLANG_FORMAT="clang-format-18" bash ./tests/ci/style_check.sh # Validate orthography diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000000..867f3d40de --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,21 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-24.04 + tools: + python: "3.12" + +# Build documentation in the "doc/" directory with Sphinx +sphinx: + configuration: doc/conf.py + +# Install same versions as our local tools +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: doc/requirements.txt diff --git a/cores/esp8266/StackThunk.cpp b/cores/esp8266/StackThunk.cpp index 0d2a8a3541..baa793bdc5 100644 --- a/cores/esp8266/StackThunk.cpp +++ b/cores/esp8266/StackThunk.cpp @@ -27,18 +27,26 @@ #include #include #include -#include "pgmspace.h" + #include "debug.h" #include "StackThunk.h" + +#include #include + #include #include extern "C" { +extern void optimistic_yield(uint32_t); + uint32_t *stack_thunk_ptr = NULL; uint32_t *stack_thunk_top = NULL; + uint32_t *stack_thunk_save = NULL; /* Saved A1 while in BearSSL */ +uint32_t *stack_thunk_yield_save = NULL; /* Saved A1 when yielding from within BearSSL */ + uint32_t stack_thunk_refcnt = 0; /* Largest stack usage seen in the wild at 6120 */ @@ -150,4 +158,37 @@ void stack_thunk_fatal_smashing() __stack_chk_fail(); } +/* Called within bearssl code instead of optimistic_yield(...) */ +void stack_thunk_yield(); +asm( + ".section .text.stack_thunk_yield,\"ax\",@progbits\n\t" + ".literal_position\n\t" + ".align 4\n\t" + ".global stack_thunk_yield\n\t" + ".type stack_thunk_yield, @function\n\t" + "\n" +"stack_thunk_yield:\n\t" +/* Keep the original caller */ + "addi a1, a1, -16\n\t" + "s32i.n a0, a1, 12\n\t" +/* Swap bearssl <-> cont stacks */ + "movi a2, stack_thunk_yield_save\n\t" + "s32i.n a1, a2, 0\n\t" + "movi a2, stack_thunk_save\n\t" + "l32i.n a1, a2, 0\n\t" +/* optimistic_yield(10000) without extra l32r */ + "movi a2, 0x10\n\t" + "addmi a2, a2, 0x2700\n\t" + "call0 optimistic_yield\n\t" +/* Swap bearssl <-> cont stacks, again */ + "movi a2, stack_thunk_yield_save\n\t" + "l32i.n a1, a2, 0\n\t" + "\n" +/* Restore caller */ + "l32i.n a0, a1, 12\n\t" + "addi a1, a1, 16\n\t" + "ret.n\n\t" + ".size stack_thunk_yield, .-stack_thunk_yield\n\t" +); + } diff --git a/cores/esp8266/StackThunk.h b/cores/esp8266/StackThunk.h index e72e0efb9f..350775ec24 100644 --- a/cores/esp8266/StackThunk.h +++ b/cores/esp8266/StackThunk.h @@ -31,6 +31,8 @@ extern "C" { #endif +extern void stack_thunk_yield(void); + extern void stack_thunk_add_ref(); extern void stack_thunk_del_ref(); extern void stack_thunk_repaint(); diff --git a/doc/Makefile b/doc/Makefile index cbfd6af2ab..61d3e40b3c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = -W --keep-going -n +SPHINXOPTS = --fail-on-warning --nitpicky SPHINXBUILD = sphinx-build SPHINXPROJ = ESP8266ArduinoCore SOURCEDIR = . diff --git a/doc/conf.py b/doc/conf.py index 958f3cdbd0..0eef82bc24 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -71,7 +71,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ['_venv', '_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' @@ -162,11 +162,7 @@ # # on_rtd is whether we are on readthedocs.org env_readthedocs = os.environ.get('READTHEDOCS', None) -print(env_readthedocs) if not env_readthedocs: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - - diff --git a/doc/esp8266wifi/station-class.rst b/doc/esp8266wifi/station-class.rst index 30d9cf13f5..06e072adc6 100644 --- a/doc/esp8266wifi/station-class.rst +++ b/doc/esp8266wifi/station-class.rst @@ -473,7 +473,7 @@ Function returns one of the following connection statuses: - ``WL_IDLE_STATUS`` when Wi-Fi is in process of changing between statuses - ``WL_DISCONNECTED`` if module is not configured in station mode -Returned value is type of ``wl_status_t`` defined in `wl\_definitions.h `__ +Returned value is type of ``wl_status_t`` defined in `wl\_definitions.h `__ *Example code:* @@ -511,7 +511,7 @@ Returned value is type of ``wl_status_t`` defined in `wl\_definitions.h `__ as follows: +Particular connection statuses 6 and 3 may be looked up in `wl\_definitions.h `__ as follows: :: diff --git a/doc/requirements.txt b/doc/requirements.txt index 8d90d8f59a..6b2684762d 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,8 @@ # Requirements file for pip # list of Python packages used in documentation build -sphinx -sphinx-rtd-theme -breathe -nbsphinx -docutils<0.17 -testresources -#at the time of writing, requirement is pygments<3,>=2.4.1 -pygments>=2.4.1 +sphinx>=8.1.2,<9.0.0 +sphinx-rtd-theme>=3.0.2,<4.0.0 +breathe>=4.36.0,<5.0.0 +nbsphinx>=0.9.7,<1.0.0 +testresources>=2.0.1,<3.0.0 +pygments>=2.19.1,<3.0.0 diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino index bba7669ad7..9e88e96f1f 100644 --- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino +++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino @@ -153,7 +153,7 @@ public: // Close the file if (_fsUploadFile) { _fsUploadFile.close(); } } // if - } // upload() + } // upload() protected: File _fsUploadFile; diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h index 092fcd5cf2..3fc4dd98da 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS.h @@ -492,8 +492,7 @@ namespace MDNSImplementation { MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) : - p_pMDNSResponder(p_pM), - p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {}; + p_pMDNSResponder(p_pM), p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {}; struct CompareKey { bool operator()(char const* a, char const* b) const diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp index f575983ef7..2cc32b053b 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp @@ -631,8 +631,8 @@ namespace MDNSImplementation } } } // service tiebreak possibility - } // for services - } // ANY answers + } // for services + } // ANY answers } else { @@ -955,7 +955,7 @@ namespace MDNSImplementation } pRRAnswer = pRRAnswer->m_pNext; // Next collected answer - } // while (answers) + } // while (answers) } while ((bFoundNewKeyAnswer) && (bResult)); } // else: No answers provided DEBUG_EX_ERR(if (!bResult) { @@ -1110,7 +1110,7 @@ namespace MDNSImplementation } pServiceQuery = pServiceQuery->m_pNext; } // while(service query) - } // else: No p_pSRVAnswer + } // else: No p_pSRVAnswer DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n")); }); @@ -1173,7 +1173,7 @@ namespace MDNSImplementation } pServiceQuery = pServiceQuery->m_pNext; } // while(service query) - } // else: No p_pTXTAnswer + } // else: No p_pTXTAnswer DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n")); }); @@ -1261,7 +1261,7 @@ namespace MDNSImplementation } pServiceQuery = pServiceQuery->m_pNext; } // while(service query) - } // else: No p_pAAnswer + } // else: No p_pAAnswer DEBUG_EX_ERR(if (!bResult) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n")); }); @@ -1349,7 +1349,7 @@ namespace MDNSImplementation } pServiceQuery = pServiceQuery->m_pNext; } // while(service query) - } // else: No p_pAAAAAnswer + } // else: No p_pAAAAAnswer return bResult; } @@ -2121,7 +2121,7 @@ namespace MDNSImplementation } // IP4 flagged pIP4Address = pNextIP4Address; // Next - } // while + } // while #endif #ifdef MDNS_IP6_SUPPORT // IP6Address (from AAAA) @@ -2185,7 +2185,7 @@ namespace MDNSImplementation } // IP6 flagged pIP6Address = pNextIP6Address; // Next - } // while + } // while #endif pSQAnswer = pNextSQAnswer; } diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp index 977a924394..637f62869a 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp @@ -55,8 +55,7 @@ namespace MDNSImplementation MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/, const char* p_pcValue /*= 0*/, bool p_bTemp /*= false*/) : - m_pNext(0), - m_pcKey(0), m_pcValue(0), m_bTemp(p_bTemp) + m_pNext(0), m_pcKey(0), m_pcValue(0), m_bTemp(p_bTemp) { setKey(p_pcKey); setValue(p_pcValue); @@ -67,8 +66,7 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt( const MDNSResponder::stcMDNSServiceTxt& p_Other) : - m_pNext(0), - m_pcKey(0), m_pcValue(0), m_bTemp(false) + m_pNext(0), m_pcKey(0), m_pcValue(0), m_bTemp(false) { operator=(p_Other); } @@ -614,9 +612,8 @@ namespace MDNSImplementation bool p_bRA /*= false*/, unsigned char p_ucRCode /*= 0*/, uint16_t p_u16QDCount /*= 0*/, uint16_t p_u16ANCount /*= 0*/, uint16_t p_u16NSCount /*= 0*/, uint16_t p_u16ARCount /*= 0*/) : - m_u16ID(p_u16ID), - m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD), - m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode), m_u16QDCount(p_u16QDCount), + m_u16ID(p_u16ID), m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), + m_1bRD(p_bRD), m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode), m_u16QDCount(p_u16QDCount), m_u16ANCount(p_u16ANCount), m_u16NSCount(p_u16NSCount), m_u16ARCount(p_u16ARCount) { } @@ -813,8 +810,7 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes( uint16_t p_u16Type /*= 0*/, uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) : - m_u16Type(p_u16Type), - m_u16Class(p_u16Class) + m_u16Type(p_u16Type), m_u16Class(p_u16Class) { } @@ -910,8 +906,7 @@ namespace MDNSImplementation MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer( enuAnswerType p_AnswerType, const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) : - m_pNext(0), - m_AnswerType(p_AnswerType), m_Header(p_Header), m_u32TTL(p_u32TTL) + m_pNext(0), m_AnswerType(p_AnswerType), m_Header(p_Header), m_u32TTL(p_u32TTL) { // Extract 'cache flush'-bit m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000); @@ -955,8 +950,7 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA( const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) : - stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL), - m_IPAddress(0, 0, 0, 0) + stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL), m_IPAddress(0, 0, 0, 0) { } @@ -1094,8 +1088,8 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV( const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) : - stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL), - m_u16Priority(0), m_u16Weight(0), m_u16Port(0) + stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL), m_u16Priority(0), m_u16Weight(0), + m_u16Port(0) { } @@ -1132,8 +1126,7 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric( const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) : - stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL), - m_u16RDLength(0), m_pu8RDData(0) + stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL), m_u16RDLength(0), m_pu8RDData(0) { } @@ -1212,8 +1205,7 @@ namespace MDNSImplementation MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/, const char* p_pcService /*= 0*/, const char* p_pcProtocol /*= 0*/) : - m_pNext(0), - m_pcName(0), m_bAutoName(false), m_pcService(0), m_pcProtocol(0), m_u16Port(0), + m_pNext(0), m_pcName(0), m_bAutoName(false), m_pcService(0), m_pcProtocol(0), m_u16Port(0), m_u8ReplyMask(0), m_fnTxtCallback(0) { setName(p_pcName); @@ -1538,9 +1530,7 @@ namespace MDNSImplementation MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor */ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address( - IPAddress p_IPAddress, uint32_t p_u32TTL /*= 0*/) : - m_pNext(0), - m_IPAddress(p_IPAddress) + IPAddress p_IPAddress, uint32_t p_u32TTL /*= 0*/) : m_pNext(0), m_IPAddress(p_IPAddress) { m_TTL.set(p_u32TTL); } @@ -2172,9 +2162,8 @@ namespace MDNSImplementation */ MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem( const void* p_pHostnameOrService, bool p_bAdditionalData, uint32_t p_u16Offset) : - m_pNext(0), - m_pHostnameOrService(p_pHostnameOrService), m_bAdditionalData(p_bAdditionalData), - m_u16Offset(p_u16Offset) + m_pNext(0), m_pHostnameOrService(p_pHostnameOrService), + m_bAdditionalData(p_bAdditionalData), m_u16Offset(p_u16Offset) { } diff --git a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino index 50b3206cc7..18f1cad1f9 100644 --- a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino +++ b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino @@ -21,8 +21,7 @@ void setup() { // start I2S at 8 kHz with 24-bits per sample if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) { Serial.println("Failed to initialize I2S!"); - while (1) - ; // do nothing + while (1); // do nothing } } diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino index 689a50d579..e2dcb7b3f6 100644 --- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino +++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino @@ -26,8 +26,7 @@ void setup() { // start I2S at the sample rate with 16-bits per sample if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) { Serial.println("Failed to initialize I2S!"); - while (1) - ; // do nothing + while (1); // do nothing } } diff --git a/libraries/SD/examples/listfilesEnhanced/listfilesEnhanced.ino b/libraries/SD/examples/listfilesEnhanced/listfilesEnhanced.ino new file mode 100644 index 0000000000..5daa3294ad --- /dev/null +++ b/libraries/SD/examples/listfilesEnhanced/listfilesEnhanced.ino @@ -0,0 +1,134 @@ +/* + Listfiles Enhanced + + This example demonstrates how to list files on an SDcard in the following way: + 1) collect all directories + 2) build full path of directories and keep in mind + 3) then print all files with the help of the directorie pathes + + Wiring: + SDcard attached to SPI bus as follows: + - MOSI: pin 11 + - MISO: pin 12 + - CLK : pin 13 + - CS : pin 4 + + Created: + 18. Nov 2024 by Frank Häfele + + This example code is in the public domain. + +*/ +#include +#include +#include + +#define SD_CS_PIN 4 + + +void dir(String path) { + std::vector directories; + collectDirectories(path, directories); + for (auto directory : directories) { + printDirectoryName(directory.c_str(), 1); + File fs = SD.open(directory); + printFilesInDirectory(fs); + Serial.println("\n==============="); + fs.close(); + } +} + +void setup() { + // Open serial communications and wait for port to open: + Serial.begin(115200); + + Serial.print("\n\n==== List Directory ====\n\n"); + listDirectory(); + + Serial.println("done!"); +} + +void loop() { + // nothing happens after setup finishes. +} + +void listDirectory() { + Serial.print("\n\nInitializing SD card..."); + if (!SD.begin(SD_CS_PIN)) { + Serial.println("initialization failed!"); + return; + } + Serial.print("initialization successful.\n"); + Serial.print("List Files:\n"); + dir("/"); +} + + +void printDirectoryName(const char *name, uint8_t level) { + for (uint8_t i = 0; i < level; ++i) { + Serial.print(" "); + } + Serial.println(name); +} + + + +// helper function: combine path +String joinPath(const String &base, const String &name) { + if (base.endsWith("/")) { + return base + name; + } + return base + "/" + name; +} + +// recusive function to collect directory names +void collectDirectories(const String &dirname, std::vector &directories) { + File root = SD.open(dirname); + if (!root || !root.isDirectory()) { + Serial.printf("Error: Cannot open %s\n", dirname.c_str()); + return; + } + directories.push_back(dirname); + + File file = root.openNextFile(); + while (file) { + if (file.isDirectory()) { + String fullPath = joinPath(dirname, file.name()); + collectDirectories(fullPath, directories); + } + file = root.openNextFile(); + } + root.close(); +} + +// print filenames +void printFileName(File file) { + Serial.print("\t"); + Serial.printf("%30s", file.name()); + // files have sizes, directories do not + Serial.print(" - "); + Serial.print(file.size(), DEC); + time_t cr = file.getCreationTime(); + time_t lw = file.getLastWrite(); + struct tm *tmstruct = localtime(&cr); + Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec); + tmstruct = localtime(&lw); + Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec); +} + + +// print files in directories +void printFilesInDirectory(File dir) { + while (true) { + auto file = dir.openNextFile(); + if (!file) { + // no more files + break; + } + if (file.isDirectory()) { + continue; + } else { + printFileName(file); + } + } +} diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino index 691f5be7ca..55e4981df9 100644 --- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino +++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino @@ -55,8 +55,7 @@ void setup() { if (!SD.begin(PIN_SD_CS)) { Serial.println("failed!"); - while (1) - ; // init fail, die here + while (1); // init fail, die here } Serial.println("SD OK!"); @@ -69,8 +68,7 @@ void loop() { bmpFile = SD.open(__Gsbmp_files[i]); if (!bmpFile) { Serial.println("didn't find image"); - while (1) - ; + while (1); } if (!bmpReadHeader(bmpFile)) { diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino index 0a698fb150..8e24600481 100644 --- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino +++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino @@ -99,8 +99,7 @@ void setup() { if (!SD.begin(PIN_SD_CS)) { Serial.println("failed!"); - while (1) - ; // init fail, die here + while (1); // init fail, die here } Serial.println("SD OK!"); @@ -141,8 +140,7 @@ void loop() { if (!bmpFile) { Serial.println("didn't find image"); - while (1) - ; + while (1); } if (!bmpReadHeader(bmpFile)) { @@ -153,8 +151,7 @@ void loop() { bmpdraw(bmpFile, 0, 0, 1); bmpFile.close(); - while (1) - ; + while (1); } /*********************************************/ diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino index 68a6122582..f491ba04e5 100644 --- a/libraries/esp8266/examples/SerialStress/SerialStress.ino +++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino @@ -81,8 +81,7 @@ void setup() { // bind RX and TX USC0(0) |= (1 << UCLBE); - while (Serial.read() == -1) - ; + while (Serial.read() == -1); if (Serial.hasOverrun()) { logger->print("overrun?\n"); } timeout = (start_ms = last_ms = millis()) + TIMEOUT; diff --git a/tests/ci/build_docs.sh b/tests/ci/build_docs.sh index b26852e553..7a5ae2a632 100755 --- a/tests/ci/build_docs.sh +++ b/tests/ci/build_docs.sh @@ -5,4 +5,4 @@ set -ev root=$(git rev-parse --show-toplevel) -env SPHINXOPTS="-W" make -C $root/doc html +make SPHINXOPTS="--fail-on-warning" SPHINXBUILD="${SPHINXBUILD:?sphinx-build}" -C $root/doc html diff --git a/tests/clang-format-core.yaml b/tests/clang-format-core.yaml index 540037d13e..0df633d245 100644 --- a/tests/clang-format-core.yaml +++ b/tests/clang-format-core.yaml @@ -27,3 +27,4 @@ BreakBeforeBraces: Allman IndentWidth: 4 IndentCaseLabels: false ReflowComments: false +SkipMacroDefinitionBody: true diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h index f73de3e471..ba3c9a5c0d 100644 --- a/tests/device/libraries/BSTest/src/BSTest.h +++ b/tests/device/libraries/BSTest/src/BSTest.h @@ -27,8 +27,7 @@ class TestCase public: TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc) : - m_func(func), - m_file(file), m_line(line), m_name(name), m_desc(desc) + m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc) { if (prev) { diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h index 0bc4ee7bd5..4919ae9fc4 100644 --- a/tests/host/common/queue.h +++ b/tests/host/common/queue.h @@ -184,7 +184,7 @@ struct name \ { \ struct type* stqh_first; /* first element */ \ - struct type** stqh_last; /* addr of last next element */ \ + struct type** stqh_last; /* addr of last next element */ \ } #define STAILQ_HEAD_INITIALIZER(head) \ @@ -371,7 +371,7 @@ struct name \ { \ struct type* tqh_first; /* first element */ \ - struct type** tqh_last; /* addr of last next element */ \ + struct type** tqh_last; /* addr of last next element */ \ } #define TAILQ_HEAD_INITIALIZER(head) \ diff --git a/tests/restyle.sh b/tests/restyle.sh index 6e10cab6a2..3bc90e52f0 100755 --- a/tests/restyle.sh +++ b/tests/restyle.sh @@ -8,16 +8,13 @@ test -d ${root}/cores/esp8266 test -d ${root}/libraries # allow `env CLANG_FORMAT=clang-format-N`, or some other version -# default to v15, latest stable version from ubuntu-latest Github Actions image -CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15} +CLANG_FORMAT=${CLANG_FORMAT:-clang-format} cd $root python $root/tests/restyle.py format --clang-format=$CLANG_FORMAT preset --include core --include arduino -if [ $CI = "true" ] ; then - echo foo +if [ "$CI" = "true" ] ; then python $root/tests/restyle.py assert --with-summary --with-errors else - echo bar python $root/tests/restyle.py assert --with-diff fi diff --git a/tools/sdk/include/bearssl/bearssl_git.h b/tools/sdk/include/bearssl/bearssl_git.h index abdd61ac02..37fe2a0d36 100644 --- a/tools/sdk/include/bearssl/bearssl_git.h +++ b/tools/sdk/include/bearssl/bearssl_git.h @@ -1,2 +1,2 @@ // Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile -#define BEARSSL_GIT b024386 +#define BEARSSL_GIT 5166f2b diff --git a/tools/sdk/lib/libbearssl.a b/tools/sdk/lib/libbearssl.a index 70352ab2fc..6b9a77e3f6 100644 Binary files a/tools/sdk/lib/libbearssl.a and b/tools/sdk/lib/libbearssl.a differ diff --git a/tools/sdk/ssl/bearssl b/tools/sdk/ssl/bearssl index b024386d46..5166f2bb03 160000 --- a/tools/sdk/ssl/bearssl +++ b/tools/sdk/ssl/bearssl @@ -1 +1 @@ -Subproject commit b024386d461abd1b7b9be3117e2516b7541f1201 +Subproject commit 5166f2bb03fb03597b0f2c8c7fbcf01616df67c9