Conversation
|
Hi @MangaValk In the official Arduino Servo library:
could you be more precise about why you need to do those updates? |
| int readMicroseconds(); // returns current pulse width in microseconds for this servo (was read_us() in first release) | ||
| bool attached(); // return true if this servo is attached, otherwise false | ||
| private: | ||
| protected: |
There was a problem hiding this comment.
I don't see a reason to change this attribute to protected instead of private.
This variable should not be modified outside of the class.
I can understand that you need to read this variable, but in this case we can rather implement an accessor.
There was a problem hiding this comment.
A getter function would be fine too. I'm not a professional c++ programmer, so I thought a protected var would be fine.
| static HardwareTimer TimerServo(TIMER_SERVO); | ||
|
|
||
| uint8_t ServoCount = 0; // the total number of attached servos | ||
| static uint8_t ServoCount = 0; // the total number of attached servos |
There was a problem hiding this comment.
From my point of view there is no restriction to define this variable static.
Nevertheless, if this cause you issue in Marlin, this probably means you have a variable with the same name ? Can you confirm ? maybe you also need to take some action on marlin to avoid conflict too?
There was a problem hiding this comment.
Here is link to the marlin change I made MarlinFirmware/Marlin#16151 (review)
Somehow this made it work, if I turn it back to normal it stops working.
|
@MangaValk |
|
I'm closing this PR since someone found a fix that works without these changes. |
Summary
This PR fixes an issue i had on Marlin when using multiple servos.
Issue: MarlinFirmware/Marlin#16138