Skip to content

Commit

Permalink
style: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
b4nst committed Aug 19, 2023
1 parent d4e2a78 commit 4d1f169
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
7 changes: 2 additions & 5 deletions include/surface.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
#ifndef SURFACE_H
#define SURFACE_H

enum SurfaceKeyType {
SURFACE_PAD,
SURFACE_CTRL
};
enum SurfaceKeyType { SURFACE_PAD, SURFACE_CTRL };

/**
* @brief index_to_surface_key_type Convert an index to a SurfaceKeyType
* @brief index_to_surface_key_type Convert an index to a SurfaceKeyType
* @param index The index to convert
* @return The SurfaceKeyType
*/
Expand Down
20 changes: 14 additions & 6 deletions src/surface.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#include "surface.h"

enum SurfaceKeyType index_to_surface_key_type(unsigned char index) {
if (index >= 90) { return SURFACE_CTRL; }
if (index <= 10) { return SURFACE_CTRL; }
if (index % 10 == 9) { return SURFACE_CTRL; }
if (index % 10 == 1) { return SURFACE_CTRL; }

return SURFACE_PAD;
if (index >= 90) {
return SURFACE_CTRL;
}
if (index <= 10) {
return SURFACE_CTRL;
}
if (index % 10 == 9) {
return SURFACE_CTRL;
}
if (index % 10 == 1) {
return SURFACE_CTRL;
}

return SURFACE_PAD;
}

0 comments on commit 4d1f169

Please sign in to comment.