From 5e8555d82203fcb22d91ab9d71526326b994e831 Mon Sep 17 00:00:00 2001 From: YusukeKato Date: Tue, 26 Nov 2024 16:39:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=B3=E3=83=A2=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E5=9B=9E=E8=BB=A2=E6=96=B9=E5=90=91=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drivers/rtmouse.h | 2 +- src/drivers/rtmouse_dev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/rtmouse.h b/src/drivers/rtmouse.h index b2cef95..d59ca39 100644 --- a/src/drivers/rtmouse.h +++ b/src/drivers/rtmouse.h @@ -52,7 +52,7 @@ // Raspberry Pi 2 B : 2 // Raspberry Pi 3 B/A+/B+ : 2 // Raspberry Pi 4 B : 4 -#define RASPBERRYPI 2 +#define RASPBERRYPI 4 #define DEV_RIGHT 0 #define DEV_LEFT 1 diff --git a/src/drivers/rtmouse_dev.c b/src/drivers/rtmouse_dev.c index 57ca4a6..e9c6f1c 100644 --- a/src/drivers/rtmouse_dev.c +++ b/src/drivers/rtmouse_dev.c @@ -264,7 +264,7 @@ static void set_motor_freq(int freq, const int dev_side) rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_L_BASE); } else if (dev_side == DEV_RIGHT) { motor_r_freq_is_positive = 1; - rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE); + rpi_gpio_set32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE); } } else { if (dev_side == DEV_LEFT) { @@ -273,7 +273,7 @@ static void set_motor_freq(int freq, const int dev_side) freq = -freq; } else if (dev_side == DEV_RIGHT) { motor_r_freq_is_positive = 0; - rpi_gpio_set32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE); + rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE); freq = -freq; } } From 0bdf90eb509b239ada0d9f51bf7a5d62d0d3fd53 Mon Sep 17 00:00:00 2001 From: YusukeKato Date: Tue, 26 Nov 2024 16:45:34 +0900 Subject: [PATCH 2/2] =?UTF-8?q?RASPBERRYPI=E3=82=922=E3=81=AB=E6=88=BB?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drivers/rtmouse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/rtmouse.h b/src/drivers/rtmouse.h index d59ca39..b2cef95 100644 --- a/src/drivers/rtmouse.h +++ b/src/drivers/rtmouse.h @@ -52,7 +52,7 @@ // Raspberry Pi 2 B : 2 // Raspberry Pi 3 B/A+/B+ : 2 // Raspberry Pi 4 B : 4 -#define RASPBERRYPI 4 +#define RASPBERRYPI 2 #define DEV_RIGHT 0 #define DEV_LEFT 1