Please change "Soft_Uart_Read" help text

Post your requests and ideas on the future development of mikroPascal.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Please change "Soft_Uart_Read" help text

#1 Post by Dany » 27 Jul 2008 17:26

Hi,
Apparently the "Soft_Uart_Read" library routine is blocking, but
the MicroPascal library "help" states it is a non-blocking function call (mP v 8.0.0.1):

Code: Select all

Function receives a byte via software UART. Parameter error will be zero if the transfer was successful. This is a non-blocking function call, so you should test the error manually (check the example below).
It would be very nice if the function call became non blocking (or even with a definable time-out). I can see this will be a huge problem without e.g. using interrupts.

Anyway, if this is not possible, then perhaps the help text can be modified.

Thanks in advance.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

ka5mal
Posts: 23
Joined: 20 Apr 2007 16:56
Location: Colombo, Sri Lanka
Contact:

#2 Post by ka5mal » 01 Jul 2009 13:26

Dany,

I also agree. Soft_uart_read() is a blocking call in MB Pro also.

The code does not flow down and wait indefinitely for a byte from the RX pin. This is not good. We need to have an exit mechanism in the event that there is no RX byte.
To understand the limits of possible, you have to venture a little into the impossible.

User avatar
mileta.miletic
mikroElektronika team
Posts: 493
Joined: 05 Jun 2009 14:46
Location: Belgrade, Serbia
Contact:

#3 Post by mileta.miletic » 02 Jul 2009 15:37

Hi,

Soft_uart_read() is a blocking function call (waits for start bit). You can unblock it by calling Soft_UART_Break routine.
Regards,
Mileta

Post Reply

Return to “mikroPascal Wish List”