Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCD dynamic characters (+diacritics support) #3383

Merged
merged 56 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e1fd2d0
Dynamic characters initial
leptun Jan 24, 2023
6646789
Fix cherry-pick conflict 2
3d-gussner Sep 21, 2023
4d5279d
lcd_set_cursor_column() also updates lcd_ddram_address
leptun Jan 24, 2023
0ba360b
Refactor the lcd_print_custom() method
leptun Jan 24, 2023
63eae9a
lcd_print_custom(): limit searching to lcd_custom_index
leptun Jan 24, 2023
9ad9a5e
Cleanup around invalidating the custom characters
leptun Jan 24, 2023
d3c4fab
Use lcd_home() wherever possible
leptun Jan 24, 2023
27cae2b
Remove unnecessary lcd_home() calls
leptun Jan 24, 2023
b724e8c
First working implementation
leptun Jan 24, 2023
57ec0ac
Update debug messages
leptun Jan 24, 2023
ed6be5d
Generate the font from Prusa.lcd
leptun Jan 24, 2023
abe6041
Change 🗘 to 🔃
leptun Jan 24, 2023
bfb8f62
Change ↡ to
leptun Jan 24, 2023
a6fc71c
Change μ to µ
leptun Jan 24, 2023
a323311
Remove TR font
leptun Sep 21, 2023
a651837
Regen font table and include ID in comment
leptun Sep 21, 2023
909d735
Expand list of custom characters
leptun Sep 22, 2023
377268e
Fix "🔃Refresh" translation
leptun Sep 22, 2023
6cb8a5d
Add s-cedilla to TRANS_CHARS
leptun Sep 22, 2023
41314da
Font table compression
leptun Sep 22, 2023
83f736e
Update Firmware_sk.po with diacritics
ingbrzy Sep 23, 2023
486dec4
typos in Firmware_sk.po
ingbrzy Sep 23, 2023
f38d005
No need to mask the CGRAM data before sending
leptun Sep 23, 2023
adc15b9
Add t-cedilla to TRANS_CHARS
leptun Sep 24, 2023
375b03a
Update language scripts to use the font
leptun Sep 24, 2023
d7fc61e
Fix legacy build
leptun Sep 24, 2023
10f8e39
Implement 'á'
leptun Sep 25, 2023
424eec1
Update diacritic alignment
leptun Sep 25, 2023
ae9e7ce
Implement all a-based diacritics
leptun Sep 25, 2023
f4783d6
Yet another workaround for the language update
leptun Sep 25, 2023
ae5e527
Implement the rest of the diacritics
leptun Sep 25, 2023
2e39210
Remove unused fonts
leptun Sep 25, 2023
7ca39f5
Update `ď`
leptun Sep 26, 2023
b49c05c
Update `đûůű`
leptun Sep 26, 2023
f77989e
Cleanup uartout declaration
leptun Sep 27, 2023
614e867
bootapp cleanup
leptun Sep 27, 2023
1b353d7
Update `ø`
leptun Sep 27, 2023
d4621bf
Update RO po files
leptun Sep 28, 2023
819449e
Update `ăĂñ`
leptun Sep 28, 2023
5e04e3f
Add rewrite for a-caron
leptun Sep 28, 2023
7f789d4
Fix charset conversion
leptun Sep 28, 2023
9befe72
Update README.md
leptun Sep 30, 2023
b8b1d50
Optimize `lcd_print_custom()`
leptun Sep 30, 2023
e0bfbe4
Fix MMU error message character
leptun Sep 30, 2023
61fd090
Allow all diacritics in the sheet name
leptun Sep 30, 2023
cdb7dbd
Fix frame start for non-menu screens
leptun Sep 30, 2023
ff76d8b
Prevent out of bounds custom character font data
leptun Sep 30, 2023
ac38770
Fix sheet rename resetting characters to blank
leptun Sep 30, 2023
65ac8ce
Update Firmware_nl.po
vintagepc Sep 30, 2023
70d1bb0
Use beta symbol as fallback of `ß`
leptun Sep 30, 2023
7697173
Move custom character type to lcd.cpp
leptun Sep 30, 2023
127bb1b
Fix tilde in message
leptun Sep 30, 2023
d0d2ec9
Fix wrong character sent when potentially unused slot is replaced
leptun Sep 30, 2023
df1e728
Add diacritics to CZ translations
Oct 2, 2023
7770005
Update German
3d-gussner Oct 2, 2023
f686f41
Add font unpacking documentation
leptun Oct 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions Firmware/FontTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{0x3E, {0x0F, 0xA8, 0xAF, 0x00, }, 'H'}, // index=0x80, utf8='🄷'
{0x00, {0x69, 0x96, 0x00, 0x00, }, '\xdf'}, // index=0x81, utf8='°'
{0x60, {0x25, 0x55, 0x58, 0x87, }, 'h'}, // index=0x82, utf8='🌡'
{0x04, {0x27, 0xF2, 0xE0, 0x00, }, '^'}, // index=0x83, utf8='⬏'
{0x34, {0x03, 0xCC, 0x19, 0x60, }, '\xf3'}, // index=0x84, utf8='🔃'
{0x3C, {0x0E, 0xF8, 0x8F, 0x00, }, '\xdb'}, // index=0x85, utf8='🗀'
{0x08, {0x02, 0x94, 0x92, 0x00, }, '>'}, // index=0x86, utf8='»'
{0x1C, {0x07, 0x9A, 0x87, 0x00, }, '\xe5'}, // index=0x87, utf8='🕑'
{0x24, {0x00, 0x85, 0x28, 0x52, }, '\x7e'}, // index=0x88, utf8='⏬'
{0x06, {0x00, 0x1B, 0xE4, 0x00, }, '\x7e'}, // index=0x89, utf8='✔'
{0x78, {0x12, 0x70, 0x78, 0x70, }, 'a'}, // index=0x8A, utf8='á'
{0xF8, {0x12, 0x78, 0x8F, 0x88, }, 'A'}, // index=0x8B, utf8='Á'
{0x78, {0x42, 0x70, 0x78, 0x70, }, 'a'}, // index=0x8C, utf8='à'
{0x78, {0x25, 0x70, 0x78, 0x70, }, 'a'}, // index=0x8D, utf8='â'
{0xF8, {0x50, 0x78, 0x8F, 0x88, }, '\xd1'}, // index=0x8E, utf8='Ä'
{0xF0, {0x25, 0x27, 0x07, 0x87, }, 'a'}, // index=0x8F, utf8='å'
{0xF0, {0x25, 0x27, 0x8F, 0x88, }, 'A'}, // index=0x90, utf8='Å'
{0x2C, {0x0D, 0x27, 0xAA, 0x50, }, '\xd1'}, // index=0x91, utf8='æ'
{0xBC, {0x07, 0x07, 0x87, 0x11, }, 'a'}, // index=0x92, utf8='ą'
{0xBE, {0x78, 0x8F, 0x88, 0x11, }, 'A'}, // index=0x93, utf8='Ą'
{0x78, {0x52, 0x70, 0x78, 0x70, }, 'a'}, // index=0x94, utf8='ă'
{0xF8, {0x52, 0x78, 0x8F, 0x88, }, 'A'}, // index=0x95, utf8='Ă'
{0x20, {0x12, 0x78, 0x88, 0x70, }, 'c'}, // index=0x96, utf8='ć'
{0x20, {0x12, 0x78, 0x88, 0x70, }, 'c'}, // index=0x97, utf8='ć'
{0x20, {0x52, 0x78, 0x88, 0x70, }, 'c'}, // index=0x98, utf8='č'
{0x03, {0x11, 0x17, 0x99, 0x70, }, 'd'}, // index=0x99, utf8='ď'
{0x18, {0x12, 0x78, 0xF8, 0x70, }, 'e'}, // index=0x9A, utf8='é'
{0x18, {0x42, 0x78, 0xF8, 0x70, }, 'e'}, // index=0x9B, utf8='è'
{0x18, {0x52, 0x78, 0xF8, 0x70, }, 'e'}, // index=0x9C, utf8='ě'
{0x0C, {0x07, 0x8F, 0x87, 0x23, }, 'e'}, // index=0x9D, utf8='ę'
{0x44, {0x12, 0xF8, 0xF8, 0xF0, }, 'E'}, // index=0x9E, utf8='É'
{0x00, {0x12, 0x06, 0x22, 0x70, }, 'i'}, // index=0x9F, utf8='í'
{0x00, {0x25, 0x06, 0x22, 0x70, }, 'i'}, // index=0xA0, utf8='î'
{0x00, {0x25, 0x07, 0x22, 0x27, }, 'I'}, // index=0xA1, utf8='Î'
{0x00, {0x12, 0x06, 0x22, 0x27, }, 'l'}, // index=0xA2, utf8='ĺ'
{0x02, {0x62, 0x36, 0xA2, 0x70, }, 'l'}, // index=0xA3, utf8='ł'
{0x03, {0x62, 0x22, 0x22, 0x70, }, 'l'}, // index=0xA4, utf8='ľ'
{0x40, {0x45, 0x6C, 0x44, 0x70, }, 'L'}, // index=0xA5, utf8='Ł'
{0x43, {0x88, 0x88, 0x88, 0xF0, }, 'L'}, // index=0xA6, utf8='Ľ'
{0x78, {0x12, 0xBC, 0x88, 0x80, }, 'n'}, // index=0xA7, utf8='ń'
{0x78, {0x52, 0xBC, 0x88, 0x80, }, 'n'}, // index=0xA8, utf8='ň'
{0x71, {0x69, 0x0B, 0xC8, 0x80, }, 'n'}, // index=0xA9, utf8='ñ'
{0x38, {0x12, 0x78, 0x88, 0x70, }, 'o'}, // index=0xAA, utf8='ó'
{0x38, {0x42, 0x78, 0x88, 0x70, }, 'o'}, // index=0xAB, utf8='ò'
{0x38, {0x25, 0x78, 0x88, 0x70, }, 'o'}, // index=0xAC, utf8='ô'
{0x3A, {0x00, 0x79, 0xAC, 0x78, }, 'o'}, // index=0xAD, utf8='ø'
{0x39, {0x49, 0x78, 0x88, 0x70, }, 'o'}, // index=0xAE, utf8='ő'
{0x08, {0x52, 0xBC, 0x88, 0x80, }, 'r'}, // index=0xAF, utf8='ř'
{0x20, {0x12, 0x78, 0x70, 0xF0, }, 's'}, // index=0xB0, utf8='ś'
{0x20, {0x52, 0x78, 0x70, 0xF0, }, 's'}, // index=0xB1, utf8='š'
{0x10, {0x07, 0x87, 0x0F, 0x24, }, 's'}, // index=0xB2, utf8='ș'
{0x60, {0x69, 0x9A, 0x98, 0x8B, }, '\xe2'}, // index=0xB3, utf8='ß'
{0x23, {0x04, 0xE4, 0x44, 0x30, }, 't'}, // index=0xB4, utf8='ť'
{0x10, {0x4E, 0x44, 0x43, 0x24, }, 't'}, // index=0xB5, utf8='ț'
{0x01, {0xF2, 0x22, 0x20, 0x24, }, 'T'}, // index=0xB6, utf8='Ț'
{0x7C, {0x12, 0x88, 0x89, 0x60, }, 'u'}, // index=0xB7, utf8='ú'
{0x78, {0x25, 0x28, 0x89, 0x60, }, 'u'}, // index=0xB8, utf8='ů'
{0x79, {0x49, 0x08, 0x89, 0x60, }, 'u'}, // index=0xB9, utf8='ű'
{0x3C, {0x12, 0x88, 0x70, 0x70, }, 'y'}, // index=0xBA, utf8='ý'
{0x44, {0x12, 0xF1, 0x24, 0xF0, }, 'z'}, // index=0xBB, utf8='ź'
{0x44, {0x52, 0xF1, 0x24, 0xF0, }, 'z'}, // index=0xBC, utf8='ž'
{0x44, {0x20, 0xF1, 0x24, 0xF0, }, 'z'}, // index=0xBD, utf8='ż'
10 changes: 0 additions & 10 deletions Firmware/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@

