Change accel subscription logic
This commit is contained in:
+4
-7
@@ -260,10 +260,9 @@ static void apply_settings(bool first_run) {
|
|||||||
// changes to low fuel threshold
|
// changes to low fuel threshold
|
||||||
batt_callback(battery_state_service_peek());
|
batt_callback(battery_state_service_peek());
|
||||||
|
|
||||||
// sub/unsub from accelerometer if needed
|
// re-sub accelerometer
|
||||||
if (settings.DateTimeoutSecs == 0) {
|
accel_tap_service_unsubscribe();
|
||||||
accel_tap_service_unsubscribe();
|
if (settings.DateTimeoutSecs != 0) {
|
||||||
} else {
|
|
||||||
accel_tap_service_subscribe(accel_tap_handler);
|
accel_tap_service_subscribe(accel_tap_handler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,9 +304,7 @@ static void main_window_load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void main_window_unload() {
|
static void main_window_unload() {
|
||||||
if (settings.DateTimeoutSecs != 0) {
|
accel_tap_service_unsubscribe();
|
||||||
accel_tap_service_unsubscribe();
|
|
||||||
}
|
|
||||||
layer_destroy(s_fuel_mg_layer);
|
layer_destroy(s_fuel_mg_layer);
|
||||||
layer_destroy(s_temp_mg_layer);
|
layer_destroy(s_temp_mg_layer);
|
||||||
bitmap_layer_destroy(s_f_layer);
|
bitmap_layer_destroy(s_f_layer);
|
||||||
|
|||||||
Reference in New Issue
Block a user