Order of Parameter from Timer-Functions

classic Classic list List threaded Threaded
5 messages Options
Stefan Baumann Stefan Baumann
Reply | Threaded
Open this post in threaded view
|

Order of Parameter from Timer-Functions

This post was updated on .
Hi,

I just cloned the actual master-Branch and saw that the Timer-Parameters are switched:
tmr.gettimediff( id, tstart, tend)

I have to switch tstart and tend to receive the correct value. The new function
tmr.getdiffnow(id, tstart)

returns the same wrong values.

I saw that there was a Patch from Bogdan on Jan 21, 2012 witch should put these things in correct order. I found this problem because
uart.read( id, format, [timeout], [timer_id] )

doesnt work in the mode with a "positive number" to block with a timer or until the number of characters are received.


I tested this with LM3S9B92 LM3S8962.

Sample eLua Code:
tstart = tmr.start( 0 )
tmr.delay( 1, 1000000 )
tend = tmr.read( 0 )

print( tstart, tend, tmr.gettimediff( 0, tstart, tend ) )
print( tstart, "--", tmr.getdiffnow(0, tstart) )

--> 4294967295    4244958673    84899173
--> 4294967295    --                 84897392



regards,
Stefan
Marcus Vinicius Costa Marcus Vinicius Costa
Reply | Threaded
Open this post in threaded view
|

Re: Order of Parameter from Timer-Functions

Hi Stefan,

I have the similar problem but with net.accept when i use with timeout.
I do this test in LM3S8962 too:

    local maxdelay = tmr.getmaxdelay( 0 )
   
print("maxdelay: "..maxdelay)
    if (maxdelay > 10000000) then maxdelay = 10000000 end
    print("timeout: "..maxdelay)

    tstart = tmr.read( 0 )
    sock, remoteip, err = net.accept( 7474, 0, maxdelay)
    tend = tmr.read( 0 )
    print( tstart, tend, tmr.gettimediff( 0, tstart, tend ) )

And the output are:

>maxdelay:                          85899345
>timeout:                             10000000
>4244932445    4294962417    1000599

I change the timeout value but the function net.accept never change the internal timeout, always print 1000599

The values in function tmr.gettimediff are correctly and I use the last version in git.

Its very dificult to implement this...

regards,
Marcus

2012/5/4 Stefan Baumann <[hidden email]>
Hi,

I just cloned the actual master-Branch and saw that the Timer-Parameters are
switched:
tmr.gettimediff( id, tstart, tend)

I have to switch tstart and tend to receive the correct value. The new
function
tmr.getdiffnow(id, tstart)

returns the same wrong values.

I saw that there was a Patch from Bogdan on Jan 21, 2012 witch should put
these things in correct order. I found this problem because
uart.read( id, format, [timeout], [timer_id] )

doesnt work in the mode with a "positive number" to block with a timer or
until the number of characters are received.


I tested this with LM3S9B92 LM3S8962.

Sample eLua Code:
tstart = tmr.start( 0 )
tmr.delay( 1, 1000000 )
tend = tmr.read( 0 )

print( tstart, tend, tmr.gettimediff( 0, tstart, tend ) )
print( tstart, "--", tmr.getdiffnow(0, tstart) )

--> 4294967295      <a href="tel:4244958673" value="+14244958673">4244958673      84899173
--> 4294967295      --                   84897392



regards,
Stefan

--
View this message in context: http://elua-development.2368040.n2.nabble.com/Order-of-Parameter-from-Timer-Functions-tp7527150.html
Sent from the eLua Development mailing list archive at Nabble.com.
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Order of Parameter from Timer-Functions

In reply to this post by Stefan Baumann
Hi,

On Fri, May 4, 2012 at 4:49 PM, Stefan Baumann <[hidden email]> wrote:

> Hi,
>
> I just cloned the actual master-Branch and saw that the Timer-Parameters are
> switched:
> tmr.gettimediff( id, tstart, tend)
>
> I have to switch tstart and tend to receive the correct value. The new
> function
> tmr.getdiffnow(id, tstart)
>
> returns the same wrong values.
>
> I saw that there was a Patch from Bogdan on Jan 21, 2012 witch should put
> these things in correct order. I found this problem because
> uart.read( id, format, [timeout], [timer_id] )
>
> doesnt work in the mode with a "positive number" to block with a timer or
> until the number of characters are received.
>
>
> I tested this with LM3S9B92 LM3S8962.
>
> Sample eLua Code:
> tstart = tmr.start( 0 )
> tmr.delay( 1, 1000000 )
> tend = tmr.read( 0 )
>
> print( tstart, tend, tmr.gettimediff( 0, tstart, tend ) )
> print( tstart, "--", tmr.getdiffnow(0, tstart) )
>
> --> 4294967295      4244958673      84899173
> --> 4294967295      --                   84897392

Thanks for the bug report. Until we fix this, try to use the system
timer as a workaround. gettimediff works as expected if used with the
system timer. To use the system timer, simply specify "nil" as the
timer ID.

Best,
Bogdan

>
>
>
> regards,
> Stefan
>
> --
> View this message in context: http://elua-development.2368040.n2.nabble.com/Order-of-Parameter-from-Timer-Functions-tp7527150.html
> Sent from the eLua Development mailing list archive at Nabble.com.
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Stefan Baumann Stefan Baumann
Reply | Threaded
Open this post in threaded view
|

Re: Order of Parameter from Timer-Functions


I've found a solution and made a pull-request..

regards,
stefan
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Order of Parameter from Timer-Functions

Fixed on master.

Best,
Bogdan

On Wed, May 9, 2012 at 12:22 PM, Stefan Baumann <[hidden email]> wrote:

>
> I've found a solution and made a pull-request..
>
> regards,
> stefan
>
> --
> View this message in context: http://elua-development.2368040.n2.nabble.com/Order-of-Parameter-from-Timer-Functions-tp7527150p7542330.html
> Sent from the eLua Development mailing list archive at Nabble.com.
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev