• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revisionc260f5f130b3443b91a4f737f76af681edd0b825 (tree)
Zeit2016-10-02 03:37:02
AutorIvan Ivanich <iivanich@gmai...>
CommiterIvan Ivanich

Log Message

Revert "Fix the command timeout issue with TX idle timer"

This reverts commit 5a234ca06c185f336a6398efe09f78c4d0dacf0b.

Change-Id: I2cec99e8cc119a9f8142f7370db1d4e1ff880e97

Ändern Zusammenfassung

Diff

--- a/hci/include/low_power_manager.h
+++ b/hci/include/low_power_manager.h
@@ -41,9 +41,6 @@ typedef struct low_power_manager_t {
4141 // Tell the low power manager that you're done transmitting data. Must be
4242 // called on the thread provided at initialization time.
4343 void (*transmit_done)(void);
44-
45- void (*start_idle_timer)(bool check_LPM);
46- void (*stop_idle_timer)();
4744 } low_power_manager_t;
4845
4946 const low_power_manager_t *low_power_manager_get_interface();
--- a/hci/src/hci_layer.c
+++ b/hci/src/hci_layer.c
@@ -534,9 +534,9 @@ static void event_command_ready(fixed_queue_t *queue, UNUSED_ATTR void *context)
534534 pthread_mutex_unlock(&commands_pending_response_lock);
535535
536536 // Send it off
537- low_power_manager->stop_idle_timer();
537+ low_power_manager->wake_assert();
538538 packet_fragmenter->fragment_and_dispatch(wait_entry->command);
539- low_power_manager->start_idle_timer(false);
539+ low_power_manager->transmit_done();
540540
541541 update_command_response_timer();
542542 }
--- a/hci/src/low_power_manager.c
+++ b/hci/src/low_power_manager.c
@@ -61,8 +61,8 @@ static void event_allow_device_sleep(void *context);
6161 static void event_idle_timeout(void *context);
6262
6363 static void reset_state();
64-void start_idle_timer(bool check_LPM);
65-void stop_idle_timer();
64+static void start_idle_timer();
65+static void stop_idle_timer();
6666
6767 static thread_fn event_functions[] = {
6868 event_disable,
@@ -129,7 +129,7 @@ static void transmit_done() {
129129 transmit_is_done = true;
130130 if (wake_state == LPM_WAKE_W4_TX_DONE) {
131131 wake_state = LPM_WAKE_W4_TIMEOUT;
132- start_idle_timer(true);
132+ start_idle_timer();
133133 }
134134 }
135135
@@ -163,7 +163,7 @@ static void allow_device_sleep() {
163163 if (state == LPM_ENABLED && wake_state == LPM_WAKE_ASSERTED) {
164164 if (transmit_is_done) {
165165 wake_state = LPM_WAKE_W4_TIMEOUT;
166- start_idle_timer(true);
166+ start_idle_timer();
167167 } else {
168168 wake_state = LPM_WAKE_W4_TX_DONE;
169169 }
@@ -190,8 +190,8 @@ static void idle_timer_expired(UNUSED_ATTR void *context) {
190190 thread_post(thread, event_idle_timeout, NULL);
191191 }
192192
193-void start_idle_timer(bool check_LPM) {
194- if (state == LPM_ENABLED || !check_LPM) {
193+static void start_idle_timer() {
194+ if (state == LPM_ENABLED) {
195195 if (idle_timeout_ms == 0) {
196196 wake_deassert();
197197 } else {
@@ -200,9 +200,8 @@ void start_idle_timer(bool check_LPM) {
200200 }
201201 }
202202
203-void stop_idle_timer() {
203+static void stop_idle_timer() {
204204 alarm_cancel(idle_alarm);
205- LOG_DEBUG("%s", __func__);
206205 }
207206
208207 static void event_disable(UNUSED_ATTR void *context) {
@@ -241,9 +240,7 @@ static const low_power_manager_t interface = {
241240 cleanup,
242241 post_command,
243242 wake_assert,
244- transmit_done,
245- start_idle_timer,
246- stop_idle_timer
243+ transmit_done
247244 };
248245
249246 const low_power_manager_t *low_power_manager_get_interface() {