Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Undef motor current PWM for unused axes #27087

Merged
merged 1 commit into from
May 12, 2024

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented May 12, 2024

Description

Commit 08fe8a3 broke things

Two cases where the test was specifically for MOTOR_CURRENT_PWM_E and not MOTOR_CURRENT_PWM_E0 or MOTOR_CURRENT_PWM_E1 was replaced with HAS_MOTOR_CURRENT_PWM_E which is set when any of those three pins exist.

Resulting in failing to build for several stock configurations

Marlin/src/module/stepper.cpp: In static member function 'static void Stepper::set_digipot_current(uint8_t, int16_t)':
Marlin/src/module/stepper.cpp:3939:62: error: 'MOTOR_CURRENT_PWM_E_PIN' was not declared in this scope
#define WRITE_CURRENT_PWM(P) hal.set_pwm_duty(pin_t(MOTOR_CURRENT_PWM## P ##_PIN), 255L * current / (MOTOR_CURRENT_PWM_RANGE))

Requirements

MOTOR_CURRENT_PWM_E0, but no MOTOR_CURRENT_PWM_E, such as Marlin/src/pins/sam/pins_ARCHIM1.h

Benefits

It builds again

Configurations

https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.1.x/config/examples/UltiMachine/Archim1

@thisiskeithb
Copy link
Member

Commit 08fe8a3 broke things

We should not be directly committing to the codebase without it passing through a PR / proper CI checks.

@thinkyhead thinkyhead merged commit 909e3ad into MarlinFirmware:bugfix-2.1.x May 12, 2024
62 checks passed
@ellensp ellensp deleted the fix-motor-current branch May 12, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants