Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtmouse.cの分割(リファクタリング) #92

Merged
merged 26 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6e53c59
renamed rtmouse.c to rtmouse_main.c
YusukeKato Nov 5, 2024
a4b6b0e
lintの対象ファイルを修正
YusukeKato Nov 5, 2024
4f0ef43
Cファイル分割の準備
YusukeKato Nov 5, 2024
93ad739
外部変数をヘッダファイルで宣言
YusukeKato Nov 5, 2024
bd7640b
デバイス関連の関数をrtmouse_dev.cへ移動
YusukeKato Nov 5, 2024
f2e86ce
lint対象を修正&インデント修正
YusukeKato Nov 5, 2024
f260f46
lintに対応して修正
YusukeKato Nov 5, 2024
152d057
lintに対応して修正
YusukeKato Nov 5, 2024
560bd67
rtmouse_dev.cをrtmouse_dev_fops.cへ名称変更
YusukeKato Nov 5, 2024
d530af8
ライセンスとバージョンを更新
YusukeKato Nov 5, 2024
71aa661
関数の並びを整理
YusukeKato Nov 5, 2024
b2d7b7d
外部変数を整理
YusukeKato Nov 5, 2024
c680610
lintに対応して修正
YusukeKato Nov 5, 2024
2948238
外部からも使用する関数を整理
YusukeKato Nov 5, 2024
92ec244
lintに対応して修正
YusukeKato Nov 5, 2024
cead9f2
rtmouse_main.cで使用する関数はrtmouse_main.cに残す
YusukeKato Nov 7, 2024
5b87a72
rtmouse_spi.cを作成してSPI関連の関数を移す
YusukeKato Nov 7, 2024
c1f774a
rtmouse_spi.cにコメントを追加
YusukeKato Nov 7, 2024
f6cd192
rtmouse_i2c.cを作成してI2C関連の関数を移す
YusukeKato Nov 7, 2024
b175fbc
register_dev()をrtmouse_dev_fops.cへ移す
YusukeKato Nov 7, 2024
77bb477
rtmouse_dev_fops.cをrtmouse_dev.cへ名称変更
YusukeKato Nov 7, 2024
a556d62
lintに対応して修正
YusukeKato Nov 7, 2024
0cc93d9
lint対象のファイルを修正
YusukeKato Nov 7, 2024
6e95fbf
rtmouse_gpio.cを作成してGPIO関連の関数を移す
YusukeKato Nov 7, 2024
2b50070
コメントなど微修正
YusukeKato Nov 7, 2024
b3c3c79
lintに対応して修正
YusukeKato Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .test/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); cd ../; pwd)

lint_driver () {
pushd $SRC_DIR/src/drivers
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_main.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_dev.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_spi.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_i2c.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse_gpio.c
python3 $SRC_DIR/.test/bin/run-clang-format.py rtmouse.h
popd
}
Expand Down
5 changes: 3 additions & 2 deletions src/drivers/Makefile.header_from_apt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
MODULE:= rtmouse
obj-m:= $(MODULE).o
$(MODULE)-y:= $(MODULE)_main.o $(MODULE)_dev.o $(MODULE)_spi.o $(MODULE)_i2c.o $(MODULE)_gpio.o
clean-files:= *.o *.ko *.mod.[co] *~

LINUX_SRC_DIR:=/usr/src/linux-headers-$(shell uname -r)
VERBOSE:=0

rtmouse.ko: rtmouse.c rtmouse.h
$(MODULE).ko: $(MODULE)_main.c $(MODULE)_dev.c $(MODULE)_spi.c $(MODULE)_i2c.c $(MODULE)_gpio.c $(MODULE).h
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) modules

clean:
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) clean

install: rtmouse.ko
install: $(MODULE).ko
cp ../../50-rtmouse.rules /etc/udev/rules.d/

uninstall:
Expand Down
3 changes: 2 additions & 1 deletion src/drivers/Makefile.header_from_source
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
MODULE:= rtmouse
obj-m:= $(MODULE).o
$(MODULE)-y:= $(MODULE)_main.o $(MODULE)_dev.o $(MODULE)_spi.o $(MODULE)_i2c.o $(MODULE)_gpio.o
clean-files:= *.o *.ko *.mod.[co] *~

LINUX_SRC_DIR:=/usr/src/linux
VERBOSE:=0

rtmouse.ko: rtmouse.c rtmouse.h
$(MODULE).ko: $(MODULE)_main.c $(MODULE)_dev.c $(MODULE)_spi.c $(MODULE)_i2c.c $(MODULE)_gpio.c $(MODULE).h
make -C $(LINUX_SRC_DIR) M=$(shell pwd) V=$(VERBOSE) modules

clean:
Expand Down
Loading