Skip to content

Commit 5e8555d

Browse files
committed
右モータの回転方向を修正
1 parent 9863ba3 commit 5e8555d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/drivers/rtmouse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
// Raspberry Pi 2 B : 2
5353
// Raspberry Pi 3 B/A+/B+ : 2
5454
// Raspberry Pi 4 B : 4
55-
#define RASPBERRYPI 2
55+
#define RASPBERRYPI 4
5656

5757
#define DEV_RIGHT 0
5858
#define DEV_LEFT 1

src/drivers/rtmouse_dev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void set_motor_freq(int freq, const int dev_side)
264264
rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_L_BASE);
265265
} else if (dev_side == DEV_RIGHT) {
266266
motor_r_freq_is_positive = 1;
267-
rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE);
267+
rpi_gpio_set32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE);
268268
}
269269
} else {
270270
if (dev_side == DEV_LEFT) {
@@ -273,7 +273,7 @@ static void set_motor_freq(int freq, const int dev_side)
273273
freq = -freq;
274274
} else if (dev_side == DEV_RIGHT) {
275275
motor_r_freq_is_positive = 0;
276-
rpi_gpio_set32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE);
276+
rpi_gpio_clear32(RPI_GPIO_P2MASK, 1 << MOTDIR_R_BASE);
277277
freq = -freq;
278278
}
279279
}

0 commit comments

Comments
 (0)