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

[1.1.x] Fix compilation warnings #8395

Merged
merged 3 commits into from Nov 13, 2017

Conversation

RowanMeara
Copy link
Contributor

I added some brackets that GCC was complaining about in temperature.cpp, updated the MINIRAMBO build in travis to bring it to parity with 2.0.x to get rid of the warnings, and added a build which uses the endstop interrupts feature.

@Roxy-3D @fiveangle Unbricked version of #8384

@fiveangle
Copy link
Contributor

I love making TravisCI changes, because the only way to really find it out if it works is to #dil 😎

Copy link
Member

@thinkyhead thinkyhead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some questions about this PR…

.travis.yml Outdated
- opt_enable USE_YMAX_PLUG
- opt_enable USE_ZMIN_PLUG
- opt_enable USE_ZMAX_PLUG
- build_marlin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to combine as many tests as possible into a single build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do that.

.travis.yml Outdated
@@ -203,7 +203,8 @@ script:
- opt_enable_adv Z_DUAL_STEPPER_DRIVERS Z_DUAL_ENDSTOPS BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS
- opt_set_adv I2C_SLAVE_ADDRESS 63
- opt_enable_adv ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE LCD_INFO_MENU
- opt_add_adv Z2_MIN_PIN 2
- pins_set RAMPS X_MAX_PIN -1
- opt_add_adv Z2_MAX_PIN 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the issue here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose you noticed that this is not building for MINIRAMBO, nor does it enable PWM_MOTOR_CURRENT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way it was, it would put 500 lines of warnings into the travis log because it was defining Z2_MIN_PIN multiple times. I will make the comment and the build reflect each other. I just changed it to make it the same as the other branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the time when I added opt_add_adv Z2_MIN_PIN 2 the compiler error was that no Z2_MIN_PIN was defined. It would be a good idea to go to the Blame log and find out when changes were made to these lines and what caused the new errors to start showing up.

@@ -1746,15 +1746,15 @@ void Temperature::isr() {

#if ENABLED(FAN_SOFT_PWM)
#if HAS_FAN0
soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask) + soft_pwm_amount_fan[0] >> 1;
soft_pwm_count_fan[0] = ((soft_pwm_count_fan[0] & pwm_mask) + soft_pwm_amount_fan[0]) >> 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean this…?

soft_pwm_count_fan[0] = (soft_pwm_count_fan[0] & pwm_mask)
                         + (soft_pwm_amount_fan[0]) >> 1);

It would be a good idea to check with @StefanBruens before making this kind of change. Here is the original commit with dithering implemented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this change is purely cosmetic because addition and subtraction operators have precedence over bitwise left shift and right shift operators ie (x+y>>1 == (x+y) >> 1).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Holy crap, you're right. It's one of those aspects of C++ operator precedence that makes me shake my head.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the current implementation is wrong, then. The ">> 1" scaling should only be applied to the fan speed value, not the remainder.
The bug is not critical (resolution is halved), but should be corrected anyway.

.travis.yml Outdated
- opt_set_adv I2C_SLAVE_ADDRESS 63
- opt_enable_adv ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE LCD_INFO_MENU
- opt_add_adv Z2_MIN_PIN 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would appear that all these tests can be moved to the MINIRAMBO tests which follow below.

@thinkyhead
Copy link
Member

thinkyhead commented Nov 13, 2017

Looks pretty good at this point. Squashed commits and will merge shortly.

@RowanMeara
Copy link
Contributor Author

Why is there no point in setting all the endstops? With the endstop interrupts feature they all can be used to kill a print.

@thinkyhead
Copy link
Member

Sure, they are useful in situ. However, they are not necessary for the Travis CI build.

@thinkyhead thinkyhead merged commit d2df00b into MarlinFirmware:bugfix-1.1.x Nov 13, 2017
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Nov 13, 2017
mtm88001 pushed a commit to mtm88001/Marlin that referenced this pull request Dec 9, 2017
* Fix up Travis CI and compile warnings/errors

* No ULTRA_LCD with REPRAP_DISCOUNT_SMART_CONTROLLER

* No point in setting all the endstop plugs
damicreabox pushed a commit to damicreabox/Marlin that referenced this pull request Sep 14, 2018
* Fix up Travis CI and compile warnings/errors

* No ULTRA_LCD with REPRAP_DISCOUNT_SMART_CONTROLLER

* No point in setting all the endstop plugs
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

4 participants