將自己寫的驅動新增到核心中

2021-09-19 05:58:19 字數 827 閱讀 7387

主要以自己寫的leds-s5pv210.c為例:

具體步驟:

1、將leds-s5pv210.c加入到driver/leds中,但是直接放進去並不會進行編譯。

2、在driver/leds中的makefile中新增相應的依賴:

obj-$(config_leds_s5pv210)              += leds-s5pv210.o
3、在kconfig中新增配置項:

if new_leds

config leds_s5pv210

tristate "led class for s5pv210"

help

this option is s5pv 210

tristate表示三態,表示可以y,m,n三種情況載入這個驅動

原本應該有depends on但是我們這個例子沒有依賴所以就去掉

help是幫助資訊

4、make menuconfig 進入到devices driver/led support/就會看到led class for s5pv210() 配置成y就可以

5、重新編譯,再把zimage放入到tftpboot中去,啟動開發板在、sys/class/leds/下面就可以看到我們配置的驅動

如果出現:

是因為在make menuconfig中devices driver/led support未開啟 led class support 這個選項。

把自己寫庫新增到CocoaPods用pod管理

1 將含有你要上傳庫的專案新增到 github 2 用終端 cd 到該專案下建立 podspec pod spec create grenealclass grenealclass pod新增的名字 3 vim grenealclass.podspec pod spec.new do s s.nam...

python 將自定義函式的路徑新增到系統路徑中

python會在以下路徑中搜尋它想要尋找的模組 程式所在的檔案路徑 標準庫的安裝路徑 作業系統環境變數pythonpath所包含的路徑 新增系統路徑 import sys 列印路徑 print sys.path from hello word import helloworld print hell...

新工程新增到自己的Github上

寫在前面的話 以前都是這樣做的 1.有乙個想放到github上面的工程 2.在github上面建立倉庫 3.clone 這個倉庫到本地 4.然後把原先本地的工程檔案放到clone下來的這個工程裡面 這樣做真是太low了!cd my project git init git add a git sta...