-
Notifications
You must be signed in to change notification settings - Fork 457
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.hを追加(リファクタリング) #91
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YusukeKato
added
the
Type: Refactoring
A code change that neither fixes a bug nor adds a feature
label
Oct 28, 2024
Raspberry Pi 4B+ (4GB)上のUbuntu Server 24.04 (6.8.0-1013-raspi) でサンプルプログラムの動作確認できました。 |
依存関係のincludeをヘッダファイルへ集約することを推奨します。以下の変更を加えた状態で、実機の動作確認もできています。 rtmouse.c以下のincludeを // 以下のincludeしているヘッダの定義を"rtmouse.h"に移動
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kdev_t.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/stat.h>
#include <linux/timer.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/version.h> rtmouse.h
#define RTMOUSE_H
// 依存するincludeファイルの記述を`rtmouse.c`から転記
#include <linux/cdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/kdev_t.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/stat.h>
#include <linux/timer.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/version.h> |
変更前/*
*
* rtmouse.c
* Raspberry Pi Mouse device driver
*
* Version: 3.3.2
*
* Copyright (C) 2015-2021 RT Corporation <shop@rt-net.jp>
* 変更後/*
*
* rtmouse.c
* Raspberry Pi Mouse device driver
*
* Version: 3.3.2
*
* Copyright (C) 2015-2024 RT Corporation <shop@rt-net.jp>
* |
何点かレビューコメントをしましたのでご確認をお願いします。 |
レビューコメントありがとうございます。
|
KuraZuzu
reviewed
Oct 29, 2024
Co-authored-by: Kazushi Kurasawa <[email protected]>
rtmouse.hにライセンスを追加しました。 |
修正ありがとうございました。再度動作確認できました。 |
KuraZuzu
approved these changes
Oct 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
リファクタリングの一環として、rtmouse.cで定義していた定数などを新しく作成したrtmouse.hへ移します。
また、rtmouse.hとは関係ありませんが、使用していないmotor_motion_*関数も削除しています。
Does this close any currently open issues?
しません。
How has this been tested?
下記の環境ですべてのサンプルプログラムの動作確認を行いました。
CIのビルドテストのチェックが通ることを確認しました。
Any other comments?
複数のCファイルに分割するところまでは本PRでは行いません。
Checklists