搜索此博客

显示标签为“sysfs”的博文。显示所有博文
显示标签为“sysfs”的博文。显示所有博文

2009年7月26日星期日

X41任务2——充电控制和HDAPS(内核模块编译)

一、编译内核模块:

下载tp-smapi-source,Jaunty源里的比较旧了,俺用karmic的包。然后编译:

sudo apt-get install module-assistant
export HDAPS=1
sudo m-a -t a-i tp-smapi
sudo modprobe tp_smapi
sudo modprobe hdaps

这时候看syslog应该能看到有关smapi和hdaps的内容了。


二、电池阀


下面的命令需要root权限。
echo 50 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
echo 80 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh

还是sysfs,我爱sysfs。


三、HDAPS


sudo apt-get install hdaps-utils hdapsd

hdaps-utils用来看加速传感器是否工作了,运行“$ hdaps-gl”可以看到动画效果。然后就是启动hdapsd,结果他说什么什么unload_head文件不能写?研究中。要调整一些参数的话,可以以root身份编辑/etc/default/hdapsd。


三、下一个任务


下一个任务是“底座热插拔”。

2009年7月21日星期二

X41任务1——Track Point(HAL与sysfs)

一、滚动


新的发行版,比如说Ubuntu 8.10和Fedora 10已经开始使用udev和HAL来配置输入设备了,不再需要修改xorg.conf了。以root身份创建“/etc/hal/fdi/policy/mouse-wheel.fdi”:
 <match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

立即生效,重启就没了。装了sysfsutils的话就可以每次重启都配置一次。其他的设定:






















































































Name Type Default Notes
sensitivityInteger128Sensitivity
speedInteger97Cursor speed
inertiaInteger6Described as "negative inertia." It acts more like friction. High values cause the cursor to snap backward when the Trackpoint is released
reachInteger10Backup for Z-axis press
draghysInteger255Drag hysteresis (how hard it is to drag with Z-axis pressed)
mindragInteger20Minimum amount of force needed to trigger dragging
threshInteger8Minimum value for a Z-axis press
upthreshInteger255Used to generate a 'click' on Z-axis
ztimeInteger38How sharp of a press
jenksInteger135Minimum curvature for double click
press_to_selectBoolean0Press to select
skipbackBoolean0Supress movement after drag release
ext_devBoolean0Disable external device