Skip to content

Commit

Permalink
Expand maximum language count (prusa3d#3345)
Browse files Browse the repository at this point in the history
* Expand maximum language count
  • Loading branch information
leptun authored Jan 13, 2022
1 parent eb25e5f commit 1d491e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,16 +919,16 @@ void update_sec_lang_from_external_flash()
{
if ((boot_app_magic == BOOT_APP_MAGIC) && (boot_app_flags & BOOT_APP_FLG_USER0))
{
uint8_t lang = boot_reserved >> 4;
uint8_t state = boot_reserved & 0xf;
uint8_t lang = boot_reserved >> 3;
uint8_t state = boot_reserved & 0x07;
lang_table_header_t header;
uint32_t src_addr;
if (lang_get_header(lang, &header, &src_addr))
{
lcd_puts_at_P(1,3,PSTR("Language update."));
for (uint8_t i = 0; i < state; i++) fputc('.', lcdout);
_delay(100);
boot_reserved = (state + 1) | (lang << 4);
boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07);
if ((state * LANGBOOT_BLOCKSIZE) < header.size)
{
cli();
Expand Down
2 changes: 1 addition & 1 deletion Firmware/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
//#define LANG_MODE 0 // primary language only
#define LANG_MODE 1 // sec. language support

#define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes)
#define LANG_SIZE_RESERVED 0x3000 // reserved space for secondary language (12288 bytes). Maximum 32768 bytes

//Community language support
#define COMMUNITY_LANG_GROUP 1
Expand Down
2 changes: 1 addition & 1 deletion Firmware/language.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,5 @@ void lang_boot_update_start(uint8_t lang)
{
uint8_t cnt = lang_get_count();
if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected
bootapp_reboot_user0(lang << 4);
bootapp_reboot_user0(lang << 3);
}

0 comments on commit 1d491e7

Please sign in to comment.