Skip to content
2 changes: 1 addition & 1 deletion components/adc/include/adc_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct AdcConfig {
adc_unit_t unit; /**< Which adc unit is this channel associated with, e.g. ADC_UNIT_1. */
adc_channel_t channel; /**< The actual channel, e.g. ADC_CHANNEL_2. */
adc_atten_t
attenuation; /**< The attenuation associated with this channel, e.g. ADC_ATTEN_DB_11. */
attenuation; /**< The attenuation associated with this channel, e.g. ADC_ATTEN_DB_12. */
};

static bool operator!=(const AdcConfig &lhs, const AdcConfig &rhs) {
Expand Down
6 changes: 4 additions & 2 deletions components/ads7138/example/main/ads7138_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ using namespace std::chrono_literals;
// change the digital output value by pressing the button on the joystick.
static QueueHandle_t gpio_evt_queue;

// cppcheck-suppress constParameterCallback
static void gpio_isr_handler(void *arg) {
uint32_t gpio_num = (uint32_t)arg;
uint32_t gpio_num = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(arg));
xQueueSendFromISR(gpio_evt_queue, &gpio_num, NULL);
}

Expand Down Expand Up @@ -129,7 +130,8 @@ extern "C" void app_main(void) {

// install gpio isr service
gpio_install_isr_service(0);
gpio_isr_handler_add(ALERT_PIN, gpio_isr_handler, (void *)ALERT_PIN);
gpio_isr_handler_add(ALERT_PIN, gpio_isr_handler,
reinterpret_cast<void *>(static_cast<uintptr_t>(ALERT_PIN)));

// start the gpio task
auto alert_task = espp::Task::make_unique({
Expand Down
2 changes: 1 addition & 1 deletion components/ads7138/include/ads7138.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ class Ads7138 : public BasePeripheral<> {
}

void write_two_(Register reg, uint16_t value, std::error_code &ec) {
write_block_(reg, (uint8_t *)&value, 2, ec);
write_block_(reg, reinterpret_cast<uint8_t *>(&value), 2, ec);
}

void write_block_(Register reg, const uint8_t *data, uint8_t len, std::error_code &ec) {
Expand Down
2 changes: 1 addition & 1 deletion components/bldc_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
idf_component_register(
INCLUDE_DIRS "include"
SRC_DIRS "src"
REQUIRES base_component driver)
REQUIRES base_component driver esp_driver_gpio esp_driver_mcpwm)
14 changes: 13 additions & 1 deletion components/bldc_driver/include/bldc_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

#include "driver/gpio.h"
#include "driver/mcpwm_prelude.h"
#include "esp_idf_version.h"
#ifndef ESP_IDF_VERSION_VAL
#define ESP_IDF_VERSION_VAL(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
#endif
#ifndef ESP_IDF_VERSION
#define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(0, 0, 0)
#endif
#include "soc/soc_caps.h"

#include "base_component.hpp"

Expand Down Expand Up @@ -260,10 +268,12 @@ class BldcDriver : public BaseComponent {
static int GROUP_ID;

void init(const Config &config) {
#if defined(SOC_MCPWM_GROUPS)
if (GROUP_ID >= SOC_MCPWM_GROUPS) {
GROUP_ID = 0;
logger_.error("Exceeded max number of MCPWM groups ({}), resetting to 0", SOC_MCPWM_GROUPS);
}
#endif
configure_enable_gpio();
configure_timer();
configure_operators();
Expand Down Expand Up @@ -324,8 +334,10 @@ class BldcDriver : public BaseComponent {
gpio_fault_config.gpio_num = (gpio_num_t)gpio_fault_;
gpio_fault_config.group_id = GROUP_ID;
gpio_fault_config.flags.active_level = 1; // high level means fault, refer to TMC6300 datasheet
gpio_fault_config.flags.pull_down = true; // internally pull down
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
gpio_fault_config.flags.pull_down = true; // internally pull down
gpio_fault_config.flags.io_loop_back = true; // enable loop back to GPIO input
#endif
ESP_ERROR_CHECK(mcpwm_new_gpio_fault(&gpio_fault_config, &fault_handle_));

logger_.info("Set brake mode on the fault event");
Expand Down
4 changes: 0 additions & 4 deletions components/chsc6x/example/main/chsc6x_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ extern "C" void app_main(void) {
uint8_t num_touch_points = 0;
uint16_t x = 0, y = 0;
chsc6x.get_touch_point(&num_touch_points, &x, &y);
if (ec) {
fmt::print("Could not get touch point\n");
return false;
}
fmt::print("num_touch_points: {}, x: {}, y: {}\n", num_touch_points, x, y);
// NOTE: sleeping in this way allows the sleep to exit early when the
// task is being stopped / destroyed
Expand Down
12 changes: 11 additions & 1 deletion components/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
include($ENV{IDF_PATH}/tools/cmake/version.cmake)

set(cli_requires driver esp_driver_uart esp_driver_usb_serial_jtag vfs logger)

if(IDF_VERSION_MAJOR GREATER_EQUAL 6)
list(APPEND cli_requires esp_stdio esp_usb_cdc_rom_console)
else()
list(APPEND cli_requires esp_vfs_console)
endif()

idf_component_register(
INCLUDE_DIRS "include" "detail/cli/include"
SRC_DIRS "src"
REQUIRES driver esp_driver_uart esp_driver_usb_serial_jtag vfs esp_vfs_console logger)
REQUIRES ${cli_requires})
10 changes: 10 additions & 0 deletions components/cli/include/cli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@

#include "esp_vfs_cdcacm.h"
#include "esp_vfs_dev.h"

#include "esp_idf_version.h"
#ifndef ESP_IDF_VERSION_VAL
#define ESP_IDF_VERSION_VAL(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
#endif
#ifndef ESP_IDF_VERSION
#define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(0, 0, 0)
#endif
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
#include "esp_vfs_usb_serial_jtag.h"
#endif

#include "line_input.hpp"

Expand Down
4 changes: 0 additions & 4 deletions components/cst816/example/main/cst816_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ extern "C" void app_main(void) {
uint8_t num_touch_points = 0;
uint16_t x = 0, y = 0;
cst816.get_touch_point(&num_touch_points, &x, &y);
if (ec) {
fmt::print("Could not get touch point\n");
return false;
}
fmt::print("num_touch_points: {}, x: {}, y: {}\n", num_touch_points, x, y);
// NOTE: sleeping in this way allows the sleep to exit early when the
// task is being stopped / destroyed
Expand Down
3 changes: 2 additions & 1 deletion components/cst816/include/cst816.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class Cst816 : public BasePeripheral<std::uint8_t> {
bool update(std::error_code &ec) {
bool new_data = false;
Data data{};
read_many_from_register((uint8_t)Registers::DATA_START, (uint8_t *)&data, sizeof(data), ec);
read_many_from_register(static_cast<uint8_t>(Registers::DATA_START),
reinterpret_cast<uint8_t *>(&data), sizeof(data), ec);
if (ec)
return false;

Expand Down
2 changes: 1 addition & 1 deletion components/encoder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(
INCLUDE_DIRS "include"
REQUIRES base_component driver)
REQUIRES base_component driver esp_driver_pcnt)
2 changes: 1 addition & 1 deletion components/esp-box/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
idf_component_register(
INCLUDE_DIRS "include"
SRC_DIRS "src"
REQUIRES driver base_component codec display display_drivers i2c input_drivers interrupt gt911 task tt21100 icm42607
REQUIRES driver esp_driver_i2s base_component codec display display_drivers i2c input_drivers interrupt gt911 task tt21100 icm42607
REQUIRED_IDF_TARGETS "esp32s3"
)
2 changes: 0 additions & 2 deletions components/esp-box/example/main/esp_box_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,7 @@ static bool load_audio(size_t &out_size, size_t &out_sample_rate) {

// load the audio data. these are configured in the CMakeLists.txt file

// cppcheck-suppress syntaxError
extern const uint8_t click_wav_start[] asm("_binary_click_wav_start");
// cppcheck-suppress syntaxError
extern const uint8_t click_wav_end[] asm("_binary_click_wav_end");
audio_bytes = std::vector<uint8_t>(click_wav_start, click_wav_end);
// ensure we have at least a wav header
Expand Down
2 changes: 1 addition & 1 deletion components/esp-dsp
Submodule esp-dsp updated 95 files
+4 −0 .codespellrc
+97 −67 .gitlab-ci.yml
+45 −0 .gitlab/ci/pre_commit.yml
+6 −0 .pre-commit-config.yaml
+14 −2 CHANGELOG.md
+6 −0 CMakeLists.txt
+2 −2 applications/azure_board_apps/apps/kalman_filter/main/kalman_filter_demo.cpp
+1 −1 applications/azure_board_apps/graphics/3d_matrix/3d_matrix_src/graphics_support.cpp
+2 −2 applications/azure_board_apps/graphics/3d_matrix/3d_matrix_src/graphics_support.h
+1 −1 applications/azure_board_apps/graphics/img_to_3d_matrix/ImgTo3D.py
+2 −2 applications/m5stack_core_s3/apps/3d_graphics/main/init_display.c
+2 −2 applications/m5stack_core_s3/apps/kalman_filter/main/3d_kalman_demo.cpp
+4 −4 build_all.sh
+1 −1 docs/build_bm_table.py
+6 −0 docs/conf_common.py
+1 −1 docs/en/esp-dsp-benchmarks.rst
+1 −1 docs/en/esp-dsp-examples.rst
+1 −1 docs/esp-dsp-benchmarks_template.rst
+1 −1 docs/requirements.txt
+1 −1 examples/conv2d/README.md
+1 −1 examples/conv2d/main/conv2d_main.c
+2 −2 examples/iir/main/dsps_iir_main.c
+2 −2 examples/kalman/main/ekf_imu13states_main.cpp
+1 −1 examples/matrix/README.md
+1 −1 examples/matrix/main/dspm_matrix_main.cpp
+1 −0 modules/common/include/esp_dsp.h
+1 −1 modules/common/include_sim/esp_attr.h
+1 −1 modules/common/include_sim/esp_err.h
+1 −1 modules/common/include_sim/esp_log.h
+3 −3 modules/dotprod/test/test_dotprod_s16.c
+1 −1 modules/dotprod/test/test_dotprode_f32.c
+15 −15 modules/fft/fixed/dsps_fft2r_sc16_ae32.S
+1 −1 modules/fft/float/dsps_fft2r_fc32_ae32_.S
+1 −1 modules/fft/float/dsps_fft2r_fc32_aes3_.S
+1 −1 modules/fft/float/dsps_fft4r_fc32_ae32_.S
+1 −1 modules/fft/float/dsps_fft4r_fc32_aes3_.S
+1 −1 modules/fft/include/dsps_fft4r.h
+1 −1 modules/fft/test/test_dsps_fft2r_fc32_ae32.c
+1 −1 modules/fft/test/test_dsps_fft2r_fc32_ansi.c
+3 −3 modules/fir/fixed/dsps_fird_init_s16.c
+64 −0 modules/fir/fixed/dsps_firmr_init_s16.c
+54 −0 modules/fir/fixed/dsps_firmr_s16_ansi.c
+89 −66 modules/fir/float/dsps_fird_f32_aes3.S
+1 −1 modules/fir/float/dsps_fird_f32_arp4.S
+41 −0 modules/fir/float/dsps_firmr_f32_ansi.c
+60 −0 modules/fir/float/dsps_firmr_init_f32.c
+120 −13 modules/fir/include/dsps_fir.h
+133 −0 modules/fir/include/dsps_resampler.h
+78 −0 modules/fir/resampler/dsps_resampler_mr.c
+72 −0 modules/fir/resampler/dsps_resampler_ph.c
+1 −1 modules/fir/test/test_dsps_fird_s16_ae32.c
+105 −0 modules/fir/test/test_dsps_firmr_f32_ansi.c
+288 −0 modules/fir/test/test_dsps_firmr_s16_ansi.c
+80 −0 modules/fir/test/test_dsps_resampler_mr_f32.c
+103 −0 modules/fir/test/test_dsps_resampler_ph_f32.c
+6 −6 modules/kalman/ekf/common/ekf.cpp
+4 −1 modules/kalman/ekf/include/ekf.h
+1 −1 modules/kalman/ekf_imu13states/docs/README.md
+1 −1 modules/kalman/ekf_imu13states/ekf_imu13states.cpp
+2 −2 modules/kalman/ekf_imu13states/include/ekf_imu13states.h
+1 −1 modules/math/mulc/include/dsps_mulc.h
+1 −1 modules/matrix/add/test/test_dspm_add_f32_ae32.cpp
+1 −1 modules/matrix/add/test/test_dspm_add_f32_ansi.cpp
+1 −1 modules/matrix/addc/test/test_dspm_addc_f32_ansi.cpp
+3 −1 modules/matrix/include/mat.h
+1 −1 modules/matrix/mat/mat.cpp
+2 −2 modules/matrix/mul/fixed/dspm_mult_s16_ae32.S
+1 −1 modules/matrix/mul/float/dspm_mult_ex_f32_ae32.S
+2 −2 modules/matrix/mul/float/dspm_mult_ex_f32_aes3.S
+1 −1 modules/matrix/mul/float/dspm_mult_f32_ae32.S
+1 −1 modules/matrix/mul/float/dspm_mult_f32_aes3.S
+1 −1 modules/matrix/mul/float/dspm_mult_f32_arp4.S
+1 −0 modules/matrix/mul/include/dspm_mult.h
+3 −3 modules/matrix/mul/test/test_mat_f32.cpp
+4 −4 modules/matrix/mul/test/test_mat_sub_f32.cpp
+2 −2 modules/matrix/mul/test/test_mmult_3x3xx_f32_ae32.c
+1 −1 modules/matrix/mul/test/test_mmult_4x4xx_f32_ae32.c
+2 −2 modules/matrix/mul/test/test_mmult_ex_f32_aexx.cpp
+1 −1 modules/matrix/mul/test/test_mmult_ex_f32_ansi.cpp
+1 −1 modules/matrix/mul/test/test_mmult_f32_ae32.c
+1 −1 modules/matrix/mul/test/test_mmult_f32_ansi.c
+1 −1 modules/matrix/mul/test/test_mmult_s16_ansi.c
+1 −1 modules/matrix/mulc/test/test_dspm_mulc_f32_ansi.cpp
+1 −1 modules/matrix/sub/test/test_dspm_sub_f32_ansi.cpp
+4 −4 modules/support/cplx_gen/dsps_cplx_gen.S
+2 −2 modules/support/cplx_gen/dsps_cplx_gen_init.c
+2 −2 modules/support/include/dsps_cplx_gen.h
+1 −1 modules/support/include/dsps_view.h
+5 −5 modules/support/mem/test/test_dsps_memcpy_memset.c
+1 −1 test/test_dsp.c
+1 −1 test_app/CMakeLists.txt
+1 −0 test_app/main/test_app_main.c
+1 −0 test_app/pytest.ini
+1 −2 test_app/pytest_esp-dsp_unity_tests.py
+5 −2 test_app/sdkconfig.defaults
2 changes: 1 addition & 1 deletion components/esp32-timer-cam/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
idf_component_register(
INCLUDE_DIRS "include"
SRC_DIRS "src"
REQUIRES driver adc base_component bm8563 i2c interrupt led math task
REQUIRES driver esp_driver_i2s esp_driver_spi adc base_component bm8563 i2c interrupt led math task
REQUIRED_IDF_TARGETS "esp32"
)
8 changes: 8 additions & 0 deletions components/file_system/example/main/file_system_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#include <thread>
#include <vector>

#include "esp_idf_version.h"
#ifndef ESP_IDF_VERSION_VAL
#define ESP_IDF_VERSION_VAL(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
#endif
#ifndef ESP_IDF_VERSION
#define ESP_IDF_VERSION ESP_IDF_VERSION_VAL(0, 0, 0)
#endif

#include "logger.hpp"

#include "file_system.hpp"
Expand Down
2 changes: 1 addition & 1 deletion components/format/detail/fmt
Submodule fmt updated 84 files
+4 −0 .clang-tidy
+4 −0 .cmake-format
+1 −0 .github/FUNDING.yml
+1 −1 .github/workflows/cifuzz.yml
+2 −2 .github/workflows/doc.yml
+21 −5 .github/workflows/lint.yml
+35 −11 .github/workflows/linux.yml
+6 −6 .github/workflows/macos.yml
+3 −3 .github/workflows/scorecard.yml
+9 −10 .github/workflows/windows.yml
+2 −0 .gitignore
+350 −292 CMakeLists.txt
+255 −6 ChangeLog.md
+0 −7 LICENSE
+41 −33 README.md
+27 −0 doc/LICENSE-exception
+106 −21 doc/api.md
+1 −0 doc/fmt.css
+21 −3 doc/get-started.md
+1 −1 doc/index.md
+6 −4 doc/syntax.md
+5 −7 include/fmt/args.h
+327 −373 include/fmt/base.h
+34 −120 include/fmt/chrono.h
+19 −19 include/fmt/color.h
+159 −97 include/fmt/compile.h
+6 −4 include/fmt/core.h
+192 −0 include/fmt/fmt-c.h
+766 −740 include/fmt/format-inl.h
+456 −361 include/fmt/format.h
+10 −18 include/fmt/os.h
+2 −2 include/fmt/ostream.h
+61 −41 include/fmt/printf.h
+46 −30 include/fmt/ranges.h
+202 −104 include/fmt/std.h
+74 −66 include/fmt/xchar.h
+42 −0 src/fmt-c.cc
+2 −5 src/fmt.cc
+7 −10 src/format.cc
+29 −26 src/os.cc
+2 −1 support/AndroidManifest.xml
+0 −1 support/bazel/.bazelversion
+0 −22 support/bazel/BUILD.bazel
+0 −7 support/bazel/MODULE.bazel
+0 −28 support/bazel/README.md
+0 −2 support/bazel/WORKSPACE.bazel
+33 −35 support/build.gradle
+6 −2 support/cmake/FindSetEnv.cmake
+19 −17 support/cmake/JoinPaths.cmake
+8 −0 support/gradle.properties
+6 −0 support/gradle/wrapper/gradle-wrapper.properties
+17 −9 support/mkdocs
+267 −148 support/python/mkdocstrings_handlers/cxx/__init__.py
+75 −85 test/CMakeLists.txt
+1 −1 test/args-test.cc
+18 −5 test/base-test.cc
+92 −0 test/c-test.c
+6 −7 test/chrono-test.cc
+9 −0 test/color-test.cc
+132 −71 test/compile-error-test/CMakeLists.txt
+0 −61 test/compile-fp-test.cc
+47 −15 test/compile-test.cc
+25 −21 test/cuda-test/CMakeLists.txt
+5 −7 test/format-impl-test.cc
+151 −133 test/format-test.cc
+7 −5 test/fuzzing/CMakeLists.txt
+2 −2 test/fuzzing/chrono-duration.cc
+1 −1 test/fuzzing/fuzzer-common.h
+0 −1 test/gtest-extra-test.cc
+4 −0 test/gtest-extra.h
+8 −14 test/gtest/CMakeLists.txt
+14 −3 test/mock-allocator.h
+23 −171 test/module-test.cc
+8 −2 test/no-builtin-types-test.cc
+17 −11 test/os-test.cc
+1 −1 test/ostream-test.cc
+2 −2 test/posix-mock-test.cc
+51 −50 test/printf-test.cc
+51 −22 test/ranges-test.cc
+16 −2 test/scan-test.cc
+53 −0 test/scan.h
+111 −8 test/std-test.cc
+0 −11 test/util.h
+42 −6 test/xchar-test.cc
10 changes: 10 additions & 0 deletions components/format/include/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <fmt/std.h>

#if !FMT_USE_INT128
namespace fmt {
inline namespace v12 {
namespace detail {
constexpr auto operator~(const uint128 &value) -> uint128 { return {~value.high(), ~value.low()}; }
} // namespace detail
} // namespace v12
} // namespace fmt
#endif
2 changes: 1 addition & 1 deletion components/ftp/include/ftp_client_session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class FtpClientSession : public BaseComponent {
}

bool parse_ftp_command(std::string_view request, std::string_view &command,
std::string_view &arguments) {
std::string_view &arguments) const {
// parses the command from the FTP client's request. The command is the
// first word in the request. The command is case insensitive.
// The command is followed by a space and then the arguments.
Expand Down
10 changes: 5 additions & 5 deletions components/gfps_service/src/nearby_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ int espp::gfps::ble_gap_event_handler(ble_gap_event *event, void *arg) {
if (pairing_succeeded) {
logger.info("Pairing succeeded with {}", addr.toString());
if (g_bt_interface) {
g_bt_interface->on_paired(uint64_t(addr));
g_bt_interface->on_paired(static_cast<uint64_t>(addr));
}
} else {
logger.error("Pairing failed with {}", addr.toString());
if (g_bt_interface) {
g_bt_interface->on_pairing_failed(uint64_t(addr));
g_bt_interface->on_pairing_failed(static_cast<uint64_t>(addr));
}
}
// set the IO capability of the device (GFPS uses the passkey through a
Expand All @@ -129,7 +129,7 @@ uint64_t nearby_platform_GetBleAddress() {
// explicitly get the random address here, since the GetPublicAddress function
// will call NimBLEDevice::getAddress() which will return the public address
uint64_t address = 0;
auto rc = ble_hs_id_copy_addr(BLE_ADDR_RANDOM, (uint8_t *)&address, nullptr);
auto rc = ble_hs_id_copy_addr(BLE_ADDR_RANDOM, reinterpret_cast<uint8_t *>(&address), nullptr);
if (rc != 0) {
logger.error("Failed to get ble address");
return 0;
Expand Down Expand Up @@ -205,7 +205,7 @@ nearby_platform_status nearby_platform_GattNotify(uint64_t peer_address,
// interval - Advertising interval code.
nearby_platform_status nearby_platform_SetAdvertisement(const uint8_t *payload, size_t length,
nearby_fp_AvertisementInterval interval) {
logger.info("Setting advertisement, interval code: {}", (int)interval);
logger.info("Setting advertisement, interval code: {}", static_cast<int>(interval));

// For information of the contents of the payload, see:
// https://btprodspecificationrefs.blob.core.windows.net/assigned-numbers/Assigned%20Number%20Types/Assigned_Numbers.pdf
Expand Down Expand Up @@ -246,7 +246,7 @@ uint64_t nearby_platform_GetPublicAddress() {
#if CONFIG_BT_NIMBLE_ENABLED
auto address = NimBLEDevice::getAddress();
logger.info("GetPublicAddress: {}", address.toString());
return uint64_t(address);
return static_cast<uint64_t>(address);
#else
return 0;
#endif // CONFIG_BT_NIMBLE_ENABLED
Expand Down
4 changes: 0 additions & 4 deletions components/gt911/example/main/gt911_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ extern "C" void app_main(void) {
uint8_t num_touch_points = 0;
uint16_t x = 0, y = 0;
gt911.get_touch_point(&num_touch_points, &x, &y);
if (ec) {
fmt::print("Could not get touch point\n");
return false;
}
fmt::print("num_touch_points: {}, x: {}, y: {}\n", num_touch_points, x, y);
// NOTE: sleeping in this way allows the sleep to exit early when the
// task is being stopped / destroyed
Expand Down
2 changes: 1 addition & 1 deletion components/gt911/include/gt911.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Gt911 : public BasePeripheral<std::uint16_t> {
if (ec)
return false;
// convert the data pointer to a GTPoint*
const GTPoint *point = (GTPoint *)&data[0];
const auto *point = reinterpret_cast<const GTPoint *>(&data[0]);
x_ = point->x;
y_ = point->y;
logger_.debug("Touch at ({}, {})", x_, y_);
Expand Down
2 changes: 1 addition & 1 deletion components/hid-rp/include/hid-rp-gamepad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class GamepadInputReport : public hid::report::base<hid::report::type::INPUT, RE
using Hat = espp::gamepad::Hat;

/// Construct a new Gamepad Input Report object
constexpr GamepadInputReport() = default;
constexpr GamepadInputReport() { reset(); }

/// Reset the gamepad inputs
constexpr void reset() {
Expand Down
4 changes: 2 additions & 2 deletions components/hid-rp/include/hid-rp-playstation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,8 @@ class PlaystationDualsenseBLEComplexInputReport
std::fill(trigger_axes.begin(), trigger_axes.end(), trigger_center);
std::fill(buttons.raw.begin(), buttons.raw.end(), 0);
std::fill(vendor_defined.raw.begin(), vendor_defined.raw.end(), 0);
timestamp = prev_timestamp; // cppcheck-suppress redundantAssignment
counter = prev_counter; // cppcheck-suppress redundantAssignment
timestamp = prev_timestamp;
counter = prev_counter;
vendor_defined.coarse_timestamp = prev_coarse_timestamp;
vendor_defined.fine_timestamp1 = prev_fine_timestamp1;
vendor_defined.fine_timestamp2 = prev_fine_timestamp2;
Expand Down
7 changes: 5 additions & 2 deletions components/hid-rp/include/hid-rp-switch-pro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,18 @@ class SwitchProGamepadInputReport : public hid::report::base<hid::report::type::

public:
/// Construct a new Gamepad Input Report object
constexpr SwitchProGamepadInputReport() = default;
constexpr SwitchProGamepadInputReport()
: raw_report{} {
reset();
}

/// Reset the gamepad inputs
constexpr void reset() {
uint8_t prev_counter = counter;
// fill all 0s
std::fill(raw_report, raw_report + sizeof(raw_report), 0);
// now set the counter to the previous value
counter = prev_counter; // cppcheck-suppress redundantAssignment
counter = prev_counter;
// set the joysticks to 0 since their config may not put them at 0
set_left_joystick(0, 0);
set_right_joystick(0, 0);
Expand Down
12 changes: 6 additions & 6 deletions components/hid-rp/include/hid-rp-xbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU
static constexpr std::size_t num_data_bytes = sizeof(XboxRumbleOutputReport);

/// Construct a new Xbox Rumble Output Report object
constexpr XboxRumbleOutputReport() = default;
constexpr XboxRumbleOutputReport() { reset(); }

/// Reset the rumble effect
constexpr void reset() {
Expand All @@ -165,7 +165,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU

/// Get the enabled mask for the rumble motors
/// \return The enabled mask for the rumble motors
constexpr auto get_enabled() { return enabled; }
constexpr auto get_enabled() const { return enabled; }

/// Set the enabled mask for the rumble motors
/// \param new_enabled The enabled mask for the rumble motors
Expand All @@ -174,7 +174,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU
/// Get the magnitude of the rumble effect for the specified motor
/// \param motor The motor for which you want to get the magnitude.
/// \return The magnitude of the rumble effect for the specified motor.
constexpr auto get_magnitude(std::size_t motor) { return magnitude[motor]; }
constexpr auto get_magnitude(std::size_t motor) const { return magnitude[motor]; }

/// Set the magnitude of the rumble effect for the specified motor
/// \param motor The motor for which you want to set the magnitude.
Expand All @@ -192,7 +192,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU

/// Get the duration of the rumble effect
/// \return The duration of the rumble effect
constexpr auto get_duration() { return duration; }
constexpr auto get_duration() const { return duration; }

/// Set the duration of the rumble effect
/// \param value The duration of the rumble effect.
Expand All @@ -201,7 +201,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU

/// Get the start delay of the rumble effect
/// \return The start delay of the rumble effect
constexpr auto get_start_delay() { return start_delay; }
constexpr auto get_start_delay() const { return start_delay; }

/// Set the start delay of the rumble effect
/// \param value The start delay of the rumble effect.
Expand All @@ -210,7 +210,7 @@ class XboxRumbleOutputReport : public hid::report::base<hid::report::type::OUTPU

/// Get the loop count of the rumble effect
/// \return The loop count of the rumble effect
constexpr auto get_loop_count() { return loop_count; }
constexpr auto get_loop_count() const { return loop_count; }

/// Set the loop count of the rumble effect
/// \param value The loop count of the rumble effect.
Expand Down
Loading
Loading