Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions examples/lp503x/lp503x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int lp503x_cmd_set_individual_mode(FAR char *parg)

static int lp503x_cmd_set_banka_colour(FAR char *parg)
{
uint8_t requested_colour;
int requested_colour;

requested_colour = atoi(parg);

Expand All @@ -369,7 +369,7 @@ static int lp503x_cmd_set_banka_colour(FAR char *parg)

static int lp503x_cmd_set_bankb_colour(FAR char *parg)
{
uint8_t requested_colour;
int requested_colour;

requested_colour = atoi(parg);

Expand All @@ -388,7 +388,7 @@ static int lp503x_cmd_set_bankb_colour(FAR char *parg)

static int lp503x_cmd_set_bankc_colour(FAR char *parg)
{
uint8_t requested_colour;
int requested_colour;

requested_colour = atoi(parg);

Expand Down Expand Up @@ -417,7 +417,7 @@ static int lp503x_cmd_brightness(FAR char *parg)
int lednum;
int requested_brightness;

requested_brightness = ((int)strtol(parg, NULL, 0)) & 0xff;
requested_brightness = (int)strtol(parg, NULL, 0);
if ((requested_brightness > 255) || (requested_brightness < 0))
{
printf("ERROR: brightness must be in range 0..255\n");
Expand Down Expand Up @@ -516,7 +516,7 @@ static int lp503x_cmd_pattern(FAR char *parg)
static int lp503x_cmd_set_bank_brightness(FAR char *parg)
{
int bank_brightness;
if (parg != NULL || *parg != '\0')
if (parg != NULL && *parg != '\0')
{
bank_brightness = atoi(parg);

Expand Down Expand Up @@ -546,7 +546,7 @@ static int lp503x_cmd_set_bank_brightness(FAR char *parg)
static int lp503x_cmd_setcolour(FAR char *parg)
{
int colour;
if (parg == NULL || *parg != '\0')
if (parg == NULL || *parg == '\0')
{
printf("current colour is: 0x%06x\n", current_colour);
}
Expand Down Expand Up @@ -650,9 +650,9 @@ int main(int argc, FAR char *argv[])

len = readline_stream(buffer, sizeof(buffer),
stdin, stdout);
buffer[len] = '\0';
if (len > 0)
{
buffer[len] = '\0';
if (strncmp(buffer, "!", 1) != 0)
{
/* a command */
Expand Down
Loading