Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a08e85a authored by tturney's avatar tturney
Browse files

Fix btwrite timer timeout for Angler (2/2)

When calculating the appropriate LPM's idle timeout,
the local chip name was NULL. This is fixed by calculating
LMP's idle timeout when the chip is enabling.

Bug: 23248798
Change-Id: I8ee2b28fb4363359e035e242fdcff8a736ee448c
parent df77a081
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ static void init(thread_t *post_thread) {
  thread = post_thread;

  vendor->set_callback(VENDOR_SET_LPM_MODE, vendor_enable_disable_callback);
  vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms);

  idle_alarm = alarm_new();
  if (!idle_alarm) {
@@ -147,6 +146,8 @@ static void enable(bool enable) {
  } else {
    uint8_t command = enable ? BT_VND_LPM_ENABLE : BT_VND_LPM_DISABLE;
    state = enable ? LPM_ENABLING : LPM_DISABLING;
    if (state == LPM_ENABLING)
        vendor->send_command(VENDOR_GET_LPM_IDLE_TIMEOUT, &idle_timeout_ms);
    vendor->send_async_command(VENDOR_SET_LPM_MODE, &command);
  }
}