Skip to content

Commit

Permalink
more stupid jogwheel bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rasteri committed Oct 12, 2020
1 parent 6db4d04 commit 5ecc160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions software/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# MA 02110-1301, USA.
#

CC=/root/buildroot-2018.08.4/output/host/usr/bin/arm-linux-gcc
#CC=gcc -g
#CC=/root/buildroot-2018.08.4/output/host/usr/bin/arm-linux-gcc
CC=gcc -g
# Libraries and dependencies

INSTALL ?= install
Expand Down
3 changes: 2 additions & 1 deletion software/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ void player_collect(struct player *pl, signed short *pcm, unsigned samples)
&& pl->oldCapTouch == 0 )// don't do it on the first iteration so we pick up backspins
)
{

if (pl->pitch > 20.0) pl->pitch = 20.0;
if (pl->pitch < -20.0) pl->pitch = -20.0;
// Simulate slipmat for lasers/phasers
if (pl->pitch < pl->motor_speed - 0.1)
target_pitch = pl->pitch + (double)samples / scsettings.slippiness;
Expand Down
5 changes: 2 additions & 3 deletions software/sc_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,12 @@ void process_pic()

// Keep a running average of speed so if we suddenly let go it keeps going at that speed
double averageSpeed = 0.0;

unsigned int numBlips = 0;
void process_rot()
{
unsigned char result;
int8_t crossedZero; // 0 when we haven't crossed zero, -1 when we've crossed in anti-clockwise direction, 1 when crossed in clockwise
int wrappedAngle = 0x0000;
unsigned int numBlips = 0;
// Handle rotary sensor

i2c_read_address(file_i2c_rot, 0x0c, &result);
Expand Down Expand Up @@ -910,7 +909,7 @@ void process_rot()
// If we see 3 blips in a row, then I guess we better accept the new value
if (abs(deck[1].newEncoderAngle - wrappedAngle) > 100 && numBlips < 2)
{
//printf("blip! %d %d %d\n", newEncoderAngle, encoderAngle, wrappedAngle);
//printf("blip! %d %d %d\n", deck[1].newEncoderAngle, deck[1].encoderAngle, wrappedAngle);
numBlips++;
}
else
Expand Down

0 comments on commit 5ecc160

Please sign in to comment.