Skip to content

Commit baec561

Browse files
committed
src/lightgrid: remove unnecessary cast
In C, anything smaller than int is promoted to int for math ops.
1 parent f95b705 commit baec561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/pbio/src/lightgrid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pbio_error_t pbio_lightgrid_set_pixel(pbio_lightgrid_t *lightgrid, uint8_t row,
8383
}
8484

8585
// Scale brightness quadratically from 0 to UINT16_MAX
86-
int32_t duty = ((int32_t)brightness) * brightness * UINT16_MAX / 10000;
86+
int32_t duty = brightness * brightness * UINT16_MAX / 10000;
8787

8888
return pbdrv_pwm_set_duty(lightgrid->pwm, lightgrid->data->channels[row * size + col], duty);
8989
}

0 commit comments

Comments
 (0)