diff --git a/.github/workflows/build_and_publish_docs.yml b/.github/workflows/build_and_publish_docs.yml index 970060304..2e243955c 100644 --- a/.github/workflows/build_and_publish_docs.yml +++ b/.github/workflows/build_and_publish_docs.yml @@ -13,15 +13,16 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: - fetch-depth: 0 + fetch-depth: 1 fetch-tags: true - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: "3.11" + python-version: "3.13" + cache: 'pip' - name: Install Dependencies run: | @@ -33,7 +34,7 @@ jobs: run: | cd doc # ignore if the following command fails - build-docs -t esp32 -l en --project-path ../ --source-dir ./ --doxyfile_dir ./ || true + build-docs -bs html -t esp32 -l en --project-path ../ --source-dir ./ --doxyfile_dir ./ || true mkdir -p ../docs cp -r _build/en/esp32/html/* ../docs/. # go to the latex output diff --git a/components/csv/include/csv.hpp b/components/csv/include/csv.hpp index 44ce6f7f6..322d6f174 100644 --- a/components/csv/include/csv.hpp +++ b/components/csv/include/csv.hpp @@ -1,6 +1,8 @@ #pragma once +#ifndef __gnu_linux__ #define __gnu_linux__ +#endif #include "csv2/reader.hpp" #include "csv2/writer.hpp" diff --git a/components/drv2605/include/drv2605_menu.hpp b/components/drv2605/include/drv2605_menu.hpp index 8f37070b2..3da37c203 100644 --- a/components/drv2605/include/drv2605_menu.hpp +++ b/components/drv2605/include/drv2605_menu.hpp @@ -26,7 +26,7 @@ class Drv2605Menu { using Driver = espp::Drv2605; /// @brief Construct a new Drv2605Menu object. - /// @param i2c A vector of shared pointers to the Drv2605s to interact with. + /// @param drivers A vector of shared pointers to DRV2605 drivers to control. explicit Drv2605Menu(const std::vector> &drivers) : drivers_(drivers) {} diff --git a/components/ftp/include/ftp_client_session.hpp b/components/ftp/include/ftp_client_session.hpp index 4537627ed..1ca006993 100644 --- a/components/ftp/include/ftp_client_session.hpp +++ b/components/ftp/include/ftp_client_session.hpp @@ -165,12 +165,8 @@ class FtpClientSession : public BaseComponent { } /// \brief Receive data from the client. - /// \details This function receives data from the client and stores it in - /// the given buffer. This function uses the data socket and not the - /// control socket, and handles both active and passive mode. - /// \param buffer The buffer to store the data in. - /// \param size The size of the buffer. - /// \return The number of bytes received. + /// \return The data received from the client, or std::nullopt if + /// receiving the data failed. std::optional> receive_data() { if (is_passive_data_connection_) { if (!passive_socket_.is_valid()) { @@ -653,7 +649,7 @@ class FtpClientSession : public BaseComponent { /// take a second parameter. The first parameter is denoted by a single /// Telnet character, as is the second Format parameter for ASCII and /// EBCDIC; the second parameter for local byte is a decimal integer to - /// indicate Bytesize. The parameters are separated by a (Space, + /// indicate Bytesize. The parameters are separated by a \ (Space, /// ASCII code 32). /// \param arguments The arguments to the TYPE command. /// \return True if the command was handled, false otherwise. diff --git a/components/gt911/include/gt911.hpp b/components/gt911/include/gt911.hpp index 336bbadee..1bb49d1a6 100644 --- a/components/gt911/include/gt911.hpp +++ b/components/gt911/include/gt911.hpp @@ -133,6 +133,8 @@ class Gt911 : public BasePeripheral { POINT_5 = 0x816F, }; +#pragma pack(push, 1) + // From Goodix library struct GTInfo { // 0x8140-0x814A @@ -141,7 +143,7 @@ class Gt911 : public BasePeripheral { uint16_t xResolution; uint16_t yResolution; uint8_t vendorId; - } __attribute__((packed)); + }; struct GTPoint { // 0x814F-0x8156, ... 0x8176 (5 points) @@ -150,12 +152,12 @@ class Gt911 : public BasePeripheral { uint16_t y; uint16_t area; uint8_t reserved; - } __attribute__((packed)); + }; struct GTLevelConfig { uint8_t touch; // Threshold of touch grow out of nothing uint8_t leave; // Threshold of touch decrease to nothing - } __attribute__((packed)); + }; struct GTStylusConfig { uint8_t txGain; @@ -163,12 +165,12 @@ class Gt911 : public BasePeripheral { uint8_t dumpShift; GTLevelConfig level; uint8_t control; // Pen mode escape time out period (Unit: Sec) - } __attribute__((packed)); + }; struct GTFreqHoppingConfig { uint16_t hoppingBitFreq; uint8_t hoppingFactor; - } __attribute__((packed)); + }; struct GTKeyConfig { // Key position: 0-255 valid @@ -182,7 +184,7 @@ class Gt911 : public BasePeripheral { uint8_t sens12; uint8_t sens34; uint8_t restrain; - } __attribute__((packed)); + }; struct GTConfig { // start at 0x8047 @@ -250,7 +252,9 @@ class Gt911 : public BasePeripheral { // 0x8091 uint8_t NC_5[2]; GTKeyConfig keys; - } __attribute__((packed)); + }; + +#pragma pack(pop) std::atomic home_button_pressed_{false}; std::atomic num_touch_points_; diff --git a/components/hid-rp/include/gamepad_imu.hpp b/components/hid-rp/include/gamepad_imu.hpp index f9140d9de..de806a46b 100644 --- a/components/hid-rp/include/gamepad_imu.hpp +++ b/components/hid-rp/include/gamepad_imu.hpp @@ -4,6 +4,9 @@ namespace espp { namespace gamepad { + +#pragma pack(push, 1) + /// Accelerometer data struct Accelerometer { union { @@ -11,10 +14,10 @@ struct Accelerometer { std::int16_t X; std::int16_t Y; std::int16_t Z; - } __attribute__((packed)); + }; std::int16_t raw[3]; - } __attribute__((packed)); -} __attribute__((packed)); + }; +}; /// Gyroscope data struct Gyroscope { @@ -23,14 +26,17 @@ struct Gyroscope { std::int16_t X; std::int16_t Y; std::int16_t Z; - } __attribute__((packed)); + }; struct { std::int16_t Pitch; std::int16_t Yaw; std::int16_t Roll; - } __attribute__((packed)); + }; std::int16_t raw[3]; - } __attribute__((packed)); -} __attribute__((packed)); + }; +}; + +#pragma pack(pop) + } // namespace gamepad } // namespace espp diff --git a/components/hid-rp/include/hid-rp-gamepad.hpp b/components/hid-rp/include/hid-rp-gamepad.hpp index 95a897012..fb85b60cb 100644 --- a/components/hid-rp/include/hid-rp-gamepad.hpp +++ b/components/hid-rp/include/hid-rp-gamepad.hpp @@ -124,7 +124,7 @@ class GamepadInputReport : public hid::report::base class PlaystationDualsenseBLESimpleInputReport diff --git a/components/hid-rp/include/hid-rp-switch-pro.hpp b/components/hid-rp/include/hid-rp-switch-pro.hpp index ba4293fe4..c7569139a 100644 --- a/components/hid-rp/include/hid-rp-switch-pro.hpp +++ b/components/hid-rp/include/hid-rp-switch-pro.hpp @@ -71,6 +71,8 @@ class SwitchProGamepadInputReport : public hid::report::base // Only include this header if the legacy API is selected -#if defined(CONFIG_ESPP_I2C_USE_LEGACY_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_LEGACY_API) || defined(_DOXYGEN_) #include #include diff --git a/components/i2c/include/i2c_master.hpp b/components/i2c/include/i2c_master.hpp index 85ac8b371..a63495a75 100644 --- a/components/i2c/include/i2c_master.hpp +++ b/components/i2c/include/i2c_master.hpp @@ -3,7 +3,7 @@ #include // Only include this header if the new API is selected -#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(_DOXYGEN_) #include #include diff --git a/components/i2c/include/i2c_master_device_menu.hpp b/components/i2c/include/i2c_master_device_menu.hpp index e5ce6c164..544c67b4c 100644 --- a/components/i2c/include/i2c_master_device_menu.hpp +++ b/components/i2c/include/i2c_master_device_menu.hpp @@ -2,7 +2,7 @@ #include -#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(_DOXYGEN_) #include #include @@ -164,4 +164,4 @@ template class I2cMasterDeviceMenu { } // namespace espp -#endif // CONFIG_ESPP_I2C_USE_NEW_API || defined(__DOXYGEN__) +#endif // CONFIG_ESPP_I2C_USE_NEW_API || defined(_DOXYGEN_) diff --git a/components/i2c/include/i2c_master_menu.hpp b/components/i2c/include/i2c_master_menu.hpp index 1d56d1ad5..e328caf6d 100644 --- a/components/i2c/include/i2c_master_menu.hpp +++ b/components/i2c/include/i2c_master_menu.hpp @@ -3,7 +3,7 @@ #include // Only include this menu if the new API is selected -#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(_DOXYGEN_) #include #include @@ -200,4 +200,4 @@ class I2cMasterMenu { } // namespace espp -#endif // CONFIG_ESPP_I2C_USE_NEW_API || defined(__DOXYGEN__) +#endif // CONFIG_ESPP_I2C_USE_NEW_API || defined(_DOXYGEN_) diff --git a/components/i2c/include/i2c_menu.hpp b/components/i2c/include/i2c_menu.hpp index 92683e501..45c05f786 100644 --- a/components/i2c/include/i2c_menu.hpp +++ b/components/i2c/include/i2c_menu.hpp @@ -3,7 +3,7 @@ #include // Only include this menu if the legacy API is selected -#if defined(CONFIG_ESPP_I2C_USE_LEGACY_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_LEGACY_API) || defined(_DOXYGEN_) #include #include diff --git a/components/i2c/include/i2c_slave.hpp b/components/i2c/include/i2c_slave.hpp index e83bab2db..212170feb 100644 --- a/components/i2c/include/i2c_slave.hpp +++ b/components/i2c/include/i2c_slave.hpp @@ -29,8 +29,7 @@ namespace espp { /// This class is a wrapper around the ESP-IDF I2C slave device API. /// It provides thread-safe, modern C++ access to I2C slave device operations. /// -/// \section i2c_slave_device_ex1 Example -/// \snippet i2c_example.cpp NEW SLAVE API +/// @note There is no example for this yet as this code is untested. /// /// Usage: /// - Construct with a config diff --git a/components/i2c/include/i2c_slave_menu.hpp b/components/i2c/include/i2c_slave_menu.hpp index bac91ae96..1e51c3783 100644 --- a/components/i2c/include/i2c_slave_menu.hpp +++ b/components/i2c/include/i2c_slave_menu.hpp @@ -3,7 +3,7 @@ #include // Only include this menu if the new API is selected -#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(__DOXYGEN__) +#if defined(CONFIG_ESPP_I2C_USE_NEW_API) || defined(_DOXYGEN_) #include #include diff --git a/components/icm20948/include/icm20948.hpp b/components/icm20948/include/icm20948.hpp index 15055089f..0ce75d785 100644 --- a/components/icm20948/include/icm20948.hpp +++ b/components/icm20948/include/icm20948.hpp @@ -741,6 +741,7 @@ class Icm20948 : public espp::BasePeripheral { RESET_CMD = 0x0E, UPDATE_CMD = 0x0F, // 0x10..0x12 reserved - FLAG_CLR = 0x13, // bit1 POR_CLR, bit2 TSD_CLR + FLAG_CLR = 0x13, // bit0 POR_CLR, bit1 TSD_CLR OUT0_DC = 0x14, OUT1_DC = 0x15, OUT2_DC = 0x16, diff --git a/components/lsm6dso/include/lsm6dso.hpp b/components/lsm6dso/include/lsm6dso.hpp index fa2d2d940..cf79b4067 100644 --- a/components/lsm6dso/include/lsm6dso.hpp +++ b/components/lsm6dso/include/lsm6dso.hpp @@ -98,14 +98,14 @@ class Lsm6dso : public BasePeripheral class RangeMapper { /** * @brief Unmap a value \p v from the configured output range (centered, * default [-1,1]) back into the input distribution. - * @param T&v Value from the centered output distribution. + * @param v Value from the centered output distribution. * @return Value within the input distribution. */ T unmap(const T &v) const { diff --git a/components/monitor/include/heap_monitor.hpp b/components/monitor/include/heap_monitor.hpp index ea1af8894..c59f14ec9 100644 --- a/components/monitor/include/heap_monitor.hpp +++ b/components/monitor/include/heap_monitor.hpp @@ -16,7 +16,7 @@ namespace espp { /// name for the monitor. /// /// \section heap_monitor_ex1 Heap Monitor Example -/// \snippet monitor_example.cpp HeapMonitor Example +/// \snippet monitor_example.cpp HeapMonitor example class HeapMonitor : public BaseComponent { public: /// Info about a heap region diff --git a/components/mt6701/include/mt6701.hpp b/components/mt6701/include/mt6701.hpp index cdb31118d..d448b3c0b 100644 --- a/components/mt6701/include/mt6701.hpp +++ b/components/mt6701/include/mt6701.hpp @@ -305,11 +305,15 @@ class Mt6701 : public BasePeripheral } protected: +#pragma pack(push, 1) + struct MagneticFieldStatus { uint8_t magnetic_field_strength : 2; uint8_t push_button : 1; uint8_t tracking_status : 1; - } __attribute__((packed)); + }; + +#pragma pack(pop) void read(std::error_code &ec) requires(Interface == Mt6701Interface::I2C) { std::lock_guard lock(base_mutex_); diff --git a/components/odrive_ascii/include/odrive_ascii.hpp b/components/odrive_ascii/include/odrive_ascii.hpp index a0f7cd0d1..ff1db2dc6 100644 --- a/components/odrive_ascii/include/odrive_ascii.hpp +++ b/components/odrive_ascii/include/odrive_ascii.hpp @@ -27,14 +27,14 @@ namespace espp { * and send the returned response bytes over their transport (UART/USB/etc.). * * Supported commands (subset of ODrive ASCII): - * - r - * - w - * - p [vel_ff [torque_ff]] - * - v [torque_ff] - * - c - * - t - * - f - * - es + * - r \ + * - w \ \ + * - p \ \ [vel_ff [torque_ff]] + * - v \ \ [torque_ff] + * - c \ \ + * - t \ \ + * - f \ + * - es \ \ * - help * * Applications integrate by registering properties and command callbacks via diff --git a/components/ping/include/ping.hpp b/components/ping/include/ping.hpp index 50cfe22a0..4a85b86da 100644 --- a/components/ping/include/ping.hpp +++ b/components/ping/include/ping.hpp @@ -105,8 +105,8 @@ class Ping : public BaseComponent { bool run(std::error_code &ec); /** - * @brief Set new configuration and run the ping session synchronously. - * @param config New ping configuration and callbacks. + * @brief Set new session configuration and run the ping session synchronously. + * @param session_config New session configuration. * @param ec Error code set on failure. * @return true if session completed successfully, false otherwise. */ @@ -266,7 +266,7 @@ class Ping : public BaseComponent { : ping_(ping) {} /** - * @brief Create a CLI submenu with a `run ` command. + * @brief Create a CLI submenu with a `run \` command. * @param name Menu name (default: "ping") * @param description Menu description (default: "Ping menu") * @return Unique pointer to the menu instance. diff --git a/components/qwiicnes/include/qwiicnes.hpp b/components/qwiicnes/include/qwiicnes.hpp index d88b85022..9482d47a8 100644 --- a/components/qwiicnes/include/qwiicnes.hpp +++ b/components/qwiicnes/include/qwiicnes.hpp @@ -19,9 +19,9 @@ class QwiicNes : public BasePeripheral<> { static constexpr uint8_t DEFAULT_ADDRESS = (0x54); /// @brief The buttons on the NES controller. - /// @deftails The values in this enum match the button's corresponding bit - /// field in the byte returned by read_current_state() and - /// read_button_accumulator(). + /// @details The values in this enum match the button's corresponding bit + /// field in the byte returned by read_current_state() and + /// read_button_accumulator(). enum class Button : int { A, B, SELECT, START, UP, DOWN, LEFT, RIGHT }; /// @brief The state of the buttons on the NES controller. diff --git a/components/rtsp/include/rtsp_server.hpp b/components/rtsp/include/rtsp_server.hpp index abaac785f..5b0c1607b 100644 --- a/components/rtsp/include/rtsp_server.hpp +++ b/components/rtsp/include/rtsp_server.hpp @@ -91,7 +91,7 @@ class RtspServer : public BaseComponent { std::string server_address_; ///< the address of the server int port_; ///< the port of the RTSP server - std::string path_; ///< the path of the RTSP server, e.g. rtsp:://:/ + std::string path_; ///< the path of the RTSP server, e.g. rtsp:://\:\/\ espp::TcpSocket rtsp_socket_; diff --git a/components/serialization/include/serialization.hpp b/components/serialization/include/serialization.hpp index b920842b6..f0aec18a1 100644 --- a/components/serialization/include/serialization.hpp +++ b/components/serialization/include/serialization.hpp @@ -1,6 +1,8 @@ #pragma once +#ifndef __gnu_linux__ #define __gnu_linux__ +#endif #include "alpaca/alpaca.h" diff --git a/components/st25dv/include/st25dv.hpp b/components/st25dv/include/st25dv.hpp index cb90a2251..2fe0ae48e 100644 --- a/components/st25dv/include/st25dv.hpp +++ b/components/st25dv/include/st25dv.hpp @@ -606,8 +606,9 @@ class St25dv : public BasePeripheral { }; } // namespace espp +namespace fmt { // For printing out the IT_STS register using libfmt -template <> struct fmt::formatter { +template <> struct formatter { constexpr auto parse(format_parse_context &ctx) const { return ctx.begin(); } template @@ -621,3 +622,4 @@ template <> struct fmt::formatter { (bool)it_sts.RF_GET_MSG, (bool)it_sts.RF_WRITE); } }; +} // namespace fmt diff --git a/components/tla2528/example/README.md b/components/tla2528/example/README.md index e32475789..f14521eae 100644 --- a/components/tla2528/example/README.md +++ b/components/tla2528/example/README.md @@ -16,7 +16,7 @@ and shown to be working. Averaging / oversampling mode does not currently work. To run this example, you need: * [QtPy ESP32S3](https://www.adafruit.com/product/5426) -* [TLA2528]() +* [TLA2528](https://www.mouser.com/new/texas-instruments/ti-tla2528-adc/?srsltid=AfmBOorOSmJ_xMD_vlC3nIPyFZANhIUgXK-1zWK5L4Bmc__4uJB2mp8E) * [Adafruit Thumb Joystick](https://www.adafruit.com/product/512) * Some dupont wires * QwiiC cable (JST-SH to Dupont) diff --git a/components/tla2528/include/tla2528.hpp b/components/tla2528/include/tla2528.hpp index 1e2dd34fe..6f8b09564 100644 --- a/components/tla2528/include/tla2528.hpp +++ b/components/tla2528/include/tla2528.hpp @@ -959,9 +959,11 @@ class Tla2528 : public BasePeripheral<> { #include "format.hpp" +namespace fmt { + // for allowing easy serialization/printing of the // espp::Tla2528::OverSamplingRatio enum -template <> struct fmt::formatter { +template <> struct formatter { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -993,7 +995,7 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Mode enum -template <> struct fmt::formatter { +template <> struct formatter { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -1013,7 +1015,7 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::DataFormat enum -template <> struct fmt::formatter { +template <> struct formatter { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -1033,7 +1035,7 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Append enum -template <> struct fmt::formatter { +template <> struct formatter { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -1053,7 +1055,7 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of the // espp::Tla2528::Channel enum -template <> struct fmt::formatter { +template <> struct formatter { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -1085,7 +1087,7 @@ template <> struct fmt::formatter { // for allowing easy serialization/printing of a // std::vector object -template <> struct fmt::formatter> { +template <> struct formatter> { template constexpr auto parse(ParseContext &ctx) const { return ctx.begin(); } @@ -1102,3 +1104,4 @@ template <> struct fmt::formatter> { return fmt::format_to(ctx.out(), "{}", result); } }; +} // namespace fmt diff --git a/components/tt21100/include/tt21100.hpp b/components/tt21100/include/tt21100.hpp index bdebe1122..500f43c16 100644 --- a/components/tt21100/include/tt21100.hpp +++ b/components/tt21100/include/tt21100.hpp @@ -157,6 +157,8 @@ class Tt21100 : public BasePeripheral<> { Y_POS = 0x03, }; +#pragma pack(push, 1) + struct TouchRecord { uint8_t : 5; uint8_t touch_type : 3; @@ -168,7 +170,7 @@ class Tt21100 : public BasePeripheral<> { uint8_t pressure; uint16_t major_axis_length; uint8_t orientation; - } __attribute__((packed)); + }; struct TouchReport { uint16_t data_len; @@ -181,7 +183,7 @@ class Tt21100 : public BasePeripheral<> { uint8_t : 3; uint8_t noise_efect : 3; TouchRecord touch_record[0]; - } __attribute__((packed)); + }; struct ButtonRecord { uint16_t length; /*!< Always 14(0x000E) */ @@ -189,7 +191,9 @@ class Tt21100 : public BasePeripheral<> { uint16_t time_stamp; /*!< Number in units of 100 us */ uint8_t btn_val; /*!< Only use bit[0..3] */ uint16_t btn_signal[4]; - } __attribute__((packed)); + }; + +#pragma pack(pop) std::atomic home_button_pressed_{false}; std::atomic num_touch_points_; diff --git a/components/wifi/include/wifi_ap.hpp b/components/wifi/include/wifi_ap.hpp index 36ee8b503..24ed0d4fb 100644 --- a/components/wifi/include/wifi_ap.hpp +++ b/components/wifi/include/wifi_ap.hpp @@ -469,7 +469,8 @@ class WifiAp : public BaseComponent { } // namespace espp // libfmt printing of WifiAp::Station -template <> struct fmt::formatter : fmt::formatter { +namespace fmt { +template <> struct formatter : fmt::formatter { template auto format(const espp::WifiAp::Station &station, FormatContext &ctx) const { return fmt::format_to(ctx.out(), @@ -478,3 +479,4 @@ template <> struct fmt::formatter : fmt::formatter