diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 6 | ||||
-rw-r--r-- | firmware/drivers/ata_mmc.c | 2 | ||||
-rw-r--r-- | firmware/drivers/lcd-1bit-vert.c | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 88633f0ec9..adc720eaf8 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -1268,7 +1268,7 @@ static int set_multiple_mode(int sectors) | |||
1268 | #ifdef HAVE_ATA_DMA | 1268 | #ifdef HAVE_ATA_DMA |
1269 | static int get_best_mode(unsigned short identword, int max, int modetype) | 1269 | static int get_best_mode(unsigned short identword, int max, int modetype) |
1270 | { | 1270 | { |
1271 | unsigned short testbit = 1u << max; | 1271 | unsigned short testbit = BIT_N(max); |
1272 | 1272 | ||
1273 | while (1) { | 1273 | while (1) { |
1274 | if (identword & testbit) | 1274 | if (identword & testbit) |
@@ -1335,7 +1335,7 @@ static int set_features(void) | |||
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) { | 1337 | for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) { |
1338 | if (identify_info[features[i].id_word] & (1u << features[i].id_bit)) { | 1338 | if (identify_info[features[i].id_word] & BIT_N(features[i].id_bit)) { |
1339 | SET_REG(ATA_FEATURE, features[i].subcommand); | 1339 | SET_REG(ATA_FEATURE, features[i].subcommand); |
1340 | SET_REG(ATA_NSECTOR, features[i].parameter); | 1340 | SET_REG(ATA_NSECTOR, features[i].parameter); |
1341 | SET_REG(ATA_COMMAND, CMD_SET_FEATURES); | 1341 | SET_REG(ATA_COMMAND, CMD_SET_FEATURES); |
@@ -1461,7 +1461,7 @@ int ata_init(void) | |||
1461 | #ifdef MAX_PHYS_SECTOR_SIZE | 1461 | #ifdef MAX_PHYS_SECTOR_SIZE |
1462 | /* Find out the physical sector size */ | 1462 | /* Find out the physical sector size */ |
1463 | if((identify_info[106] & 0xe000) == 0x6000) | 1463 | if((identify_info[106] & 0xe000) == 0x6000) |
1464 | phys_sector_mult = 1 << (identify_info[106] & 0x000f); | 1464 | phys_sector_mult = BIT_N(identify_info[106] & 0x000f); |
1465 | else | 1465 | else |
1466 | phys_sector_mult = 1; | 1466 | phys_sector_mult = 1; |
1467 | 1467 | ||
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 5104f8cf97..3396149602 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -450,7 +450,7 @@ static int initialize_card(int card_no) | |||
450 | card->tsac = card->tsac * exponent[taac_exp] / 10; | 450 | card->tsac = card->tsac * exponent[taac_exp] / 10; |
451 | 451 | ||
452 | /* r2w_factor, write timeout */ | 452 | /* r2w_factor, write timeout */ |
453 | card->r2w_factor = 1 << card_extract_bits(card->csd, 99, 3); | 453 | card->r2w_factor = BIT_N(card_extract_bits(card->csd, 99, 3)); |
454 | card->write_timeout = card->read_timeout * card->r2w_factor; | 454 | card->write_timeout = card->read_timeout * card->r2w_factor; |
455 | 455 | ||
456 | if (card->r2w_factor > 32) /* Such cards often need extra read delay */ | 456 | if (card->r2w_factor > 32) /* Such cards often need extra read delay */ |
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c index b09ce0e76d..5fb652431c 100644 --- a/firmware/drivers/lcd-1bit-vert.c +++ b/firmware/drivers/lcd-1bit-vert.c | |||
@@ -155,17 +155,17 @@ int LCDFN(getstringsize)(const unsigned char *str, int *w, int *h) | |||
155 | 155 | ||
156 | static void setpixel(int x, int y) | 156 | static void setpixel(int x, int y) |
157 | { | 157 | { |
158 | LCDFN(framebuffer)[y>>3][x] |= 1 << (y & 7); | 158 | LCDFN(framebuffer)[y>>3][x] |= BIT_N(y & 7); |
159 | } | 159 | } |
160 | 160 | ||
161 | static void clearpixel(int x, int y) | 161 | static void clearpixel(int x, int y) |
162 | { | 162 | { |
163 | LCDFN(framebuffer)[y>>3][x] &= ~(1 << (y & 7)); | 163 | LCDFN(framebuffer)[y>>3][x] &= ~BIT_N(y & 7); |
164 | } | 164 | } |
165 | 165 | ||
166 | static void flippixel(int x, int y) | 166 | static void flippixel(int x, int y) |
167 | { | 167 | { |
168 | LCDFN(framebuffer)[y>>3][x] ^= 1 << (y & 7); | 168 | LCDFN(framebuffer)[y>>3][x] ^= BIT_N(y & 7); |
169 | } | 169 | } |
170 | 170 | ||
171 | static void nopixel(int x, int y) | 171 | static void nopixel(int x, int y) |
@@ -401,7 +401,7 @@ void LCDFN(hline)(int x1, int x2, int y) | |||
401 | 401 | ||
402 | bfunc = LCDFN(blockfuncs)[current_vp->drawmode]; | 402 | bfunc = LCDFN(blockfuncs)[current_vp->drawmode]; |
403 | dst = &LCDFN(framebuffer)[y>>3][x1]; | 403 | dst = &LCDFN(framebuffer)[y>>3][x1]; |
404 | mask = 1 << (y & 7); | 404 | mask = BIT_N(y & 7); |
405 | 405 | ||
406 | dst_end = dst + width; | 406 | dst_end = dst + width; |
407 | do | 407 | do |