Replace int pow(2, x) in pico unicorn

Using double pow here seems a bit inefficient (even if it's init code)
This commit is contained in:
Charlie Birks 2022-05-23 14:07:31 +01:00 committed by GitHub
parent b9a8c0a536
commit a4f91a93ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ namespace pimoroni {
uint8_t row_select_mask = ~(1 << (7 - row));
bitstream[row_select_offset] = row_select_mask;
uint16_t bcd_ticks = pow(2, frame);
uint16_t bcd_ticks = 1 << frame;
bitstream[bcd_offset + 1] = (bcd_ticks & 0xff00) >> 8;
bitstream[bcd_offset] = (bcd_ticks & 0xff);
}