MTK MMI Cache

本文介绍了MMI缓存机制的三种类型:1字节缓存、2字节缓存和8字节缓存,并详细解释了每种缓存如何工作以节省文件分配表(FAT)空间。同时,文中提供了新MMI缓存注册机制的实现方法,包括XML配置示例和文件生成流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1)MMI cache are three special LID for MMI application. It collects many settings in one LID to save the FAT space.
2)The data is cached in memory for quick access.
3) There are three kind of MMI cache – 1 byte cache, 2 bytes cache, 8 bytes cache.

4) In 1/2/8 byte(s) cache, the size of every setting is 1/2/8 byte(s).



实现方法
1)在老的版本上Old registry method (10AW1032MP and before)涉及文件
▪ Define App ID  – mcu\custom\common\custom_nvram_config.h
▪ Define MMI cache ENUM  – mcu\custom\common\XXX_MMI\custom_mmi_default_value.h

▪ Define MMI cache default value – mcu\custom\common\XXX_MMI\common_mmi_cache_config.c
▪ Generated MMI cache table – mcu\custom\app\[BB]\nvram_mmi_cache_cust_pack.h

2)New MMI Cache Registry
Can add the item anywhere as you want. New MMI cache mechanism supports version compatible feature. It means you do not need to format the phone, when you download the new version.
 When you add or modify a MMI cache item, you only need to “make resgen” and “remake mmiresource, custom and your module”.
<APP id="APP_PHONEBOOK">
<CACHEDATA
type="short"
id="NVRAM_PHB_STORAGE_LOCATION"
restore_flag="TRUE"
restore_id="@RESTORE_PHB_STORAGE_LOCATION">
<DEFAULT_VALUE>[0xFF,0xFF]</DEFAULT_VALUE>
<DESCRIPTION>Phonebook prefer storage</DESCRIPTION>
</CACHEDATA>
</APP>
说明:
<DEFAULT_VALUE> Tag
Describe the default value for every 4 bytes – [1000, 1000] = [0xE8, 0x03, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00] (double)
 Discard the most left bytes if need.
– [1000] = [0xE8, 0x03] (short)
– [1000] = [0xE8] (byte)

<FIELD> Tag
▪ Parent: <CACHEDATA> , describe in detail the byte size of this MMI cache, for CAT
▪ There may be many <FIELD> tag in one cache data.
– Ex: Split the double into two fields and each size is 4.

Example 1 of <CACHEDATA>
<CACHEDATA type="byte" id="NVRAM_SETTING_DEF_ENCODING" restore_flag="TRUE">
<DEFAULT_VALUE> [0xFF] </DEFAULT_VALUE>
<DESCRIPTION> user defined encoding type </DESCRIPTION>
<FIELD>
<OPTION hint="ASCII"> [0x00]</OPTION>
<OPTION hint="ISO-8859-9"></OPTION>
<OPTION hint="Windows-1254"></OPTION>
<OPTION hint="KOI8-R"></OPTION>     //  Empty value, increase thevalue of last option item . So it is [0x01].
<OPTION hint="Windows-1252"></OPTION>
<OPTION hint="Big5"></OPTION>
<OPTION hint="GB2312"></OPTION>
</FIELD>
</CACHEDATA>

Example 2 of <CACHEDATA>
<CACHEDATA type="byte" id="NVRAM_MEDIA_PLAYER_SINGLE_VOLUME" restore_flag="TRUE">
<DEFAULT_VALUE> [0xFF] </DEFAULT_VALUE>
<DESCRIPTION> Byte Cache </DESCRIPTION>
<FIELD min="0" max="15"></FIELD>
</CACHEDATA>

Example 3 of <CACHEDATA>
<CACHEDATA type="short" id="NVRAM_FUNANDGAMES_SETWALLPAPER“>
<DEFAULT_VALUE> [0x01, 0x00] </DEFAULT_VALUE>
<DESCRIPTION> current wallpaper id </DESCRIPTION>
<FIELD>
<MAXIMUM> [__MMI_WALLPAPER_NUM__] </MAXIMUM>
</FIELD>
</CACHEDATA>

Output file
▪ mmi_cache_table.c-> id ENUM array, key value array, restore factory
▪ mmi_cache_table.h-> function, extern variable
▪ mmi_cache_default_value.h-> default value
▪ mmi_cache_nvram_editor.h-> for NVRAM editor(Meta)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值