Skip to content

DRV8825 is using wrong ms_table[] #7

@ZuljinSBK

Description

@ZuljinSBK

It is using ms_table[] that is defined in A4988.cpp.
It is using this table, because implementation of method setMicrostep() is in A4988.cpp and this table is static.
If I copy whole setMicrostep() method to DRV8825.cpp and that way overwrite A4988 method it start to work.
There is few method to resolve this issue like removing static and moving initialization of ms_table to constructor or overwriting setMicrostep() in DRV8825.

Additionally I found few smaller cosmetic issues :)

  1. In few places there is this kind of if statment
    if (!IS_CONNECTED(ms1_pin) || !IS_CONNECTED(ms1_pin) || !IS_CONNECTED(ms1_pin))
    I think it shouldn't have only ms1_pin there.
  2. Following members are not used in DRV8825.h:
    int mode0_pin = PIN_UNCONNECTED;
    int mode1_pin = PIN_UNCONNECTED;
    int mode2_pin = PIN_UNCONNECTED;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions