Skip to content

Commit

Permalink
Merge pull request #19 from simoninns/release-1_3_prep
Browse files Browse the repository at this point in the history
Release 1 3 prep
  • Loading branch information
simoninns authored Nov 28, 2020
2 parents 5b025b9 + d220d6b commit 66cf90d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CC=avr-gcc
OBJCOPY=avr-objcopy
OBJS=SmallyMouse2/main.o SmallyMouse2/ConfigDescriptor.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/USBTask.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/HostStandardReq.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/ConfigDescriptors.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.o SmallyMouse2/src/LUFA/LUFA/Drivers/USB/Core/Events.o

CFLAGS=-Os -DUSE_LUFA_CONFIG_HEADER -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_CPU=16000000UL -DF_USB=16000000UL -D__AVR_AT90USB1287__ -mmcu=at90usb1287 -ISmallyMouse2/src/ -ISmallyMouse2/src/config/ -ISmallyMouse2/src/LUFA/
PORT=/dev/ttyACM0

smallymouse.hex: smallymouse.elf
${OBJCOPY} -j .text -j .data -O ihex smallymouse.elf smallymouse.hex

smallymouse.elf: ${OBJS}
${CC} -mmcu=at90usb1287 -o smallymouse.elf ${OBJS}

install: smallymouse.hex
dfu-programmer at90usb1287 erase --force
dfu-programmer at90usb1287 flash smallymouse.hex
17 changes: 10 additions & 7 deletions SmallyMouse2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ void initialiseHardware(void)
Serial_CreateStream(NULL);

// Output some debug header information to the serial console
puts_P(PSTR(ESC_FG_YELLOW "SmallyMouse2 - Serial debug console\r\n" ESC_FG_WHITE));
puts_P(PSTR(ESC_FG_YELLOW "SmallyMouse2 V1.3 - Serial debug console\r\n" ESC_FG_WHITE));
puts_P(PSTR(ESC_FG_YELLOW "(c)2017-2020 Simon Inns\r\n" ESC_FG_WHITE));
puts_P(PSTR(ESC_FG_YELLOW "http://www.waitingforfriday.com\r\n" ESC_FG_WHITE));

Expand Down Expand Up @@ -375,18 +375,20 @@ void processMouse(void)
//
// X and Y have a range of -127 to +127

// If the mouse movement changes direction then disregard any remaining
// movement units in the previous direction.
// If the mouse movement changes X direction then disregard any remaining movement
if (MouseReport.X > 0 && mouseDirectionX == 0) {
mouseDistanceX = 0;
mouseDirectionX = 1;
} else if (MouseReport.X < 0 && mouseDirectionX == 1) {
mouseDistanceX = 0;
mouseDirectionX = 0;
} else if (MouseReport.Y > 0 && mouseDirectionY == 0) {
}

// If the mouse movement changes Y direction then disregard any remaining movement
if (MouseReport.Y > 0 && mouseDirectionY == 0) {
mouseDistanceY = 0;
mouseDirectionY = 1;
} else if (MouseReport.Y < 0 && mouseDirectionY == 1) {
} else if (MouseReport.Y < 0 && mouseDirectionY == 1) {
mouseDistanceY = 0;
mouseDirectionY = 0;
}
Expand Down Expand Up @@ -516,8 +518,9 @@ uint8_t processMouseMovement(int8_t movementUnits, uint8_t axis, bool limitRate,
// timerTopValue = timerTopValue / 64;
// timerTopValue = timerTopValue - 1;

timerTopValue = ((10000 / timerTopValue) / 64) - 1;

if (timerTopValue > 0) timerTopValue = ((10000 / timerTopValue) / 64) - 1;
else timerTopValue = 0; // Avoid divide by zero

// If the 'Slow' configuration jumper is shorted; apply the quadrature rate limit
if (limitRate) {
// Rate limit is on
Expand Down

0 comments on commit 66cf90d

Please sign in to comment.