From 66e53b7e54878e2161f5c0dab6f90aebd9a1d97a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 8 Apr 2021 02:27:15 +0200 Subject: added board.h --- fw/fe310/eos/eve/widget/selectw.c | 20 ++++++++++---------- fw/fe310/eos/eve/widget/strw.c | 14 +++++++------- fw/fe310/eos/eve/widget/textw.c | 20 ++++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) (limited to 'fw/fe310/eos/eve/widget') diff --git a/fw/fe310/eos/eve/widget/selectw.c b/fw/fe310/eos/eve/widget/selectw.c index 7873e95..46ed3d1 100644 --- a/fw/fe310/eos/eve/widget/selectw.c +++ b/fw/fe310/eos/eve/widget/selectw.c @@ -16,7 +16,7 @@ #define DIVC(x,y) ((x) / (y) + ((x) % (y) != 0)) -static int _selectw_verify(utf8_t *option, uint16_t option_size) { +static int selectw_verify(utf8_t *option, uint16_t option_size) { int o_len; uint16_t o_curr; int rv; @@ -32,7 +32,7 @@ static int _selectw_verify(utf8_t *option, uint16_t option_size) { return EVE_OK; } -static int _selectw_count(EVESelectWidget *widget) { +static int selectw_count(EVESelectWidget *widget) { int o_len; int o_curr; int i; @@ -51,7 +51,7 @@ static int _selectw_count(EVESelectWidget *widget) { return i; } -static void _selectw_update_sz(EVESelectWidget *widget, int uievt) { +static void selectw_update_sz(EVESelectWidget *widget, int uievt) { EVEWidget *_widget = &widget->w; EVEPage *page = _widget->page; @@ -81,12 +81,12 @@ void eve_selectw_init(EVESelectWidget *widget, EVERect *g, EVEPage *page, EVEFon memset(widget, 0, sizeof(EVESelectWidget)); eve_widget_init(_widget, EVE_WIDGET_TYPE_SELECT, g, page, eve_selectw_draw, eve_selectw_touch, NULL); widget->font = font; - rv = _selectw_verify(option, option_size); + rv = selectw_verify(option, option_size); if (rv == EVE_OK) { widget->option = option; widget->option_size = option_size; - widget->option_count = _selectw_count(widget); - _selectw_update_sz(widget, 0); + widget->option_count = selectw_count(widget); + selectw_update_sz(widget, 0); } widget->multi = multi; widget->select = widget->multi ? 0 : SELECTW_NOSELECT; @@ -226,7 +226,7 @@ int eve_selectw_option_add(EVESelectWidget *widget, utf8_t *option) { strcpy(widget->option + o_curr, option); widget->option_count = i + 1; - _selectw_update_sz(widget, 1); + selectw_update_sz(widget, 1); return EVE_OK; } @@ -234,15 +234,15 @@ int eve_selectw_option_add(EVESelectWidget *widget, utf8_t *option) { int eve_selectw_option_set(EVESelectWidget *widget, utf8_t *option, uint16_t option_size) { int rv, i; - rv = _selectw_verify(option, option_size); + rv = selectw_verify(option, option_size); if (rv) return rv; if (option_size > widget->option_size) return EVE_ERR_FULL; memcpy(widget->option, option, option_size); memset(widget->option + option_size, 0, widget->option_size - option_size); - widget->option_count = _selectw_count(widget); - _selectw_update_sz(widget, 1); + widget->option_count = selectw_count(widget); + selectw_update_sz(widget, 1); return EVE_OK; } diff --git a/fw/fe310/eos/eve/widget/strw.c b/fw/fe310/eos/eve/widget/strw.c index b169adb..232e52c 100644 --- a/fw/fe310/eos/eve/widget/strw.c +++ b/fw/fe310/eos/eve/widget/strw.c @@ -90,7 +90,7 @@ static EVEStrCursor *cursor_prox(EVEStrWidget *widget, EVEStrCursor *cursor, EVE return NULL; } -static void _draw_str(EVEStrWidget *widget, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) { +static void draw_string(EVEStrWidget *widget, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) { int16_t x; EVEWidget *_widget = &widget->w; EVEPage *page = _widget->page; @@ -116,7 +116,7 @@ static void _draw_str(EVEStrWidget *widget, uint16_t ch, uint16_t len, uint16_t } } -static void _draw_cursor(EVEStrWidget *widget, EVEStrCursor *cursor) { +static void draw_cursor(EVEStrWidget *widget, EVEStrCursor *cursor) { uint16_t x, y; EVEWidget *_widget = &widget->w; @@ -187,12 +187,12 @@ uint8_t eve_strw_draw(EVEWidget *_widget, uint8_t tag0) { l1 = c1->ch; l2 = c2->ch - c1->ch; l3 = widget->str_len - c2->ch; - _draw_str(widget, 0, l1, 0, c1->x, 0); - _draw_str(widget, c1->ch, l2, c1->x, c2->x, 1); - _draw_str(widget, c2->ch, l3, c2->x, widget->str_g.x + _widget->g.w, 0); + draw_string(widget, 0, l1, 0, c1->x, 0); + draw_string(widget, c1->ch, l2, c1->x, c2->x, 1); + draw_string(widget, c2->ch, l3, c2->x, widget->str_g.x + _widget->g.w, 0); } else { - if (widget->cursor1.on) _draw_cursor(widget, &widget->cursor1); - _draw_str(widget, 0, widget->str_len, 0, widget->str_g.x + _widget->g.w, 0); + if (widget->cursor1.on) draw_cursor(widget, &widget->cursor1); + draw_string(widget, 0, widget->str_len, 0, widget->str_g.x + _widget->g.w, 0); } if (cut) { diff --git a/fw/fe310/eos/eve/widget/textw.c b/fw/fe310/eos/eve/widget/textw.c index abf2a68..e994c0e 100644 --- a/fw/fe310/eos/eve/widget/textw.c +++ b/fw/fe310/eos/eve/widget/textw.c @@ -107,7 +107,7 @@ static EVETextCursor *cursor_prox(EVETextWidget *widget, EVETextCursor *cursor, return NULL; } -static void _draw_line(EVETextWidget *widget, uint16_t l, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) { +static void draw_line(EVETextWidget *widget, uint16_t l, uint16_t ch, uint16_t len, uint16_t x1, uint16_t x2, char s) { EVEWidget *_widget = &widget->w; EVEPage *page = _widget->page; @@ -131,7 +131,7 @@ static void _draw_line(EVETextWidget *widget, uint16_t l, uint16_t ch, uint16_t } } -static void _draw_cursor(EVETextWidget *widget, EVETextCursor *cursor) { +static void draw_cursor(EVETextWidget *widget, EVETextCursor *cursor) { uint16_t x, y; EVEWidget *_widget = &widget->w; @@ -198,10 +198,10 @@ uint8_t eve_textw_draw(EVEWidget *_widget, uint8_t tag0) { l3 = 0; s = 1; } - _draw_line(widget, i, LINE_START(widget, i), l1, 0, c1->x, 0); - _draw_line(widget, i, c1->ch, l2, c1->x, s ? _widget->g.w : c2->x, 1); + draw_line(widget, i, LINE_START(widget, i), l1, 0, c1->x, 0); + draw_line(widget, i, c1->ch, l2, c1->x, s ? _widget->g.w : c2->x, 1); if (!s) { - _draw_line(widget, i, c2->ch, l3, c2->x, _widget->g.w, 0); + draw_line(widget, i, c2->ch, l3, c2->x, _widget->g.w, 0); c1 = NULL; c2 = NULL; } @@ -209,14 +209,14 @@ uint8_t eve_textw_draw(EVEWidget *_widget, uint8_t tag0) { int l1 = c2->ch - LINE_START(widget, i); int l2 = LINE_START(widget, i) + LINE_LEN(widget, i) - c2->ch; - _draw_line(widget, i, LINE_START(widget, i), l1, 0, c2->x, 1); - _draw_line(widget, i, c2->ch, l2, c2->x, _widget->g.w, 0); + draw_line(widget, i, LINE_START(widget, i), l1, 0, c2->x, 1); + draw_line(widget, i, c2->ch, l2, c2->x, _widget->g.w, 0); c1 = NULL; c2 = NULL; s = 0; } else { - if (widget->cursor1.on && (widget->cursor1.line == i)) _draw_cursor(widget, &widget->cursor1); - _draw_line(widget, i, LINE_START(widget, i), LINE_LEN(widget, i), 0, _widget->g.w, s); + if (widget->cursor1.on && (widget->cursor1.line == i)) draw_cursor(widget, &widget->cursor1); + draw_line(widget, i, LINE_START(widget, i), LINE_LEN(widget, i), 0, _widget->g.w, s); } } if (lineNvisible) { @@ -225,7 +225,7 @@ uint8_t eve_textw_draw(EVEWidget *_widget, uint8_t tag0) { eve_touch_set_opt(_widget->tagN, TEXTW_TOUCH_OPT); _widget->tagN++; } - _draw_line(widget, lineN, 0, 0, 0, _widget->g.w, 0); + draw_line(widget, lineN, 0, 0, 0, _widget->g.w, 0); } } else { widget->line0 = 0; -- cgit v1.2.3