diff options
Diffstat (limited to 'firmware/drivers')
| -rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 32 | ||||
| -rw-r--r-- | firmware/drivers/lcd-h100.c | 32 | ||||
| -rw-r--r-- | firmware/drivers/lcd-recorder.c | 32 |
3 files changed, 72 insertions, 24 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index bdc5799..8112aec 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -500,41 +500,57 @@ lcd_pixelfunc_type* lcd_remote_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (bits & mask); } static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= ~(bits & mask); } static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -707,8 +723,8 @@ void lcd_remote_vline(int x, int y1, int y2) dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -782,14 +798,14 @@ void lcd_remote_fillrect(int x, int y, int width, int height) dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -871,14 +887,14 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_REMOTE_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c index 929a4fa..3d858e2 100644 --- a/firmware/drivers/lcd-h100.c +++ b/firmware/drivers/lcd-h100.c @@ -339,41 +339,57 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (bits & mask); } static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= ~(bits & mask); } static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -544,8 +560,8 @@ void lcd_vline(int x, int y1, int y2) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -619,14 +635,14 @@ void lcd_fillrect(int x, int y, int width, int height) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -708,14 +724,14 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 6747f7f..f933e6c 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c @@ -396,41 +396,57 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = { }; static void flipblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (bits & mask); } static void bgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bgblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= (bits | ~mask); } static void fgblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fgblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (bits & mask); } static void solidblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (bits & mask); } static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address ^= (~bits & mask); } static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address &= ~(bits & mask); } static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) { *address |= (~bits & mask); } static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) + __attribute__ ((section(".icode"))); +static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) { *address = (*address & ~mask) | (~bits & mask); } @@ -601,8 +617,8 @@ void lcd_vline(int x, int y1, int y2) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; - bfunc(dst, mask_bottom, 0xFFu); + mask &= mask_bottom; + bfunc(dst, mask, 0xFFu); } /* Draw a rectangular box */ @@ -676,14 +692,14 @@ void lcd_fillrect(int x, int y, int width, int height) dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (fillopt && (mask_bottom == 0xFFu)) + if (fillopt && (mask == 0xFFu)) memset(dst, bits, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, 0xFFu); + bfunc(dst++, mask, 0xFFu); } } @@ -765,14 +781,14 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, dst += LCD_WIDTH; mask = 0xFFu; } - mask_bottom &= mask; + mask &= mask_bottom; - if (copyopt && (mask_bottom == 0xFFu)) + if (copyopt && (mask == 0xFFu)) memcpy(dst, src, width); else { for (i = width; i > 0; i--) - bfunc(dst++, mask_bottom, *src++); + bfunc(dst++, mask, *src++); } } else |