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

Can't compile for Melzi #1243

Closed
Lukelectro opened this issue Dec 27, 2014 · 11 comments
Closed

Can't compile for Melzi #1243

Lukelectro opened this issue Dec 27, 2014 · 11 comments

Comments

@Lukelectro
Copy link

Sory to make a new issue instead of fixing one, but I get:

Marlin_main.cpp:360: error: ‘analogInputToDigitalPin’ was not declared in this scope
Marlin_main.cpp:360: error: ‘analogInputToDigitalPin’ was not declared in this scope
Marlin_main.cpp:360: error: ‘analogInputToDigitalPin’ was not declared in this scope
Marlin_main.cpp:360: error: ‘analogInputToDigitalPin’ was not declared in this scope

When I try to compile the current devellopment branch for Melzi
(Add

define MOTHERBOARD BOARD_MELZI

above

ifndef MOTHERBOARD

#define MOTHERBOARD BOARD_ULTIMAKER

endif

)

The analogInputToDigitalPin is part of the Sensitive_pins declaration in pins.h, its in there 4 times hence 4 errors.

When compiling for the ultiboard it compiles fine so I guess it is somewhere in the part of pins.h applicable to melzi.

I´ll keep looking into this.

@Lukelectro
Copy link
Author

Hmm, even more errors when compiling for GEN6 or GEN6 deluxe... (The makerspace uses GEN6 in some printers)

@Lukelectro
Copy link
Author

OK. In Marlin.h there is a section:

#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
//Arduino < 1.0.0 does not define this, so we need to do it ourselves
#define analogInputToDigitalPin(p) ((p) + A0)
#endif

This is where analogInputToDigitalPin is declared.
I use arduino 1.0.5, so above 1.0.0. So it does not get declared here and should have been declared by arduino. But it is not (?!) For now copying the line # define analogInputToDigitalPin(p) ((p) + A0) to above #define motherboard in configuration.h is a work around.

@alhirzel
Copy link
Contributor

alhirzel commented Jan 2, 2015

@Lukelectro could you test #1291 ?

@Lukelectro
Copy link
Author

I would like to, but I'm still new to github. So, here is what I think I should do, please CMIIW:

  1. Get your modified code
  2. See if "it works" on my melzi (in this case only see if it compiles)
  3. report results here.

Step 1 is the problem. If I just copy-paste https://github.com/alhirzel/Marlin/blob/Development/Marlin/Marlin.h to replace my own, I get all sorts of unrelated errors because I just replaced a single file and all sorts of references go wrong. (I should instead clone the entire project, then pull all files you changed, I think)

However, if I just add

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p) + A0)
#endif

to the "old" marlin.h (the one I had), and remove my own workaround, it compiles fine.

@boelle
Copy link
Contributor

boelle commented Jan 2, 2015

you can see what changes was made here if it helps you

https://github.com/ErikZalm/Marlin/pull/1291/files

@Lukelectro
Copy link
Author

Thats where I got the file from. But I think it would help me more if I read https://help.github.com/categories/bootcamp/ . ;)

@gregrebholz
Copy link
Contributor

@Lukelectro Try this... from a git client installed on your machine:

  1. git clone https://github.com/ErikZalm/Marlin (this gets you a whole clone of the Marlin git repository)
  2. git checkout Development (this puts your working directory on the latest bleeding edge)
  3. git fetch origin pull/1291/head:testing (this is creating a new local branch of your git repo called "testing" and populating it with the changes in pull request 1291 from your repo's origin - ErikZalm/Marlin)
  4. git checkout testing (to move this new branch)

Then the code in your directory should be exactly as it would be if pull req 1291 is merged into the Development branch.

@Lukelectro
Copy link
Author

Thanks for your help. The code in my directory is indeed the same (it has the

#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) ((p) + A0)
#endif

bit added)

And, as expected, it compiles.

I have not changed all the settings to suit my printer yet, so I have not done other tests. Yet.

@alhirzel
Copy link
Contributor

alhirzel commented Jan 3, 2015

Glad this fixed the issue for you. =]

@Lukelectro
Copy link
Author

Yes. Closing.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants