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 error on gen6 electronics #28

Closed
sashimanu-san opened this issue Dec 7, 2011 · 5 comments
Closed

compile error on gen6 electronics #28

sashimanu-san opened this issue Dec 7, 2011 · 5 comments

Comments

@sashimanu-san
Copy link

Given
#define MOTHERBOARD 5 (as per comments)
and
Board -> Sanguino selected in Arduino software Tools menu
build generates an error:

Marlin.cpp: In function 'void process_commands()': Marlin:642: error: 'sprintf' was not declared in this scope

Code piece in question

case 30: //M30 take time since the start of the SD print or an M109 command
    {
      stoptime=millis();
      char time[30];
      unsigned long t=(stoptime-starttime)/1000;
      int sec,min;
      min=t/60;
      sec=t%60;
      sprintf(time,"%i min, %i sec",min,sec);
      SERIAL_ECHO_START;
      SERIAL_ECHOLN(time);
      LCD_MESSAGE(time);
    }
    break;

Quick fix for me was to comment out the sprintf() call since I don't have a LCD anyway.

Applies to revision ErikZalm@5535e51

@bkubicek
Copy link
Contributor

bkubicek commented Dec 7, 2011

Thats not only doing stuff for lcd, but also for the serial. Sprintf is usually defined in #include <stdio.h>, and that would be should be a proper fix.
Will try as soon as possible. Which arduino environment did you use?

@sashimanu-san
Copy link
Author

Arduino 0022

Yes, the obvious fix worked.
Added the abovementioned #include <stdio.h> near the top of marlin.cpp, uncommented the call, it built without issues.

(I do have some C/AVR experience, just in a big haste trying to make the 3d printer work, and adding extra stdlib includes may possibly mess up the project, i.e. by blowing the binary larger than MCU's flash etc.)

Thanks for the reply.

@ErikZalm
Copy link
Contributor

ErikZalm commented Dec 7, 2011

Hello,

Copy the Sanguino dir from Marlin to the adrduino dirs. We updated the sanguino files.
(See the Marlin_v1 README)

@bkubicek
Copy link
Contributor

this should be allright now, especially after stio.h is not in marlin.h

thinkyhead referenced this issue in thinkyhead/Marlin Dec 3, 2016
tonokip pushed a commit to ultimachine/Marlin that referenced this issue Jan 24, 2022
…ter'

Resolve "Dual Extruder calibration cube front side"

Closes MarlinFirmware#28

See merge request lulzbot3d/marlin!21
@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 24, 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

3 participants