当前位置: 编程技术>移动开发
本页文章导读:
▪怎么添加一个自定义的LED灯 怎样添加一个自定义的LED灯?1. 修改如下两个文件:
alps/mediatek/custom/common/kernel/leds/inc/cust_leds.h
-----------------------
enum mt65xx_led_type
{
MT65XX_LED_TYPE_RED = 0,
... ..........
▪ 怎的将手机中的频率固定在某一个level 怎样将手机中的频率固定在某一个level将手机中的频率固定在单核某个频率xxx的方法:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/onlin.........
▪ 充电低电量(少于5%)的时候开机充电图标默认是没有显示动画,如果需要充电动画,该怎么配置 充电低电量(少于5%)的时候开机充电图标默认是没有显示动画,如果需要充电动画,该如何配置1. 修改alps\frameworks\base\packages\systemui\res\drawable\Stat_sys_battery_charge.xml
<item android:maxLevel="4.........
[1]怎么添加一个自定义的LED灯
来源: 互联网 发布时间: 2014-02-18
怎样添加一个自定义的LED灯?
1. 修改如下两个文件:
alps/mediatek/custom/common/kernel/leds/inc/cust_leds.h
-----------------------
enum mt65xx_led_type
{
MT65XX_LED_TYPE_RED = 0,
... ...
MT65XX_LED_TYPE_LCD,
MT65XX_LED_TYPE_ABC, // Add a new LED type
MT65XX_LED_TYPE_TOTAL,
};
alps/mediatek/custom/YOUR_PRJ/kernel/leds/mt65xx/cust_leds.c
----------------------------
static struct cust_mt65xx_led cust_led_list[MT65XX_LED_TYPE_TOTAL] = {
{"red", MT65XX_LED_MODE_NONE, -1,{0}},
... ...
{"lcd-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight,{0}},
// Set LED params, Please refer to <Driver all in One>
{"abc-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight_abc,{0}},
};
2. 重新编译后,在Kernel log 里可以看到如下信息:
--------------------------------
<7>[ 1.021967] (0)Registered led device: button-backlight
<7>[ 1.022013] (0)Registered led device: lcd-backlight
<7>[ 1.022072] (0)Registered led device: abc-backlight // <------- !
3. 用如下命令查看新LED的 sysfs节点
adb shell ls /sys/devices/platform/leds-mt65xx/leds/
------------------------------------
abc-backlight
button-backlight
lcd-backlight
1. 修改如下两个文件:
alps/mediatek/custom/common/kernel/leds/inc/cust_leds.h
-----------------------
enum mt65xx_led_type
{
MT65XX_LED_TYPE_RED = 0,
... ...
MT65XX_LED_TYPE_LCD,
MT65XX_LED_TYPE_ABC, // Add a new LED type
MT65XX_LED_TYPE_TOTAL,
};
alps/mediatek/custom/YOUR_PRJ/kernel/leds/mt65xx/cust_leds.c
----------------------------
static struct cust_mt65xx_led cust_led_list[MT65XX_LED_TYPE_TOTAL] = {
{"red", MT65XX_LED_MODE_NONE, -1,{0}},
... ...
{"lcd-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight,{0}},
// Set LED params, Please refer to <Driver all in One>
{"abc-backlight", MT65XX_LED_MODE_CUST, (int)Cust_SetBacklight_abc,{0}},
};
2. 重新编译后,在Kernel log 里可以看到如下信息:
--------------------------------
<7>[ 1.021967] (0)Registered led device: button-backlight
<7>[ 1.022013] (0)Registered led device: lcd-backlight
<7>[ 1.022072] (0)Registered led device: abc-backlight // <------- !
3. 用如下命令查看新LED的 sysfs节点
adb shell ls /sys/devices/platform/leds-mt65xx/leds/
------------------------------------
abc-backlight
button-backlight
lcd-backlight
[2] 怎的将手机中的频率固定在某一个level
来源: 互联网 发布时间: 2014-02-18
怎样将手机中的频率固定在某一个level
将手机中的频率固定在单核某个频率xxx的方法:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /proc/mtk_hotplug/enable
echo xxx > /sys/power/cpufreq_limited_freq
将手机中的频率固定在双核某个频率xxx的方法:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 0 > /proc/mtk_hotplug/enable
echo xxx > /sys/power/cpufreq_limited_freq
以上方法可以保证不管是亮屏还是灭屏,都可以固定在您设定的频率下运行。
将手机中的频率固定在单核某个频率xxx的方法:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 0 > /proc/mtk_hotplug/enable
echo xxx > /sys/power/cpufreq_limited_freq
将手机中的频率固定在双核某个频率xxx的方法:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 0 > /sys/devices/system/cpu/cpu1/online
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo 0 > /proc/mtk_hotplug/enable
echo xxx > /sys/power/cpufreq_limited_freq
以上方法可以保证不管是亮屏还是灭屏,都可以固定在您设定的频率下运行。
[3] 充电低电量(少于5%)的时候开机充电图标默认是没有显示动画,如果需要充电动画,该怎么配置
来源: 互联网 发布时间: 2014-02-18
充电低电量(少于5%)的时候开机充电图标默认是没有显示动画,如果需要充电动画,该如何配置
1. 修改alps\frameworks\base\packages\systemui\res\drawable\Stat_sys_battery_charge.xml
<item android:maxLevel="4"> ------------修改为 <item android:maxLevel="0">
2. alps\frameworks\base\core\res\res\drawable\Stat_sys_battery_charge.xml
<item android:maxLevel="4" android:drawable="@android:drawable/stat_sys_battery_charge_anim0" />
修改为<item android:maxLevel="0" android:drawable="@android:drawable/stat_sys_battery_charge_anim0" />
1. 修改alps\frameworks\base\packages\systemui\res\drawable\Stat_sys_battery_charge.xml
<item android:maxLevel="4"> ------------修改为 <item android:maxLevel="0">
2. alps\frameworks\base\core\res\res\drawable\Stat_sys_battery_charge.xml
<item android:maxLevel="4" android:drawable="@android:drawable/stat_sys_battery_charge_anim0" />
修改为<item android:maxLevel="0" android:drawable="@android:drawable/stat_sys_battery_charge_anim0" />
最新技术文章: