common/gesture.c: Format with clang-format
BRANCH=none
TEST=none
#define CPRINTS(format, args...) cprints(CC_GESTURE, format, ##args)
#define CPRINTF(format, args...) cprintf(CC_GESTURE, format, ##args)
-
/*
* Double tap detection parameters
* Double tap works by looking for two isolated Z-axis accelerometer impulses
@@ -253,13 +252,11 @@ static int gesture_tap_for_battery(void)
}
/* On state transitions, print debug info */
- if (tap_debug &&
- (state != state_p ||
- (state_cnt % 10000 == 9999))) {
+ if (tap_debug && (state != state_p || (state_cnt % 10000 == 9999))) {
/* make sure we don't divide by 0 */
if (delta_z_outer == 0 || delta_xy_inner == 0)
- CPRINTS("tap st %d->%d, error div by 0",
- state_p, state);
+ CPRINTS("tap st %d->%d, error div by 0", state_p,
+ state);
else
CPRINTS("tap st %d->%d, st_cnt %-3d "
"Z_in:Z_out %-3d, Z_in:XY_in %-3d "
@@ -267,10 +264,8 @@ static int gesture_tap_for_battery(void)
"dZ_out %-8.3d",
state_p, state, state_cnt,
delta_z_inner / delta_z_outer,
- delta_z_inner / delta_xy_inner,
- delta_z_inner,
- delta_z_inner_max,
- delta_z_outer);
+ delta_z_inner / delta_xy_inner, delta_z_inner,
+ delta_z_inner_max, delta_z_outer);
}
return ret;
@@ -281,8 +276,7 @@ static void gesture_chipset_resume(void)
/* disable tap detection */
tap_detection = 0;
}
-DECLARE_HOOK(HOOK_CHIPSET_RESUME, gesture_chipset_resume,
- GESTURE_HOOK_PRIO);
+DECLARE_HOOK(HOOK_CHIPSET_RESUME, gesture_chipset_resume, GESTURE_HOOK_PRIO);
static void gesture_chipset_suspend(void)
{
@@ -295,8 +289,7 @@ static void gesture_chipset_suspend(void)
state = TAP_IDLE;
tap_detection = 1;
}
-DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, gesture_chipset_suspend,
- GESTURE_HOOK_PRIO);
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, gesture_chipset_suspend, GESTURE_HOOK_PRIO);
void gesture_calc(uint32_t *event)
{
@@ -315,8 +308,8 @@ static int command_tap_info(int argc, char **argv)
{
int val;
- ccprintf("tap: %s\n", (tap_detection && !lid_is_open()) ?
- "on" : "off");
+ ccprintf("tap: %s\n",
+ (tap_detection && !lid_is_open()) ? "on" : "off");
if (argc > 1) {
if (!parse_bool(argv[1], &val))
@@ -329,6 +322,5 @@ static int command_tap_info(int argc, char **argv)
return EC_SUCCESS;
}
-DECLARE_CONSOLE_COMMAND(tapinfo, command_tap_info,
- "debug on/off",
+DECLARE_CONSOLE_COMMAND(tapinfo, command_tap_info, "debug on/off",
"Print tap information");
