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

Fixes for tickless and LPTICKER_DELAY_TICKS #7524

Merged
merged 7 commits into from
Aug 21, 2018
Merged

Commits on Aug 17, 2018

  1. Add ticker suspend/resume API

    Add an API to suspend and resume the ticker.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    23e6d50 View commit details
    Browse the repository at this point in the history
  2. Add test for ticker suspend and resume

    Unit test the functions ticker_suspend and ticker_resume.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    1bbf43a View commit details
    Browse the repository at this point in the history
  3. Update deep sleep lock check in tests

    When the define LPTICKER_DELAY_TICKS is set deep sleep can be randomly
    disallowed when using the low power ticker. This is because a Timer
    object, which locks deep sleep, is used to protect from back-to-back
    writes to lp tickers which can't support that. This causes tests which
    assert that deep sleep is allowed to intermittently fail.
    
    To fix this intermittent failure this patch adds the function
    sleep_manager_can_deep_sleep_test_check() which checks if deep sleep
    is allowed over a duration. It updates all the tests to use
    sleep_manager_can_deep_sleep_test_check() rather
    than sleep_manager_can_deep_sleep() so the tests work even if deep
    sleep is spuriously blocked.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    472abab View commit details
    Browse the repository at this point in the history
  4. Update low power ticker wrapper

    Update the low power ticker wrapper code so it does not violate any
    properties of the ticker specification. In specific this patch fixes
    the following:
    - Prevent spurious interrupts
    - Fire interrupt only when the ticker times increments to or past the
        value set by ticker_set_interrupt
    - Disable interrupts when ticker_init is called
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    adc64cc View commit details
    Browse the repository at this point in the history
  5. Fix tests to work with LPTICKER_DELAY_TICKS

    Fix the HAL common_tickers and sleep tests so they work correctly when
    the define LPTICKER_DELAY_TICKS is set.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    f68958d View commit details
    Browse the repository at this point in the history
  6. Fix rollover handling in ticker frequency test

    To handle timer rollovers the test tests-mbed_hal-common_tickers_freq
    calls intf->set_interrupt(0). For this to work correctly the ticker
    implementation must fire an interrupt on every rollover event though
    intf->set_interrupt(0) was called only once. Whether an interrupt will
    fire only once or multiple times is undefined behavior which
    cannot be relied upon.
    
    To avoid this undefined behavior this patch continually schedules an
    interrupt and performs overflow detection on every read. This also
    removes the possibility of race conditions due to overflowCounter
    incrementing at the wrong time.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    00b8e24 View commit details
    Browse the repository at this point in the history
  7. Speed optimization for LowPowerTickerWrapper

    Only reschedule the Timeout object in the low power ticker wrapper
    if it is not already pending.
    c1728p9 committed Aug 17, 2018
    Configuration menu
    Copy the full SHA
    dc2e2c0 View commit details
    Browse the repository at this point in the history