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

Compile fails if SD_FAST_XFER_AKTIV is on and PID is off #167

Merged
merged 1 commit into from
May 1, 2012

Conversation

OhmEye
Copy link
Contributor

@OhmEye OhmEye commented May 1, 2012

Bug: turn on SD_FAST_XFER_AKTIV and compilation fails if PID is disabled.

Fix:
If SD_FAST_XFER_AKTIV is defined, fast_xfer() only declares g_heater_pwm_val if PIDTEMP is defined, but later assigns g_heater_pwm_val=0 regardless whether PIDTEMP is defined or not. If PIDTEMP is undefined, g_heater_pwm_val is undeclared at compile time and generates the appropriate error. I solved by not using g_heater_pwm_val if PIDTEMP is undefined (and therefor undeclared.)

Also, the extern declaration was as an int, when g_heater_pwm_val is defined as a volatile unsigned char. This caused a duplicate declaration error, which was solved by changing the declaration in fast_xfer() to
match the definition. I didn't dig deeper to try to understand if the mismatch was intentional or test operation other than verify the compile errors no longer occur.

enabled.

Fix:
If SD_FAST_XFER_AKTIV is defined, fast_xfer() only declares
g_heater_pwm_val if PIDTEMP is defined, but later assigns
g_heater_pwm_val=0 regardless whether PIDTEMP is defined or not. If
PIDTEMP is undefined, g_heater_pwm_val is undeclared at compile time and
generates the appropriate error. I solved by not using g_heater_pwm_val
if PIDTEMP is undefined (and therefor undeclared.)

Also, the extern declaration was as an int, when g_heater_pwm_val is
defined as a volatile unsigned char. This caused a duplicate declaration
error, which was solved by changing the declaration in fast_xfer() to
match the definition. I didn't dig deeper to try to understand if the
mismatch was intentional or test operation other than verify the compile
errors no longer occur.
kliment added a commit that referenced this pull request May 1, 2012
Fix compile error if SD_FAST_XFER_AKTIV is on and PID is off
@kliment kliment merged commit d651a6c into kliment:master May 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants