首先打开 Makefile 文件,在里面输入下面的内容:


Makefilewe 文件我们主要修改了下面几个地方:
第 2 行的 TARGET 赋值修改为 touchscreen。
第 29 行添加 drivers/touchscreen 的.h 文件到变量 INCDIRS。
第 48 行添加 drivers/touchscreen 的.c 文件到变量 SRCDIRS。
链接脚本文件保持不变。
我们在终端输入“make”命令开始编译,如图 25.4.1 所示:

编译完成生成“touchscreen.bin”文件,如图 25.4.2 所示:

然后在终端输入命令“chmod 777 create_imx”修改 create_imx 文件具有可执行权限,如图 25.4.3 所示:

最后在终端运行命令“./create_imx touchscreen.bin”生成最终的镜像文件“bare.imx”,如图 25.4.4 所示:

然后我们将生成的 bare.imx 文件通过 SSH 软件拷贝到 mfg 烧写工具内对应目录下,这一步可以参考前面的烧写章节。将拨码开关切换成烧写模式,上电烧写等待烧写完成,然后将拨码开关切换回启动模式,等待程序正常运行,我们可以看到 LCD 屏幕如图 25.4.5 显示:

当我们按下触摸屏的时候,就会在屏幕上显示出当前的触摸点个数,以及每个触摸点的坐标信息,如图 25.4.6 所示:

|