GithubHelp home page GithubHelp logo

stmicroelectronics / stm32f3xx_hal_driver Goto Github PK

View Code? Open in Web Editor NEW
12.0 15.0 3.0 6.62 MB

Provides the STM32Cube MCU Component "hal_driver" of the STM32F3 series.

License: BSD 3-Clause "New" or "Revised" License

C 98.17% HTML 1.21% CSS 0.62%
stm32cube-mcu-component hal-driver

stm32f3xx_hal_driver's Issues

LL: OPAMP functional modes assert incomplete

Describe the set-up

  • custom board, not directly relevant to issue
  • GCC 10.2, cmake, ninja

Describe the bug
These two functional modes are not allowed by checking macro and causes assertion when used.

Funtional modes:

#define LL_OPAMP_MODE_STANDALONE        (0x00000000U)                               /*!< OPAMP functional mode, OPAMP operation in standalone */
#define LL_OPAMP_MODE_FOLLOWER          (OPAMP_CSR_VMSEL_1 | OPAMP_CSR_VMSEL_0)     /*!< OPAMP functional mode, OPAMP operation in follower */
#define LL_OPAMP_MODE_PGA               (OPAMP_CSR_VMSEL_1)                         /*!< OPAMP functional mode, OPAMP operation in PGA */
#define LL_OPAMP_MODE_PGA_EXT_FILT_IO0  (OPAMP_CSR_PGGAIN_3                      | OPAMP_CSR_VMSEL_1) /*!< OPAMP functional mode, OPAMP operation in PGA with external filtering on OPAMP input IO0. */
#define LL_OPAMP_MODE_PGA_EXT_FILT_IO1  (OPAMP_CSR_PGGAIN_3 | OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_VMSEL_1) /*!< OPAMP functional mode, OPAMP operation in PGA with external filtering on OPAMP input IO1. */

Macro used in assert.

#define IS_LL_OPAMP_FUNCTIONAL_MODE(__FUNCTIONAL_MODE__)                       \
  (   ((__FUNCTIONAL_MODE__) == LL_OPAMP_MODE_STANDALONE)                      \
   || ((__FUNCTIONAL_MODE__) == LL_OPAMP_MODE_FOLLOWER)                        \
   || ((__FUNCTIONAL_MODE__) == LL_OPAMP_MODE_PGA)                             \
  )

Clearly, macro does not accept LL_OPAMP_MODE_PGA_EXT_FILT_IO0 and LL_OPAMP_MODE_PGA_EXT_FILT_IO1 functional modes.

How To Reproduce

  1. have code like
	LL_OPAMP_InitTypeDef OPAMP_InitStruct {};
	
	OPAMP_InitStruct.FunctionalMode = LL_OPAMP_MODE_PGA_EXT_FILT_IO1;
	OPAMP_InitStruct.InputNonInverting = LL_OPAMP_INPUT_NONINVERT_IO0;
	OPAMP_InitStruct.InputInverting = LL_OPAMP_INPUT_INVERT_IO1;
	LL_OPAMP_Init(OPAMP2, &OPAMP_InitStruct);
  1. enable assertions by defining USE_FULL_ASSERT
  2. compile and run
  3. assertion occurs on valid functional mode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.