@@ -17,17 +17,17 @@ typedef struct {
1717typedef struct {
1818 const char * header ;
1919 uint8_t * bytes ;
20- uint16_t bytes_count ;
20+ uint8_t bytes_count ;
2121
2222 ByteInputCallback input_callback ;
2323 ByteChangedCallback changed_callback ;
2424 void * callback_context ;
2525
2626 bool selected_high_nibble ;
27- uint16_t selected_byte ;
27+ uint8_t selected_byte ;
2828 int8_t selected_row ; // row -1 - input, row 0 & 1 - keyboard
2929 uint8_t selected_column ;
30- uint16_t first_visible_byte ;
30+ uint8_t first_visible_byte ;
3131} ByteInputModel ;
3232
3333static const uint8_t keyboard_origin_x = 7 ;
@@ -164,7 +164,7 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) {
164164 canvas_draw_icon (canvas , 2 , 19 , & I_ButtonLeftSmall_3x5 );
165165 canvas_draw_icon (canvas , 123 , 19 , & I_ButtonRightSmall_3x5 );
166166
167- for (uint16_t i = model -> first_visible_byte ;
167+ for (uint8_t i = model -> first_visible_byte ;
168168 i < model -> first_visible_byte + MIN (model -> bytes_count , max_drawable_bytes );
169169 i ++ ) {
170170 uint8_t byte_position = i - model -> first_visible_byte ;
@@ -253,7 +253,7 @@ static void byte_input_draw_input_selected(Canvas* canvas, ByteInputModel* model
253253 canvas_draw_icon (canvas , 2 , 19 , & I_ButtonLeftSmall_3x5 );
254254 canvas_draw_icon (canvas , 122 , 19 , & I_ButtonRightSmall_3x5 );
255255
256- for (uint16_t i = model -> first_visible_byte ;
256+ for (uint8_t i = model -> first_visible_byte ;
257257 i < model -> first_visible_byte + MIN (model -> bytes_count , max_drawable_bytes );
258258 i ++ ) {
259259 uint8_t byte_position = i - model -> first_visible_byte ;
@@ -305,7 +305,7 @@ static void byte_input_draw_input_selected(Canvas* canvas, ByteInputModel* model
305305 * @param value char value
306306 * @param high_nibble set high nibble
307307 */
308- static void byte_input_set_nibble (uint8_t * data , uint16_t position , char value , bool high_nibble ) {
308+ static void byte_input_set_nibble (uint8_t * data , uint8_t position , char value , bool high_nibble ) {
309309 switch (value ) {
310310 case '0' :
311311 case '1' :
@@ -750,7 +750,7 @@ void byte_input_set_result_callback(
750750 ByteChangedCallback changed_callback ,
751751 void * callback_context ,
752752 uint8_t * bytes ,
753- uint16_t bytes_count ) {
753+ uint8_t bytes_count ) {
754754 with_view_model (
755755 byte_input -> view ,
756756 ByteInputModel * model ,
0 commit comments