Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Nov 21, 2024
1 parent a317cc7 commit f09acb4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pokemon_trading/src/include/pokemon_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct pokemon_fap {
PokemonData* pdata;

/* gblink interface */
void *gblink_handle;
void* gblink_handle;
};

typedef struct pokemon_fap PokemonFap;
Expand Down
32 changes: 24 additions & 8 deletions pokemon_trading/src/scenes/pokemon_pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pokemon_trading/src/views/trade.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion pokemon_trading/src/views/trade.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

void* trade_alloc(
PokemonData* pdata,
void *gblink_handle,
void* gblink_handle,
ViewDispatcher* view_dispatcher,
uint32_t view_id);

Expand Down

0 comments on commit f09acb4

Please sign in to comment.