貌似找到了宕机的地方,进行修改

This commit is contained in:
anod 2022-10-14 12:02:48 +08:00
parent b19ca5d6c4
commit fc5a80339f

View File

@ -157,9 +157,9 @@ atp_error_t atp_show( atp_counter_t cnt, atp_lineprovider_t provider, atp_caller
static atp_error_t title_paint( atp_callerdata_t datain, atp_counter_t idx, atp_linecfg_t *config )
{
void **data = (void**)datain;
atp_text_t title = *(atp_text_t*)data[0];
uint8_t *title_offset = *(uint8_t**)data[1];
uint8_t **data = datain;
atp_text_t title = (atp_text_t)data[0];
uint8_t *title_offset = data[1];
for( atp_counter_t i=0; i < idx; ++i )
title += title_offset[i];
config->text = title;
@ -197,15 +197,17 @@ static void draw_options( int start_row, int start_idx, int option_cnt, int sele
#define SELECTED_ROW(top, len, sel) (((top) < (len)) ? ((len)-(top)+(sel)) : ((sel)+(len)-(top)))
#define REFRESH_PAGE { \
screen_clean();
if( idx_top < title_len ) \
{ \
void *title_data[2]; \
title_data[0] = (void*)title; \
uint8_t* title_data[2]; \
title_data[0] = (uint8_t*)title; \
title_data[1] = &title_offset[idx_top]; \
for( int i=0; i < idx_top; ++i ) \
{ \
title_data[0] = (void*)((atp_text_t)title_data[0] + title_offset[i]); \
title_data[0] += title_offset[i]; \
} \
container_paint( title_paint, (atp_callerdata_t)title_data, title_len-idx_top, idx_top ); \
draw_options( title_len - idx_top, 0, cnt, item_sel, provider, data ); \
} \
else draw_options( 0, idx_top - title_len, cnt, item_sel, provider, data ); \