Skip to content

Commit

Permalink
Add patch for BMP5 sensor API to fix an uninitialized variable warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Kampi committed Aug 7, 2024
1 parent 33f428c commit 473a5bb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
cmake_minimum_required(VERSION 3.20.0)

# Apply patches before build
file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} "patches/*.patch")
# Apply Zephyr patches before build
file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} "patches/zephyr/*.patch")
foreach(file ${files})
execute_process(COMMAND
patch -p1 -d $ENV{ZEPHYR_BASE} -i ${CMAKE_CURRENT_SOURCE_DIR}/${file} -r - --no-backup-if-mismatch)
endforeach()

# Apply ext_drivers patches before build
file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} "patches/ext_drivers/*.patch")
foreach(file ${files})
execute_process(COMMAND
patch -p1 -d ${CMAKE_SOURCE_DIR}/src/ext_drivers -i ${CMAKE_CURRENT_SOURCE_DIR}/${file} -r - --no-backup-if-mismatch)
endforeach()

# Get the target hardware
string(REGEX MATCH "zswatch_nrf5340_cpuapp(_ns)?@([0-9]+)$" ZSWATCH_BOARD "${BOARD}")
if(ZSWATCH_BOARD)
Expand Down
13 changes: 13 additions & 0 deletions app/patches/ext_drivers/bmp5.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/BMP5-Sensor-API/bmp5.c b/BMP5-Sensor-API/bmp5.c
index 6af2f6a..e62172a 100644
--- a/BMP5-Sensor-API/bmp5.c
+++ b/BMP5-Sensor-API/bmp5.c
@@ -1130,7 +1130,7 @@ int8_t bmp5_get_fifo_len(uint16_t *fifo_len, struct bmp5_fifo *fifo, struct bmp5
int8_t bmp5_get_fifo_data(struct bmp5_fifo *fifo, struct bmp5_dev *dev)
{
int8_t rslt;
- uint16_t fifo_len;
+ uint16_t fifo_len = 0;

if (fifo != NULL)
{
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 473a5bb

Please sign in to comment.