Skip to content

Commit

Permalink
Merge pull request #123 from fornellas/fix_warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
olikraus committed Jan 1, 2020
2 parents 8030729 + a0203ed commit 73affe0
Show file tree
Hide file tree
Showing 20 changed files with 213 additions and 98 deletions.
8 changes: 6 additions & 2 deletions csrc/ucg_circle.c
Expand Up @@ -70,7 +70,9 @@ static void ucg_draw_circle_section(ucg_t *ucg, ucg_int_t x, ucg_int_t y, ucg_in
}
}

void ucg_draw_circle(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option)
static void ucg_draw_circle(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option);

static void ucg_draw_circle(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option)
{
ucg_int_t f;
ucg_int_t ddF_x;
Expand Down Expand Up @@ -159,7 +161,9 @@ static void ucg_draw_disc_section(ucg_t *ucg, ucg_int_t x, ucg_int_t y, ucg_int_
}
}

void ucg_draw_disc(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option)
static void ucg_draw_disc(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option);

static void ucg_draw_disc(ucg_t *ucg, ucg_int_t x0, ucg_int_t y0, ucg_int_t rad, uint8_t option)
{
ucg_int_t f;
ucg_int_t ddF_x;
Expand Down
11 changes: 9 additions & 2 deletions csrc/ucg_com_msg_api.c
Expand Up @@ -35,8 +35,15 @@

#include "ucg.h"

int16_t ucg_com_template_cb(ucg_t *ucg, int16_t msg, uint32_t arg, uint8_t *data)
static int16_t ucg_com_template_cb(ucg_t *ucg, int16_t msg, uint32_t arg, uint8_t *data);
static void ucg_com_SendStringP(ucg_t *ucg, uint16_t cnt, const ucg_pgm_uint8_t *byte_ptr);

static __attribute__((unused)) int16_t ucg_com_template_cb(ucg_t *ucg, int16_t msg, uint32_t arg, uint8_t *data)
{
(void)ucg;
(void)arg;
(void)data;

switch(msg)
{
case UCG_COM_MSG_POWER_UP:
Expand Down Expand Up @@ -179,7 +186,7 @@ void ucg_com_SendString(ucg_t *ucg, uint16_t cnt, const uint8_t *byte_ptr)
ucg->com_cb(ucg, UCG_COM_MSG_SEND_STR, cnt, (uint8_t *)byte_ptr);
}

void ucg_com_SendStringP(ucg_t *ucg, uint16_t cnt, const ucg_pgm_uint8_t *byte_ptr)
static void ucg_com_SendStringP(ucg_t *ucg, uint16_t cnt, const ucg_pgm_uint8_t *byte_ptr)
{
uint8_t b;
while( cnt > 0 )
Expand Down
8 changes: 6 additions & 2 deletions csrc/ucg_dev_default_cb.c
Expand Up @@ -59,6 +59,10 @@ ucg_int_t ucg_dev_default_cb(ucg_t *ucg, ucg_int_t msg, void *data)
*/
ucg_int_t ucg_ext_none(ucg_t *ucg, ucg_int_t msg, void *data)
{
(void)ucg;
(void)msg;
(void)data;

return 1; /* all ok */
}

Expand Down Expand Up @@ -217,7 +221,7 @@ ucg_int_t ucg_handle_l90se(ucg_t *ucg, ucg_dev_fnptr dev_cb)
if ( ucg_clip_l90se(ucg) != 0 )
{
ucg_int_t dx, dy;
ucg_int_t i, j;
ucg_int_t k, j;
switch(ucg->arg.dir)
{
case 0: dx = 1; dy = 0; break;
Expand All @@ -226,7 +230,7 @@ ucg_int_t ucg_handle_l90se(ucg_t *ucg, ucg_dev_fnptr dev_cb)
case 3: dx = 0; dy = -1; break;
default: dx = 1; dy = 0; break; /* avoid compiler warning */
}
for( i = 0; i < ucg->arg.len; i++ )
for( k = 0; k < ucg->arg.len; k++ )
{
ucg->arg.pixel.rgb.color[0] = ucg->arg.ccs_line[0].current;
ucg->arg.pixel.rgb.color[1] = ucg->arg.ccs_line[1].current;
Expand Down
21 changes: 15 additions & 6 deletions csrc/ucg_dev_ic_hx8352c.c
Expand Up @@ -37,6 +37,12 @@

#include "ucg.h"

static ucg_int_t ucg_handle_hx8352c_l90fx(ucg_t *ucg);
#ifdef UCG_MSG_DRAW_L90TC
static ucg_int_t ucg_handle_hx8352c_l90tc(ucg_t *ucg);
#endif
static ucg_int_t ucg_handle_hx8352c_l90se(ucg_t *ucg);

const ucg_pgm_uint8_t ucg_hx8352c_set_pos_seq[] =
{
UCG_CS(0), /* enable chip */
Expand Down Expand Up @@ -137,7 +143,7 @@ const ucg_pgm_uint8_t ucg_hx8352c_set_pos_dir3_seq[] =
UCG_DATA(), /* change to data mode */
UCG_END()};

ucg_int_t ucg_handle_hx8352c_l90fx(ucg_t *ucg)
static ucg_int_t ucg_handle_hx8352c_l90fx(ucg_t *ucg)
{
uint8_t c[3];
ucg_int_t tmp;
Expand Down Expand Up @@ -177,7 +183,8 @@ ucg_int_t ucg_handle_hx8352c_l90fx(ucg_t *ucg)
*/

/* with CmdDataSequence */
ucg_int_t ucg_handle_hx8352c_l90tc(ucg_t *ucg)
#ifdef UCG_MSG_DRAW_L90TC
static ucg_int_t ucg_handle_hx8352c_l90tc(ucg_t *ucg)
{
if (ucg_clip_l90tc(ucg) != 0)
{
Expand Down Expand Up @@ -274,8 +281,9 @@ ucg_int_t ucg_handle_hx8352c_l90tc(ucg_t *ucg)
}
return 0;
}
#endif

ucg_int_t ucg_handle_hx8352c_l90se(ucg_t *ucg)
static ucg_int_t ucg_handle_hx8352c_l90se(ucg_t *ucg)
{
uint8_t i;
uint8_t c[3];
Expand Down Expand Up @@ -303,7 +311,7 @@ ucg_int_t ucg_handle_hx8352c_l90se(ucg_t *ucg)

if (ucg_clip_l90se(ucg) != 0)
{
ucg_int_t i, j;
ucg_int_t k;
switch (ucg->arg.dir)
{
case 0:
Expand All @@ -327,8 +335,7 @@ ucg_int_t ucg_handle_hx8352c_l90se(ucg_t *ucg)
break;
}

j = 0;
for (i = 0; i < ucg->arg.len; i++)
for (k = 0; k < ucg->arg.len; k++)
{
c[0] = ucg->arg.ccs_line[0].current;
c[1] = ucg->arg.ccs_line[1].current;
Expand Down Expand Up @@ -403,6 +410,8 @@ ucg_int_t ucg_dev_ic_hx8352c_18(ucg_t *ucg, ucg_int_t msg, void *data)

ucg_int_t ucg_ext_hx8352c_18(ucg_t *ucg, ucg_int_t msg, void *data)
{
(void)data;

switch (msg)
{
case UCG_MSG_DRAW_L90SE:
Expand Down
20 changes: 14 additions & 6 deletions csrc/ucg_dev_ic_ili9163.c
Expand Up @@ -39,6 +39,11 @@ Code is for 128x128 display which is shifted by 32 pixel within the controller R

#include "ucg.h"

static ucg_int_t ucg_handle_ili9163_l90fx(ucg_t *ucg);
#ifdef UCG_MSG_DRAW_L90TC
static ucg_int_t ucg_handle_ili9163_l90tc(ucg_t *ucg);
#endif
static ucg_int_t ucg_handle_ili9163_l90se(ucg_t *ucg);

const ucg_pgm_uint8_t ucg_ili9163_set_pos_seq[] =
{
Expand Down Expand Up @@ -122,7 +127,7 @@ const ucg_pgm_uint8_t ucg_ili9163_set_pos_dir3_seq[] =
UCG_END()
};

ucg_int_t ucg_handle_ili9163_l90fx(ucg_t *ucg)
static ucg_int_t ucg_handle_ili9163_l90fx(ucg_t *ucg)
{
uint8_t c[3];
ucg_int_t tmp;
Expand Down Expand Up @@ -172,8 +177,9 @@ ucg_int_t ucg_handle_ili9163_l90fx(ucg_t *ucg)
*/

#ifdef UCG_MSG_DRAW_L90TC
/* with CmdDataSequence */
ucg_int_t ucg_handle_ili9163_l90tc(ucg_t *ucg)
static ucg_int_t ucg_handle_ili9163_l90tc(ucg_t *ucg)
{
if ( ucg_clip_l90tc(ucg) != 0 )
{
Expand Down Expand Up @@ -262,9 +268,9 @@ ucg_int_t ucg_handle_ili9163_l90tc(ucg_t *ucg)
}
return 0;
}
#endif


ucg_int_t ucg_handle_ili9163_l90se(ucg_t *ucg)
static ucg_int_t ucg_handle_ili9163_l90se(ucg_t *ucg)
{
uint8_t i;
uint8_t c[3];
Expand All @@ -281,7 +287,7 @@ ucg_int_t ucg_handle_ili9163_l90se(ucg_t *ucg)

if ( ucg_clip_l90se(ucg) != 0 )
{
ucg_int_t i;
ucg_int_t k;
switch(ucg->arg.dir)
{
case 0:
Expand Down Expand Up @@ -311,7 +317,7 @@ ucg_int_t ucg_handle_ili9163_l90se(ucg_t *ucg)
break;
}

for( i = 0; i < ucg->arg.len; i++ )
for( k = 0; k < ucg->arg.len; k++ )
{
c[0] = ucg->arg.ccs_line[0].current;
c[1] = ucg->arg.ccs_line[1].current;
Expand Down Expand Up @@ -391,6 +397,8 @@ ucg_int_t ucg_dev_ic_ili9163_18(ucg_t *ucg, ucg_int_t msg, void *data)

ucg_int_t ucg_ext_ili9163_18(ucg_t *ucg, ucg_int_t msg, void *data)
{
(void)data;

switch(msg)
{
case UCG_MSG_DRAW_L90SE:
Expand Down
12 changes: 8 additions & 4 deletions csrc/ucg_dev_ic_ili9325.c
Expand Up @@ -37,6 +37,7 @@

#include "ucg.h"

static ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg);

static const ucg_pgm_uint8_t ucg_ili9325_set_pos_seq[] =
{
Expand Down Expand Up @@ -172,7 +173,7 @@ static const ucg_pgm_uint8_t ucg_ili9325_set_y_pos_seq[] =
};

/* without CmdDataSequence */
ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
static __attribute__((unused)) ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
{
if ( ucg_clip_l90tc(ucg) != 0 )
{
Expand Down Expand Up @@ -236,7 +237,7 @@ ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
return 0;
}


#ifdef UCG_MSG_DRAW_L90TC
/* with CmdDataSequence */
static ucg_int_t ucg_handle_ili9325_l90tc(ucg_t *ucg)
{
Expand Down Expand Up @@ -366,6 +367,7 @@ static ucg_int_t ucg_handle_ili9325_l90tc(ucg_t *ucg)
}
return 0;
}
#endif


static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)
Expand All @@ -384,7 +386,7 @@ static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)

if ( ucg_clip_l90se(ucg) != 0 )
{
ucg_int_t i;
ucg_int_t k;
switch(ucg->arg.dir)
{
case 0:
Expand All @@ -402,7 +404,7 @@ static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)
break;
}

for( i = 0; i < ucg->arg.len; i++ )
for( k = 0; k < ucg->arg.len; k++ )
{
c[0] = ucg->arg.ccs_line[0].current;
c[1] = ucg->arg.ccs_line[1].current;
Expand Down Expand Up @@ -473,6 +475,8 @@ ucg_int_t ucg_dev_ic_ili9325_18(ucg_t *ucg, ucg_int_t msg, void *data)

ucg_int_t ucg_ext_ili9325_18(ucg_t *ucg, ucg_int_t msg, void *data)
{
(void)data;

switch(msg)
{
case UCG_MSG_DRAW_L90SE:
Expand Down
12 changes: 7 additions & 5 deletions csrc/ucg_dev_ic_ili9325_spi.c
Expand Up @@ -173,7 +173,7 @@ static const ucg_pgm_uint8_t ucg_ili9325_set_y_pos_seq[] =
};

/* without CmdDataSequence */
static ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
static __attribute__((unused)) ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
{
if ( ucg_clip_l90tc(ucg) != 0 )
{
Expand Down Expand Up @@ -237,7 +237,7 @@ static ucg_int_t xxxxxx_ucg_handle_ili9325_l90tc(ucg_t *ucg)
return 0;
}


#ifdef UCG_MSG_DRAW_L90TC
/* with CmdDataSequence */
static ucg_int_t ucg_handle_ili9325_l90tc(ucg_t *ucg)
{
Expand Down Expand Up @@ -367,7 +367,7 @@ static ucg_int_t ucg_handle_ili9325_l90tc(ucg_t *ucg)
}
return 0;
}

#endif

static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)
{
Expand All @@ -385,7 +385,7 @@ static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)

if ( ucg_clip_l90se(ucg) != 0 )
{
ucg_int_t i;
ucg_int_t k;
switch(ucg->arg.dir)
{
case 0:
Expand All @@ -403,7 +403,7 @@ static ucg_int_t ucg_handle_ili9325_l90se(ucg_t *ucg)
break;
}

for( i = 0; i < ucg->arg.len; i++ )
for( k = 0; k < ucg->arg.len; k++ )
{
c[0] = ucg->arg.ccs_line[0].current;
c[1] = ucg->arg.ccs_line[1].current;
Expand Down Expand Up @@ -473,6 +473,8 @@ ucg_int_t ucg_dev_ic_ili9325_spi_18(ucg_t *ucg, ucg_int_t msg, void *data)

ucg_int_t ucg_ext_ili9325_spi_18(ucg_t *ucg, ucg_int_t msg, void *data)
{
(void)data;

switch(msg)
{
case UCG_MSG_DRAW_L90SE:
Expand Down

0 comments on commit 73affe0

Please sign in to comment.