Further information: I put a delay before the first serial.println in hardware.cpp and uncomment cms_setup():
debug.serial.println(F("cmd_setup"));
delay(2000);
// cmd_setup();
debug.serial.println(F("cmd_setup1"));
delay(2000);
The output with using VisualMicro is following:
Opening port
Port open
HardwareSetup started
HardwareSetup finished
!03,Mow Motor Sensor Offset: 0.000000
bht->reset diable flagCruiseSpiral
!04,SET BEHAV -> BH_NONE
cmd_setup
cmd_setup1
!03,Mow MotorDisabled: current high
Until here all works fine. Now I put in cmd_setup();
debug.serial.println(F("cmd_setup"));
delay(1000);
cmd_setup();
debug.serial.println(F("cmd_setup1"));
delay(1000);
And got following result with VisualMicro:
Opening port
Port open
Hard <--- now it stops here
This means cmd_setup() is never been called.
It looks like the compiler or linker makes this problem in VisualMicro
I compile now the same code without changing anything with Arduino and get following result:
HardwareSetup started
HardwareSetup finished
!03,Mow Motor Sensor Offset: 0.000000
bht->reset diable flagCruiseSpiral
!04,SET BEHAV -> BH_NONE
cmd_setup
cmd_setup1
!03,Mow MotorDisabled: current high
Which is correct.
Is there a possibillity that VisualMicro stores information which will be used now instaed of compiling all new?
I compiled all new and deletet C:\Users\Kai\AppData\Local\Temp\VMBuilds\Edison
But this doesn't help.
Then I deleted
C:\Users\Kai\AppData\Local\Temp\VMBuilds
And have the same problem.