Skip to content
Snippets Groups Projects
  1. Jan 04, 2020
  2. Dec 31, 2019
  3. Dec 29, 2019
    • rahix's avatar
      fix(ws2812): Fix first write making the first pixel green · 6fec4e00
      rahix authored
      
      The first epic_ws2812_write() call will set the first pixel to 0x008000
      (bright green).  This is caused by the GPIO line being pulled down on
      mode-setting (epic_gpio_set_pin_mode).  Wait before writing the values
      to reset the bus and thus properly set the pixels to the correct colors
      on first write.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      6fec4e00
    • rahix's avatar
      fix(bhi160): Disable driver on critical error · 23b4a9ed
      rahix authored
      
      If initialization fails, bhi160 API calls should not infinitely block
      waiting for it to complete; they should fail immediately with an error
      stating that something went wrong.
      
      Add a flag that indicates the driver to not accept API requests because
      initialization was not finished properly.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      23b4a9ed
  4. Dec 28, 2019
  5. Dec 26, 2019
  6. Dec 22, 2019
    • rahix's avatar
      chore(max30001): Port to new mutex and hw-lock APIs · 6da4644e
      rahix authored
      
      Using a FreeRTOS mutex directly is deprecated.  Replace it with a
      `struct mutex`.  Similarly, the deprecated `hwlock_acquire_timeout()`
      is replaced with `hwlock_acquire()`.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      6da4644e
    • rahix's avatar
      feat(hw-locks): Introduce new hw-lock API · 605d5e56
      rahix authored
      
      Re-add a `hwlock_acquire()` method, but this time without a timeout
      parameter.  From a functional point of view, this is just a wrapper
      around `mutex_lock()`.
      
      Additionally, add `hwlock_acquire_nonblock()` which behaves like
      `mutex_trylock()`.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      605d5e56
    • rahix's avatar
      chore(hw-locks): Rename to hwlock_acquire_timeout · 610a3048
      rahix authored
      
      Rename hwlock_acquire() to hwlock_acquire_timeout() in preparation for
      future changes to the hw-lock API.  Change all uses of the hw-lock API
      to reflect this change.
      
      This commit does not introduce any functional changes, except getting
      rid of the timeout usage warnings.  This change is no-op, because the
      hwlock_acquire() implementation already replaces any non-zero timeout
      value with portMAX_DELAY.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      610a3048
    • rahix's avatar
      feat(hw-locks): hwlock_release() should return void · 18202736
      rahix authored
      
      With the switch to the new mutex API, hwlock_release() cannot fail under
      any circumstances.  To emphasize this, make it return void instead of
      int (Previously it just always returned 0).
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      18202736
    • rahix's avatar
      feat(hw-locks): Switch to new mutex API · d93c7f00
      rahix authored
      
      Reimplement the hw-lock module to use the new mutex API.  This slightly
      changes the semantics of locking a hw-lock as the new mutex API does not
      allow timeouts.  When a hwlock_acquire() with a (non-infinite) timeout
      is attempted, a warning is printed to the serial console.
      
      Additionally, instead of returning -EINVAL on use of a non-existent
      hardware lock, the new implementation triggers a firmware panic.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      d93c7f00
  7. Dec 10, 2019
  8. Dec 06, 2019
  9. Dec 05, 2019
  10. Nov 25, 2019
  11. Nov 19, 2019
  12. Nov 13, 2019
  13. Nov 10, 2019
  14. Nov 03, 2019
    • rahix's avatar
      chore(api-lock): Port to new mutex API · 75278836
      rahix authored
      
      Using a bare FreeRTOS mutex is deprecated.  Replace it with the new
      `struct mutex`.  This should increase stability.
      
      Additionally, fix a bug in `lifecycle.c:do_load()` where the function
      would return without unlocking the API mutex if `hardware_reset()`
      returns an error.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      Verified
      75278836
    • rahix's avatar
      chore(sensor-streams): Port to new mutex API · 44ea81f2
      rahix authored
      
      Using a bare FreeRTOS mutex is deprecated.  Replace it with the new
      `struct mutex`.  This should increase stability of the module.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      Verified
      44ea81f2
    • rahix's avatar
      chore(lifecycle): Port to new mutex API · cc5f0e29
      rahix authored
      
      Using a bare FreeRTOS mutex is deprecated.  Replace it with the new
      `struct mutex`.  This should increase stability of the module.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      Verified
      cc5f0e29
    • rahix's avatar
      feat(epicardium): Add a proper mutex implementation · 9a5a46cd
      rahix authored
      
      In the current firmware, different locking mechanisms a littered around
      the code-base.  Among them are bare FreeRTOS mutexes and the hw-locks.
      The callers for these often specify timeouts but don't make much effort
      in A) picking robust values for the timeout and B) recovering gracefully
      from a timeout happening.  Most of the time, we return -EBUSY to _Python
      code_.  This is really really bad API design.  The firmware needs to
      have enough integrity to ensure these situations can't ever occur.
      
      To combat this, add a new locking primitive: The `struct mutex`.  The
      intention is to replace all other locking and synchronization APIs with
      this one.  This will provide one central place to debug any sort of
      locking issues.
      
      The `struct mutex` API is based on a few assumptions about locking.
      Those are detailed in `Documentation/epicardium/mutex.rst`, which is
      part of this commit.  The most important one is:
      
          Locking can **never** fail.
      
      By requiring this to be true, we eliminate the need for drivers to
      contain (often incorrect) logic for dealing with locking fails.  This
      should drastically improve the stability of the firmware in regards to
      lock-related bugs.
      
      This commit does not introduce any functional changes yet.
      
      Signed-off-by: default avatarRahix <rahix@rahix.de>
      Verified
      9a5a46cd
  15. Oct 06, 2019
  16. Oct 05, 2019
Loading