summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c6
-rw-r--r--firmware/drivers/ata_mmc.c2
-rw-r--r--firmware/drivers/lcd-1bit-vert.c8
-rw-r--r--firmware/screendump.c4
4 files changed, 10 insertions, 10 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)
#ifdef HAVE_ATA_DMA
static int get_best_mode(unsigned short identword, int max, int modetype)
{
- unsigned short testbit = 1u << max;
+ unsigned short testbit = BIT_N(max);
while (1) {
if (identword & testbit)
@@ -1335,7 +1335,7 @@ static int set_features(void)
}
for (i=0; i < (int)(sizeof(features)/sizeof(features[0])); i++) {
- if (identify_info[features[i].id_word] & (1u << features[i].id_bit)) {
+ if (identify_info[features[i].id_word] & BIT_N(features[i].id_bit)) {
SET_REG(ATA_FEATURE, features[i].subcommand);
SET_REG(ATA_NSECTOR, features[i].parameter);
SET_REG(ATA_COMMAND, CMD_SET_FEATURES);
@@ -1461,7 +1461,7 @@ int ata_init(void)
#ifdef MAX_PHYS_SECTOR_SIZE
/* Find out the physical sector size */
if((identify_info[106] & 0xe000) == 0x6000)
- phys_sector_mult = 1 << (identify_info[106] & 0x000f);
+ phys_sector_mult = BIT_N(identify_info[106] & 0x000f);
else
phys_sector_mult = 1;
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)
card->tsac = card->tsac * exponent[taac_exp] / 10;
/* r2w_factor, write timeout */
- card->r2w_factor = 1 << card_extract_bits(card->csd, 99, 3);
+ card->r2w_factor = BIT_N(card_extract_bits(card->csd, 99, 3));
card->write_timeout = card->read_timeout * card->r2w_factor;
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)
static void setpixel(int x, int y)
{
- LCDFN(framebuffer)[y>>3][x] |= 1 << (y & 7);
+ LCDFN(framebuffer)[y>>3][x] |= BIT_N(y & 7);
}
static void clearpixel(int x, int y)
{
- LCDFN(framebuffer)[y>>3][x] &= ~(1 << (y & 7));
+ LCDFN(framebuffer)[y>>3][x] &= ~BIT_N(y & 7);
}
static void flippixel(int x, int y)
{
- LCDFN(framebuffer)[y>>3][x] ^= 1 << (y & 7);
+ LCDFN(framebuffer)[y>>3][x] ^= BIT_N(y & 7);
}
static void nopixel(int x, int y)
@@ -401,7 +401,7 @@ void LCDFN(hline)(int x1, int x2, int y)
bfunc = LCDFN(blockfuncs)[current_vp->drawmode];
dst = &LCDFN(framebuffer)[y>>3][x1];
- mask = 1 << (y & 7);
+ mask = BIT_N(y & 7);
dst_end = dst + width;
do
diff --git a/firmware/screendump.c b/firmware/screendump.c
index 3a3985505e..e84afb9511 100644
--- a/firmware/screendump.c
+++ b/firmware/screendump.c
@@ -169,7 +169,7 @@ void screen_dump(void)
#if LCD_DEPTH == 1
dst_end = dst + LCD_WIDTH/2;
src = lcd_framebuffer[y >> 3];
- mask = 1 << (y & 7);
+ mask = BIT_N(y & 7);
do
{
@@ -333,7 +333,7 @@ void remote_screen_dump(void)
#if LCD_REMOTE_DEPTH == 1
dst_end = dst + LCD_REMOTE_WIDTH/2;
src = lcd_remote_framebuffer[y >> 3];
- mask = 1 << (y & 7);
+ mask = BIT_N(y & 7);
do
{