Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix STM32 CAN reset to not lose context #4932

Merged
merged 6 commits into from
Sep 20, 2017
Merged

Commits on Sep 5, 2017

  1. STM32: move can_s definition to common_objects.h

    This will ease up further changes to the structure.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    66162c6 View commit details
    Browse the repository at this point in the history
  2. STM32: Define CAN handle as part of can object

    Instead of a static object, this will make driver
    instantiation more robust and allow to re-use init
    configuration on a need basis.
    
    The CANName struct member is actually the CAN registers base address,
    which is now available in the CanHandle.Instance field, so we don't need
    CANName anymore.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    759642a View commit details
    Browse the repository at this point in the history
  3. STM32: CAN: do not overwite BTR register when setting frequency

    BTR register has other bits than the ones calculated and set through
    the can_speed function, so let's take care to only write to the
    right registers.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    57222b6 View commit details
    Browse the repository at this point in the history
  4. STM32: CAN: store the mode in object context

    In order to apply the same mode in case of reset, we store the current
    requested mode in the HAL structure.
    
    To make storage in a single place, we also change can_monitor to call
    can_mode function as they actually acting on same registers.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    8357f6f View commit details
    Browse the repository at this point in the history
  5. STM32: CAN: restore registers after can_reset

    After reset the MCR register content needs to be restored so we're
    introducing the can_registers_init function to be called at the first
    init stage, but also after reset. We also store the can frequency to
    go through the initialisation phase again.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    04ac65a View commit details
    Browse the repository at this point in the history
  6. STM32: F2: put can_s struct under DEVICE_CAN option

    In case of F2 devices without CAN support.
    LMESTM committed Sep 5, 2017
    Configuration menu
    Copy the full SHA
    5997811 View commit details
    Browse the repository at this point in the history