Welcome! Log In Create A New Profile

Advanced

Using timers/delays in the firmware to change "configuration" parameters

Posted by DennyP 
Using timers/delays in the firmware to change "configuration" parameters
June 17, 2019 05:17AM
Hello all,

I was wondering if there is anyone that has experience implementing delay/timer functions to modify Marlin code, specifically in 'configuration.h"??
I would like to say, after 100000ms after the board being turned on, to change parameters in the Marlin code e.g. stepper motor direction.


Unfortunately, when I try to compile marlin with blank void setup (){} and void loop (){} calls to write a timer function, I get the following compile error:


Arduino: 1.5.3 (Windows NT (unknown)), Board: "Arduino Mega 2560 or Mega ADK"

In file included from /Marlin.h:30,
from BlinkM.cpp:5:
Configuration.h:6: error: previous declaration of 'void loop()' with 'C++' linkage
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:120: error: conflicts with new declaration with 'C' linkage

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.



Any guidance would be appreciated.

Kind Regards
Re: Using timers/delays in the firmware to change "configuration" parameters
June 17, 2019 05:47AM
you don't put code in .h files
and in arduino you can only have one one function called setup and one function named loop. In marlin these are in Marlin_main.cpp

Also stepper motor direction is determined at compile time, its is not something you can change mid run. Not without changing the code...

Edited 2 time(s). Last edit at 06/17/2019 05:58AM by Dust.
Sorry, only registered users may post in this forum.

Click here to login