Hi,
I'm writing, a software for K22-based board. I have great problem, I'd like to write a global Object. I'm trying to insert them,
but no constructor runs before main. resulting in the impossibility of initializing the Objects. This creates errors at Run-Time.
i.e. Each Objects, writen below, are defined outside main and Each Object is outside of any method.
tDebIn Interlock(PTB10); /* interlock*/
/*DipSwitch*/
tDebIn DIP_SW1(PTC12);
tDebIn DIP_SW2(PTC13);
tDebIn DIP_SW3(PTC14);
tDebIn DIP_SW4(PTC15);
tDebInAs TRIGGER(PTB11);
nobody Costructur CLass is executed. What I have to do, to initialize the Object before the main
goes into execution.
See https://mcuoneclipse.com/2022/10/24/shut-down-c-embedded-systems-with-calling-the-global-destructors... how constructors (and even destructors) are handled from the startup code.
I hope this helps,
Erich