Skip to content

Commit

Permalink
[debouncing] Improve debouncing to avoid missing signals. Fixes: JB#2…
Browse files Browse the repository at this point in the history
…5557

In some border line cases there can be issues with signals not being sent.
This is the case when a charger gets identified as cable and later on correctly
as a dedicated charger.
We make sure we actually compare the set state instead of just relying on
connected state only.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Jan 12, 2015
1 parent 6ad7e1e commit e6c5ae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/usb_moded.c
Expand Up @@ -105,7 +105,7 @@ void set_usb_connected(gboolean connected)
spurious load/unloads due to faulty signalling
NOKIA: careful with devicelock
*/
if(current_mode.connected)
if(current_mode.connected == connected)
return;

#ifdef NOKIA
Expand Down Expand Up @@ -194,7 +194,7 @@ void set_charger_connected(gboolean state)
{
/* check if charger is already connected
to avoid spamming dbus */
if(current_mode.connected)
if(current_mode.connected == state)
return;

if(state)
Expand Down

0 comments on commit e6c5ae7

Please sign in to comment.