From 32180f7d44867732901d1375f48783dde8e2b0f9 Mon Sep 17 00:00:00 2001 From: Michel-FK Date: Sat, 3 Apr 2021 23:38:05 +0200 Subject: [PATCH] untabify Signed-off-by: Michel-FK --- gpio_axp209.c | 4 ++-- gpio_axp209.h | 1 - gpio_mapping.c | 8 ++++---- gpio_mapping.h | 2 +- gpio_pcal6416a.c | 16 ++++++++-------- main.c | 2 +- mapping_list.c | 16 ++++++++-------- termfix.c | 2 +- 8 files changed, 25 insertions(+), 26 deletions(-) diff --git a/gpio_axp209.c b/gpio_axp209.c index a3d0c58..6b66035 100755 --- a/gpio_axp209.c +++ b/gpio_axp209.c @@ -39,9 +39,9 @@ #define ERROR_AXP209 #ifdef DEBUG_AXP209 - #define LOG_DEBUG(...) printf(__VA_ARGS__); + #define LOG_DEBUG(...) printf(__VA_ARGS__); #else - #define LOG_DEBUG(...) + #define LOG_DEBUG(...) #endif #ifdef ERROR_AXP209 diff --git a/gpio_axp209.h b/gpio_axp209.h index 1d69459..2140f2f 100755 --- a/gpio_axp209.h +++ b/gpio_axp209.h @@ -28,7 +28,6 @@ #ifndef _GPIO_AXP209_H_ #define _GPIO_AXP209_H_ - #include /* Chip physical address */ diff --git a/gpio_mapping.c b/gpio_mapping.c index b76d9b3..c5a92e6 100755 --- a/gpio_mapping.c +++ b/gpio_mapping.c @@ -68,7 +68,7 @@ #define SHORT_PEK_PRESS_DURATION_US (200 * 1000) -#define GPIO_PIN_I2C_EXPANDER_INTERRUPT ((('B' - '@') << 4) + 3) // PB3 +#define GPIO_PIN_I2C_EXPANDER_INTERRUPT ((('B' - '@') << 4) + 3) // PB3 #define GPIO_PIN_AXP209_INTERRUPT ((('B' - '@') << 4) + 5) // PB5 #define SHORT_PEK_PRESS_GPIO_MASK (1 << 5) @@ -331,7 +331,7 @@ void handle_gpio_mapping(mapping_list_t *list) system(mapping->value.command); } } - } + } /* Proccess the Power Enable Key (PEK) long keypress, the AXP209 * will shutdown the system in 3s anyway @@ -412,7 +412,7 @@ void handle_gpio_mapping(mapping_list_t *list) } } - /* Apply the mapping for the current gpio mask */ - apply_mapping(list, current_gpio_mask); + /* Apply the mapping for the current gpio mask */ + apply_mapping(list, current_gpio_mask); return; } diff --git a/gpio_mapping.h b/gpio_mapping.h index 85d39b4..70d40ae 100755 --- a/gpio_mapping.h +++ b/gpio_mapping.h @@ -35,4 +35,4 @@ bool init_gpio_mapping(const char* config_filename, void deinit_gpio_mapping(void); void handle_gpio_mapping(mapping_list_t *mapping_list); -#endif //_GPIO_MAPPING_H_ +#endif //_GPIO_MAPPING_H_ diff --git a/gpio_pcal6416a.c b/gpio_pcal6416a.c index 5b33dc8..77af363 100755 --- a/gpio_pcal6416a.c +++ b/gpio_pcal6416a.c @@ -45,9 +45,9 @@ #define ERROR_PCAL6416A #ifdef DEBUG_PCAL6416A - #define LOG_DEBUG(...) printf(__VA_ARGS__); + #define LOG_DEBUG(...) printf(__VA_ARGS__); #else - #define LOG_DEBUG(...) + #define LOG_DEBUG(...) #endif #ifdef ERROR_PCAL6416A @@ -93,15 +93,15 @@ bool pcal6416a_init(void) for (i = 0, i2c_expander_addr = 0; i2c_chip[i].address; i++) { if (ioctl(fd_i2c_expander, I2C_SLAVE_FORCE, i2c_chip[i]) < 0 || - pcal6416a_read_mask_interrupts() < 0) { + pcal6416a_read_mask_interrupts() < 0) { LOG_DEBUG("Failed to acquire bus access and/or talk to slave %s at address 0x%02X.\n", i2c_chip[i].name, i2c_chip[i].address); - } else { - LOG_DEBUG("Found I2C gpio expander chip %s at address 0x%02X\n", - i2c_chip[i].name, i2c_chip[i].address); - i2c_expander_addr = i2c_chip[i].address; + } else { + LOG_DEBUG("Found I2C gpio expander chip %s at address 0x%02X\n", + i2c_chip[i].name, i2c_chip[i].address); + i2c_expander_addr = i2c_chip[i].address; break; - } + } } /* GPIO expander chip found? */ diff --git a/main.c b/main.c index c195852..487ab1d 100644 --- a/main.c +++ b/main.c @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) handle_gpio_mapping(&mapping_list); } - /*Deinitialize the GPIO mapping */ + /* Deinitialize the GPIO mapping */ deinit_gpio_mapping(); /* Close the uinput device */ diff --git a/mapping_list.c b/mapping_list.c index 469f819..c99da61 100644 --- a/mapping_list.c +++ b/mapping_list.c @@ -49,9 +49,9 @@ /* Compute the byte offset of a structure member */ #undef offsetof #ifdef __compiler_offsetof -#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) +#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) #else -#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) +#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) #endif /* Retrieve a typed pointer to the structure containing the given member */ @@ -71,8 +71,8 @@ * process */ #define list_for_each_safe(pos, n, head) \ - for (pos = (head)->next, n = pos->next; pos != (head); \ - pos = n, n = pos->next) + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) /* Add a mapping between a previous and a next one */ static inline void list_add_between(struct mapping_list_t *new, @@ -95,21 +95,21 @@ static inline void list_add(struct mapping_list_t *new, static inline void list_add_tail(struct mapping_list_t *new, struct mapping_list_t *head) { - list_add_between(new, head->prev, head); + list_add_between(new, head->prev, head); } /* Delete a mapping between a previous and a next one */ static inline void list_delete_between(struct mapping_list_t *prev, struct mapping_list_t *next) { - next->prev = prev; - prev->next = next; + next->prev = prev; + prev->next = next; } /* Delete a mapping from the mapping list */ static inline void list_delete(struct mapping_list_t *entry) { - list_delete_between(entry->prev, entry->next); + list_delete_between(entry->prev, entry->next); } /* Initalize a mapping list */ diff --git a/termfix.c b/termfix.c index d1a1631..9d246fc 100644 --- a/termfix.c +++ b/termfix.c @@ -1,6 +1,6 @@ /* Copyright (C) 2020-2021 Vincent Buso - Copyright (C) 2020-2021 Michel Stempin + Copyright (C) 2021 Michel Stempin This file is part of the FunKey S GPIO keyboard daemon.