用AndroLua设置CPU频率
androlua吧
全部回复
仅看楼主
level 9
nirenr 楼主
function su(cmd)
print(cmd)
local p=io.popen("su -c "..cmd)
s=p:read("*all")
p:close()
return s
end
fs=su('ls /sys/devices/system/cpu')
cpu={}
for c in fs:gmatch("cpu%d") do
table.insert(cpu,c)
print(c)
end
function path(c,t)
return string.format("/sys/devices/system/cpu/%s/cpufreq/scaling_%s_freq",c,t)
end
function setMax(n)
for k,v in pairs(cpu) do
su(n.." > "..path(v,"max"))
end
end
setMax(1890000)
2015年11月16日 15点11分 1
level 11
今天跟一SB下象棋。。。你说你马可以走“目”字。因为是千里马。我忍了。你的兵可以倒退走。说是特种兵。我忍了。。你的象可以过河。是小飞象。我忍了。你说你的炮可以不用隔棋或者隔两个以上都可以打。因为是高射炮。我也忍了。你的车可以拐弯。还说哪有车不能拐弯的吗??这。。。我也忍了。。。。但你用我的士。干掉我的将。还说是你培养了多年的间谍。特意派来做卧底的。。。你大爷的!这个真忍不了。
2015年12月02日 06点12分 2
1