From f09acb4b3ae13a8a43f38a042483836776b37ebb Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Thu, 21 Nov 2024 06:58:50 +0000 Subject: [PATCH] Format --- pokemon_trading/src/include/pokemon_app.h | 2 +- pokemon_trading/src/scenes/pokemon_pins.c | 32 +++++++++++++++++------ pokemon_trading/src/views/trade.c | 2 +- pokemon_trading/src/views/trade.h | 2 +- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/pokemon_trading/src/include/pokemon_app.h b/pokemon_trading/src/include/pokemon_app.h index e1f73fcf0..33617ff40 100644 --- a/pokemon_trading/src/include/pokemon_app.h +++ b/pokemon_trading/src/include/pokemon_app.h @@ -36,7 +36,7 @@ struct pokemon_fap { PokemonData* pdata; /* gblink interface */ - void *gblink_handle; + void* gblink_handle; }; typedef struct pokemon_fap PokemonFap; diff --git a/pokemon_trading/src/scenes/pokemon_pins.c b/pokemon_trading/src/scenes/pokemon_pins.c index bb319849b..c5fb308cc 100644 --- a/pokemon_trading/src/scenes/pokemon_pins.c +++ b/pokemon_trading/src/scenes/pokemon_pins.c @@ -33,7 +33,7 @@ static void select_pins_pin_callback(VariableItem* item) { uint8_t which = variable_item_list_get_selected_item_index(pokemon_fap->variable_item_list); gblink_bus_pins pin; - switch (which) { + switch(which) { case 1: // SI pin = PIN_SERIN; break; @@ -48,7 +48,7 @@ static void select_pins_pin_callback(VariableItem* item) { break; } - if (index > gblink_pin_get(pokemon_fap->gblink_handle, pin)) + if(index > gblink_pin_get(pokemon_fap->gblink_handle, pin)) index = gblink_pin_get_next(index); else index = gblink_pin_get_prev(index); @@ -60,29 +60,45 @@ static void select_pins_pin_callback(VariableItem* item) { static void select_pins_rebuild_list(PokemonFap* pokemon_fap, int mode) { int pinnum; int pinmax = gblink_pin_count_max() + 1; - VariableItem *item; - + VariableItem* item; + variable_item_list_reset(pokemon_fap->variable_item_list); item = variable_item_list_add( - pokemon_fap->variable_item_list, "Mode", PINOUT_COUNT+1, select_pins_default_callback, pokemon_fap); + pokemon_fap->variable_item_list, + "Mode", + PINOUT_COUNT + 1, + select_pins_default_callback, + pokemon_fap); variable_item_set_current_value_index(item, mode); variable_item_set_current_value_text(item, named_groups[mode]); item = variable_item_list_add( - pokemon_fap->variable_item_list, "SI:", (mode < PINOUT_COUNT) ? 1 : pinmax, select_pins_pin_callback, pokemon_fap); + pokemon_fap->variable_item_list, + "SI:", + (mode < PINOUT_COUNT) ? 1 : pinmax, + select_pins_pin_callback, + pokemon_fap); pinnum = gblink_pin_get(pokemon_fap->gblink_handle, PIN_SERIN); variable_item_set_current_value_index(item, (mode < PINOUT_COUNT) ? 0 : pinnum); variable_item_set_current_value_text(item, gpio_pins[pinnum].name); item = variable_item_list_add( - pokemon_fap->variable_item_list, "SO:", (mode < PINOUT_COUNT) ? 1 : pinmax, select_pins_pin_callback, pokemon_fap); + pokemon_fap->variable_item_list, + "SO:", + (mode < PINOUT_COUNT) ? 1 : pinmax, + select_pins_pin_callback, + pokemon_fap); pinnum = gblink_pin_get(pokemon_fap->gblink_handle, PIN_SEROUT); variable_item_set_current_value_index(item, (mode < PINOUT_COUNT) ? 0 : pinnum); variable_item_set_current_value_text(item, gpio_pins[pinnum].name); item = variable_item_list_add( - pokemon_fap->variable_item_list, "CLK:", (mode < PINOUT_COUNT) ? 1 : pinmax, select_pins_pin_callback, pokemon_fap); + pokemon_fap->variable_item_list, + "CLK:", + (mode < PINOUT_COUNT) ? 1 : pinmax, + select_pins_pin_callback, + pokemon_fap); pinnum = gblink_pin_get(pokemon_fap->gblink_handle, PIN_CLK); variable_item_set_current_value_index(item, (mode < PINOUT_COUNT) ? 0 : pinnum); variable_item_set_current_value_text(item, gpio_pins[pinnum].name); diff --git a/pokemon_trading/src/views/trade.c b/pokemon_trading/src/views/trade.c index 1f193dcef..7791731c9 100644 --- a/pokemon_trading/src/views/trade.c +++ b/pokemon_trading/src/views/trade.c @@ -917,7 +917,7 @@ void trade_exit_callback(void* context) { void* trade_alloc( PokemonData* pdata, - void *gblink_handle, + void* gblink_handle, ViewDispatcher* view_dispatcher, uint32_t view_id) { furi_assert(pdata); diff --git a/pokemon_trading/src/views/trade.h b/pokemon_trading/src/views/trade.h index a07483eae..87b037049 100644 --- a/pokemon_trading/src/views/trade.h +++ b/pokemon_trading/src/views/trade.h @@ -8,7 +8,7 @@ void* trade_alloc( PokemonData* pdata, - void *gblink_handle, + void* gblink_handle, ViewDispatcher* view_dispatcher, uint32_t view_id);