Seite 1 von 2
out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 11:36
von pete68
salve
c'è modo di ritardare la partenza del firmware, diciamo di 10 secondi? Ho provato a inserire delay(10000) in void setup() del file app_main.cpp ma l'esecuzione è lo stesso immediata.
grazie
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 11:44
von Doumanix
Google übersetzt das so:
Gibt es eine Möglichkeit den Start der Firmware zu verzögern, sagen wir um 10 Sekunden? Ich habe versucht, eine Verzögerung (10000) in void setup () der Datei app_main.cpp einzufügen, aber die Ausführung ist sofort dieselbe.
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 11:48
von Mirko
deepl.com ist da etwas besser
hallo
Gibt es eine Möglichkeit, den Start der Firmware zu verzögern, z. B. um 10 Sekunden? Ich habe versucht, delay(10000) in void setup() der Datei app_main.cpp einzufügen, aber die Ausführung erfolgt immer noch sofort.
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 11:50
von Marinux
pete68, maybe we can agree to write in English?
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 11:52
von pete68
I realize that Italian is not exactly the most spoken language in the world but...
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 14:40
von gnampf
there are some architectures where such big delays aren't supported, so maybe try to do 100 times 100ms. But maybe there's a better solution if you tell us the reason for the delay
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 15:29
von pete68
Thanks for the reply.
My problem is the blocking of devices in case of blackout (I have more than one of these out-cs-bim 112 installed).
Maybe a conflict case, so I would like to start devices with different delays.
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 16:11
von Doumanix
I don't get the point. What will be blocked in the case of a blackout? This is a normal use case (black out & restart of the whole installation) and in my opinion, this should cause no trouble.
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 17:00
von pete68
I had to modify the original project to use monostable relays. something is obviously wrong.
Re: out-cs-bim 112 delay on start
Verfasst: 24. Sep 2021, 22:07
von Mirko
Hello pete68,
did you mean the delay() function of the sblib? It is coded a bit strange and would fall back to measuring microseconds instead of milliseconds if there is still an interrupt active. In this case the delay would be only 10ms...
Salve pete68,
intendevi la funzione delay() della sblib? È codificato in modo un po' strano e tornerebbe a misurare i microsecondi invece dei millisecondi se un interrupt è ancora attivo. In questo caso il ritardo sarebbe solo di 10ms...
Code: Alles auswählen
void delay(unsigned int msec)
{
unsigned int lastSystemTime = systemTime;
if (__get_IPSR() == 0x0) // check that no interrupt is active, otherwise "while" will end in a infinite loop
{
while (msec)
{
if (lastSystemTime == systemTime)
{
__WFI();
}
else
{
lastSystemTime = systemTime;
--msec;
}
}
}
else
{
// fall-back to waiting SysTick's
delayMicroseconds(msec);
}
}