¿ªÔÆÌåÓý

Re: sBITX 64Bit Pi Image Available #sBitx


 

JJ, you probably right about our poor reputation. Some of it is also due to the fact that where the radio works, there is less opinion and where it doesn't there is large traffic on this group.
However, this code is valid and for a good reason.
The accurate time is needed in to be called repeatedly in the sound_loop() function. It cannot a system call to time() as it can take a long time for the kernel to return the correct time. Instead, the time_sbitx calculates it with the help of millis() and the time_delta that is calculated at the start of the sbitx process.
However, given that the sbitx uses multiple threads, the main thread is not guaranteed to calculate time_delta before the first call to the time_sbitx() maybe called.
This is not sloppy, it is an optimal code written to run sbitx in a real time environment.
- f

On Sat, Mar 23, 2024, 1:29 AM JJ - W9JES <w9jes@...> wrote:
On Fri, Mar 22, 2024 at 01:06 PM, JerryP wrote:
in sbitx_gtk,c is the function,
?
time_t time_sbitx(){
????? if (time_delta)
????? ? ?? return ?(millis()/1000l) + time_delta;
?????? else
??????????? return time(NULL);
}
?
If you just return(NULL);? instead of return (millis()/1000l) + time_delta; the problem should go away. I don't know why time_delta is used if there's a RTC and the RTC is synced with internet time servers.?

--
?
Jerry, AC9NM
Thanks Jerry. I will test it and see if the issue goes away. I think this is just more garbage code that wasn't removed from the file for earlier versions of sBitx hardware. That is the unfortunate issue that frustrates people and why HF Signals has a poor reputation.


-JJ

Join [email protected] to automatically receive all group messages.