diff --git a/.github/workflows/cmake-gcc-arm.yml b/.github/workflows/cmake-gcc-arm.yml index 6e0e370..7609dbb 100644 --- a/.github/workflows/cmake-gcc-arm.yml +++ b/.github/workflows/cmake-gcc-arm.yml @@ -39,9 +39,8 @@ jobs: # Build your program with the given configuration run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - + - name: Upload final build artifacts + uses: actions/upload-artifact@v4 + with: + name: stm32-i2c-hid + path: ${{github.workspace}}/build/stm32-i2c-hid.* diff --git a/c2usb b/c2usb index 1535029..3cdccdf 160000 --- a/c2usb +++ b/c2usb @@ -1 +1 @@ -Subproject commit 1535029b9e47f2119d057ed34e96b58974ec5543 +Subproject commit 3cdccdf05a44986be854fbb3ba5cac4baa98c6ca diff --git a/cmake/gcc-arm-none-eabi.cmake b/cmake/gcc-arm-none-eabi.cmake index bd572db..0976345 100644 --- a/cmake/gcc-arm-none-eabi.cmake +++ b/cmake/gcc-arm-none-eabi.cmake @@ -30,9 +30,10 @@ set(TARGET_FLAGS "-mcpu=cortex-m0 ") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdata-sections -ffunction-sections ") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra ") # skip warnings if(FALSE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic ") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic ") endif() if(CMAKE_BUILD_TYPE MATCHES Debug) diff --git a/stm32-i2c-hid/hid/demo_app.cpp b/stm32-i2c-hid/hid/demo_app.cpp index e255887..9ebbd56 100644 --- a/stm32-i2c-hid/hid/demo_app.cpp +++ b/stm32-i2c-hid/hid/demo_app.cpp @@ -53,7 +53,7 @@ demo_app& demo_app::instance() return app; } -void demo_app::start(protocol prot) +void demo_app::start([[maybe_unused]] protocol prot) { receive_report(&_raw_out_buffer); } @@ -70,7 +70,7 @@ void demo_app::button_state_change(bool pressed) } } -void demo_app::set_report(report::type type, const std::span& data) +void demo_app::set_report([[maybe_unused]] report::type type, const std::span& data) { // only output reports provided assert(type == report::type::OUTPUT); @@ -91,7 +91,8 @@ void demo_app::set_report(report::type type, const std::span& dat receive_report(&_raw_out_buffer); } -void demo_app::get_report(report::selector select, const std::span& buffer) +void demo_app::get_report(report::selector select, + [[maybe_unused]] const std::span& buffer) { if (select == _keys_buffer.selector()) { diff --git a/stm32-i2c-hid/i2c_hid_config.cpp b/stm32-i2c-hid/i2c_hid_config.cpp index 8b3a4c2..45c729b 100644 --- a/stm32-i2c-hid/i2c_hid_config.cpp +++ b/stm32-i2c-hid/i2c_hid_config.cpp @@ -63,23 +63,23 @@ extern "C" void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) } } -extern "C" void HAL_I2C_AddrCallback(I2C_HandleTypeDef* hi2c, uint8_t TransferDirection, - uint16_t AddrMatchCode) +extern "C" void HAL_I2C_AddrCallback([[maybe_unused]] I2C_HandleTypeDef* hi2c, + uint8_t TransferDirection, uint16_t AddrMatchCode) { get_i2c_slave().handle_start(static_cast(TransferDirection)); } -extern "C" void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef* hi2c) +extern "C" void HAL_I2C_ListenCpltCallback([[maybe_unused]] I2C_HandleTypeDef* hi2c) { get_i2c_slave().handle_stop(); } -extern "C" void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef* hi2c) +extern "C" void HAL_I2C_SlaveTxCpltCallback([[maybe_unused]] I2C_HandleTypeDef* hi2c) { get_i2c_slave().handle_tx_complete(); } -extern "C" void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef* hi2c) +extern "C" void HAL_I2C_SlaveRxCpltCallback([[maybe_unused]] I2C_HandleTypeDef* hi2c) { get_i2c_slave().handle_rx_complete(); } diff --git a/stm32-i2c-hid/newlib_diet.cpp b/stm32-i2c-hid/newlib_diet.cpp index 0814f89..52760fc 100644 --- a/stm32-i2c-hid/newlib_diet.cpp +++ b/stm32-i2c-hid/newlib_diet.cpp @@ -15,6 +15,7 @@ extern "C" void _fini(void) {} extern "C" void __register_exitproc(void) {} void operator delete(void*, unsigned int) {} +void operator delete(void*) {} /* needed to avoid pulling in a lot of library code */ #ifndef NDEBUG diff --git a/stm32-i2c-hid/st/hal_i2c_slave.cpp b/stm32-i2c-hid/st/hal_i2c_slave.cpp index 0ee901a..f5ca158 100644 --- a/stm32-i2c-hid/st/hal_i2c_slave.cpp +++ b/stm32-i2c-hid/st/hal_i2c_slave.cpp @@ -61,7 +61,7 @@ void hal_i2c_slave::start_listen() HAL_I2C_EnableListen_IT(handle_); } -void hal_i2c_slave::stop_listen(i2c::address slave_addr) +void hal_i2c_slave::stop_listen([[maybe_unused]] i2c::address slave_addr) { HAL_I2C_DisableListen_IT(handle_); }