Skip to content

sensors: generalise lps22 pressure sensor for HH and DF models#663

Draft
radekszewczyk01 wants to merge 1 commit into
masterfrom
radekszewczyk01/baro_lps22_generalise
Draft

sensors: generalise lps22 pressure sensor for HH and DF models#663
radekszewczyk01 wants to merge 1 commit into
masterfrom
radekszewczyk01/baro_lps22_generalise

Conversation

@radekszewczyk01

Copy link
Copy Markdown

JIRA: PP-404

Generalise driver for lps22xx pressure sensor series.

Description

Generalise driver for lps22xx pressure sensor series.

Motivation and Context

This change is required in order to use lps22hh or lps22df depending on target.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: armv8m55-stm32n6.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

@radekszewczyk01 radekszewczyk01 requested a review from niewim19 May 19, 2026 11:44
@radekszewczyk01 radekszewczyk01 force-pushed the radekszewczyk01/baro_lps22_generalise branch from 25755e2 to 0f19f06 Compare May 19, 2026 11:45

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for the LPS22DF barometric sensor variant by refactoring the driver to accommodate both LPS22HH and LPS22DF models. The changes include model-specific register definitions, an updated sensor identification process, and dedicated initialization routines for each variant. A review comment points out an unreachable return statement in the lps22xx_hwSetup function that should be removed for code clarity.

Comment thread sensors/baro/lps22xx.c
return -1;
}

return -1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This return statement is unreachable because the switch block above handles all possible cases (including default) and returns from the function in every branch.

@github-actions

Copy link
Copy Markdown

Unit Test Results

10 543 tests  ±0   9 881 ✅ ±0   52m 42s ⏱️ - 2m 32s
   649 suites ±0     662 💤 ±0 
     1 files   ±0       0 ❌ ±0 

Results for commit 0f19f06. ± Comparison against base commit 988dc41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant