Search found 842 matches

by pbreed
Fri May 29, 2020 2:02 pm
Forum: NetBurner Software
Topic: How to get milliseconds since boot?
Replies: 8
Views: 305

Re: How to get milliseconds since boot?

Actually Get_msec is in future versions of the tools.
by pbreed
Fri May 29, 2020 1:59 pm
Forum: NetBurner Software
Topic: How to get milliseconds since boot?
Replies: 8
Views: 305

Re: How to get milliseconds since boot?

Just added that to the repository so it should be in future versions of the tools.
by pbreed
Fri May 29, 2020 1:54 pm
Forum: NetBurner Software
Topic: How to get milliseconds since boot?
Replies: 8
Views: 305

Re: How to get milliseconds since boot?

Or go to the stopwatch file listed above and add this at the end...


unsigned long long GetMsec()
{
unsigned long long tv = GetNow();
tv/=(CPU_CLOCK/1000);
return tv;
}
by pbreed
Fri May 29, 2020 1:50 pm
Forum: NetBurner Software
Topic: How to get milliseconds since boot?
Replies: 8
Views: 305

Re: How to get milliseconds since boot?

With zero additional work there are two variables #include <nbrtos.h> TimeTick and Secs... TimeTick happens each tick (defaults to 20 per second) So that gets you to 50 msec with ZERO work. If you need better: #include <stopwatch.h> StopWatch my_stopwatch; my_stopwatch.Start(); Then you can get the ...
by pbreed
Sat May 23, 2020 3:49 am
Forum: NetBurner Software
Topic: Trouble with FORM SUBMIT
Replies: 2
Views: 263

Re: Trouble with FORM SUBMIT

Your SetCallback function call is commented out.
by pbreed
Wed May 06, 2020 6:48 am
Forum: NetBurner Software
Topic: ReadWithTimeout function
Replies: 8
Views: 592

Re: ReadWithTimeout function

V for volatile... Meaning its likely to change at any time and the compiler can't optimize it away,,, Suppose Secs was not volatile... while(Secs<10) { OSTimeDly(20); } The compiler will only check Secs on entry, since nothing in the while loop changes Secs, the compiler will optimize the check away...
by pbreed
Tue May 05, 2020 9:04 am
Forum: NetBurner Software
Topic: ReadWithTimeout function
Replies: 8
Views: 592

Re: ReadWithTimeout function

#include <utils.h>

TimeTick is the RTOS time counter.
All RTOS timeout events are in TimeTicks.
(Not task switches, just timeout events)

You also have Secs (full seconds) availible.
by pbreed
Mon May 04, 2020 3:34 pm
Forum: NetBurner Software
Topic: ReadWithTimeout function
Replies: 8
Views: 592

Re: ReadWithTimeout function

At least one Error Timetick should be TimeTick
by pbreed
Mon May 04, 2020 3:33 pm
Forum: NetBurner Software
Topic: ReadWithTimeout function
Replies: 8
Views: 592

Re: ReadWithTimeout function

Serial takes time to transfer data,,,, So the you see the $, then read whats still in the buffer (34 chars) The rest had not arrived yet... ReadWithTimeout could return a single byte,,,, The later libraries in 3.2 have the function: int ReadAllWithTimeout(int fd, char *buf, int nbytes, unsigned long...
by pbreed
Tue Apr 28, 2020 3:43 am
Forum: NetBurner Software
Topic: MOD5270 I2C Problem with ISL12026 RTC and I2C timeouts
Replies: 7
Views: 325

Re: MOD5270 I2C Problem with ISL12026 RTC and I2C timeouts

Try stealing the I2CScan function from the exmaple

nburn\examples\standardsatack\I2C\EthernetToI2C.

This will tell you if the hardware is hooked up correctly, lines, pull ups, pin initalization etc....