Skip to content

Operator precedence error in fast move case #5

@ealejand

Description

@ealejand

In ClearPathMotorSD.cpp there's some lines with a potential operator precedence error

171 if(TargetPosnQx-MovePosnQx>50<<fractionalBits){
172 	MovePosnQx=MovePosnQx+50<<fractionalBits;
173 }

Line 171 is parsed as ((TargetPosnQx-MovePosnQx) > (50<<fractionalBits)) and it logically follows that if it evaluates to true then the intention would be to increment MovePosnQx by (50<<fractionalBits) but I believe line 172 is being parsed as (MovePosnQx+50) << fractionalBits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions