Skip to content

Commit

Permalink
samples drivers led: Fix main return
Browse files Browse the repository at this point in the history
Since 3a19793
main() should be int main(void) instead of void main(void)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar authored and fabiobaltieri committed Aug 9, 2023
1 parent 5d1eae6 commit b40c052
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions samples/drivers/led_is31fl3733/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,28 @@ static int led_on_off(const struct device *led)

const struct device *led_dev = DEVICE_DT_GET_ONE(issi_is31fl3733);

void main(void)
int main(void)
{
int ret;
int current_limit = 0xFF;

if (!device_is_ready(led_dev)) {
printk("Error- LED device is not ready\n");
return;
return 0;
}

while (1) {
ret = led_channel_write(led_dev);
if (ret < 0) {
return;
return 0;
}
ret = led_brightness(led_dev);
if (ret < 0) {
return;
return 0;
}
ret = led_on_off(led_dev);
if (ret < 0) {
return;
return 0;
}
if (current_limit == 0xFF) {
/* Select lower current limt */
Expand All @@ -140,7 +140,7 @@ void main(void)
ret = is31fl3733_current_limit(led_dev, current_limit);
if (ret) {
printk("Could not set LED current limit (%d)\n", ret);
return;
return 0;
}
} else {
/* Select higher current limt */
Expand All @@ -149,7 +149,7 @@ void main(void)
ret = is31fl3733_current_limit(led_dev, current_limit);
if (ret) {
printk("Could not set LED current limit (%d)\n", ret);
return;
return 0;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion samples/drivers/led_lp50xx/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static int run_test(const struct device *const lp50xx_dev,
return 0;
}

void main(void)
int main(void)
{
const struct device *lp50xx_dev;
bool found = false;
Expand Down Expand Up @@ -434,4 +434,5 @@ void main(void)
if (!found) {
LOG_ERR("No LP50XX LED controller found");
}
return 0;
}

0 comments on commit b40c052

Please sign in to comment.