#include "lcd.h"

#ifdef __cplusplus
extern "C" {
#endif
extern FILE _uartout;
#ifdef __cplusplus
}
#endif

#define uartout (&_uartout)

#define SERIAL_PROTOCOL(x) (MYSERIAL.print(x))
#define SERIAL_PROTOCOL_F(x,y) (MYSERIAL.print(x,y))
#define SERIAL_PROTOCOLPGM(x) (serialprintPGM(PSTR(x)))
Expand Down
10 changes: 4 additions & 6 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,8 @@ static void factory_reset(char level)
}
}

extern "C" {
FILE _uartout; //= {0}; Global variable is always zero initialized. No need to explicitly state this.
}
static FILE _uartout;
#define uartout (&_uartout)

int uart_putchar(char c, FILE *)
{
Expand Down Expand Up @@ -921,7 +920,7 @@ void update_sec_lang_from_external_flash()
}
}
}
boot_app_flags &= ~BOOT_APP_FLG_USER0;
boot_app_magic = 0;
}


Expand Down Expand Up @@ -4093,8 +4092,7 @@ void process_commands()
}
else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET
#if defined(XFLASH) && defined(BOOTAPP)
boot_app_magic = BOOT_APP_MAGIC;
boot_app_flags = BOOT_APP_FLG_RUN;
gudnimg marked this conversation as resolved.
Show resolved Hide resolved
boot_app_magic = 0;
#endif //defined(XFLASH) && defined(BOOTAPP)
softReset();
}
Expand Down
8 changes: 4 additions & 4 deletions Firmware/bootapp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size)
{
cli();
boot_app_magic = BOOT_APP_MAGIC;
boot_app_flags |= BOOT_APP_FLG_COPY;
boot_app_flags |= BOOT_APP_FLG_ERASE;
boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE;
boot_copy_size = (uint16_t)size;
boot_src_addr = (uint32_t)rptr;
boot_dst_addr = (uint32_t)fptr;
bootapp_print_vars();
// bootapp_print_vars();
softReset();
}

