Hi guys!
To “Juraj”:
- oh thanks man !
To “MoranS”:
- Oh okey thanks man!
- Yeah makes sense … gonna get rid of it.
- Alright.
- I’am little bit confues by two parts of the code.
if(Serial3.availableForWrite() < highWaterMark)
{
lastSerial3Transmit = millis();
}
- Won’t the condition be always false? Like - I mean even if theres “0” chars in the TX buffer then “0<0“ will always be false? Because “highWaterMark” will be always “0” same ass “Serial3.availableForWrite()”? And then the “<” condition won’t be true?
- why are you saving data into the “highWaterMark” variable right in the end of the function, because when it is called next time, it will overwrite it selfe?
static int highWaterMark = 0; //but here it will overwrite it self?
…
{
highWaterMark = Serial3.availableForWrite(); //here you are saving some data in it
if(millis() - lastSerial3Transmit > TransmitHoldTime)
{
…
- Can’t I just use this equation for calculating how much time I need t wait until all the chars are sended?
TimeToWait~~=((DataSize+StopBits+StartBits)*CharsGoingToSended)/BaudRate~~