Fix type coversion warnings in language.c

This commit is contained in:
Petr Ledvina 2018-07-17 17:37:45 +02:00
parent baddf38dbc
commit f2981bf322

View File

@ -63,7 +63,7 @@ uint8_t lang_select(uint8_t lang)
if (lang_check(_SEC_LANG_TABLE))
if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid
{
lang_table = _SEC_LANG_TABLE; // set table pointer
lang_table = (lang_table_t*)_SEC_LANG_TABLE; // set table pointer
lang_selected = lang; // set language id
}
}
@ -138,7 +138,7 @@ uint8_t lang_get_header(uint8_t lang, lang_table_header_t* header, uint32_t* off
if (lang == LANG_ID_SEC)
{
uint16_t ui = _SEC_LANG_TABLE; //table pointer
memcpy_P(header, ui, sizeof(lang_table_header_t)); //read table header from progmem
memcpy_P(header, (const void*)ui, sizeof(lang_table_header_t)); //read table header from progmem
if (offset) *offset = ui;
return (header->magic == LANG_MAGIC)?1:0; //return 1 if magic valid
}
@ -147,7 +147,7 @@ uint8_t lang_get_header(uint8_t lang, lang_table_header_t* header, uint32_t* off
lang--;
while (1)
{
w25x20cl_rd_data(addr, header, sizeof(lang_table_header_t)); //read table header from xflash
w25x20cl_rd_data(addr, (uint8_t*)header, sizeof(lang_table_header_t)); //read table header from xflash
if (header->magic != LANG_MAGIC) break; //break if not valid
if (offset) *offset = addr;
if (--lang == 0) return 1;