Expand All @@ -38,7 +37,8 @@ void bootapp_reboot_user0(uint8_t reserved)
cli();
boot_app_magic = BOOT_APP_MAGIC;
boot_app_flags = BOOT_APP_FLG_USER0;
boot_copy_size = 0;
boot_reserved = reserved;
bootapp_print_vars();
// bootapp_print_vars();
softReset();
}
3 changes: 1 addition & 2 deletions Firmware/bootapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
#define BOOT_APP_FLG_ERASE 0x01
#define BOOT_APP_FLG_COPY 0x02
#define BOOT_APP_FLG_FLASH 0x04
#define BOOT_APP_FLG_RUN 0x08

#define BOOT_APP_FLG_USER0 0x80

#define BOOT_APP_MAGIC 0x55aa55aa
#define BOOT_APP_MAGIC 0x55aa55aaUL


#if defined(__cplusplus)
Expand Down
2 changes: 1 addition & 1 deletion Firmware/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

typedef struct
{
char name[MAX_SHEET_NAME_LENGTH]; //!< Can be null terminated, doesn't need to be null terminated
unsigned char name[MAX_SHEET_NAME_LENGTH]; //!< Can be null terminated, doesn't need to be null terminated
int16_t z_offset; //!< Z_BABYSTEP_MIN .. Z_BABYSTEP_MAX = Z_BABYSTEP_MIN*2/1000 [mm] .. Z_BABYSTEP_MAX*2/1000 [mm]
uint8_t bed_temp; //!< 0 .. 254 [°C] NOTE: currently only written-to and never used
uint8_t pinda_temp; //!< 0 .. 254 [°C] NOTE: currently only written-to and never used
Expand Down
Loading