Skip to content

Commit

Permalink
SUKU gracefully handle steps=0
Browse files Browse the repository at this point in the history
  • Loading branch information
SukuWc committed Sep 16, 2024
1 parent aac0bcf commit 40dcd18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions grid_common/grid_ui_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void grid_ui_button_store_input(uint8_t input_channel, uint64_t* last_real_time,
" GRID_LUA_FNC_B_BUTTON_STEP_short " =function (self) " \
"local steps, min, max, value = self:" GRID_LUA_FNC_B_BUTTON_MODE_short "(), self:" GRID_LUA_FNC_B_BUTTON_MIN_short "(), self:" GRID_LUA_FNC_B_BUTTON_MAX_short \
"(), self:" GRID_LUA_FNC_B_BUTTON_VALUE_short "() " \
"if steps == 0 then return false end " \
"return value // ((max - min) // steps) " \
"end, \
\
Expand Down
1 change: 1 addition & 0 deletions grid_common/grid_ui_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ void grid_ui_encoder_store_input(uint8_t input_channel, uint64_t* encoder_last_r
" GRID_LUA_FNC_E_BUTTON_STEP_short " =function (self) " \
"local steps, min, max, value = self:" GRID_LUA_FNC_B_BUTTON_MODE_short "(), self:" GRID_LUA_FNC_B_BUTTON_MIN_short "(), self:" GRID_LUA_FNC_B_BUTTON_MAX_short \
"(), self:" GRID_LUA_FNC_B_BUTTON_VALUE_short "() " \
"if steps == 0 then return false end " \
"return value // ((max - min) // steps) " \
"end, \
\
Expand Down

0 comments on commit 40dcd18

Please sign in to comment.