Fixed missing headers + RTC bug
This commit is contained in:
parent
2e2438f8ca
commit
23dc34c1cf
|
@ -36,6 +36,10 @@
|
|||
#include <math.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <resources/battclock.h>
|
||||
#include <clib/battclock_protos.h>
|
||||
#include <clib/utility_protos.h>
|
||||
|
||||
#ifdef Debug
|
||||
#undef Debug
|
||||
#endif
|
||||
|
|
10
time_amiga.c
10
time_amiga.c
|
@ -257,6 +257,7 @@ void delete_timer(struct timerequest *request)
|
|||
int amiga_get_time(struct timeval *tv)
|
||||
{
|
||||
struct timerequest *request;
|
||||
long tzoffset = (long)round(utcoffset * 60.0 * 60.0);
|
||||
|
||||
request = create_timer();
|
||||
if (request == NULL)
|
||||
|
@ -266,6 +267,7 @@ int amiga_get_time(struct timeval *tv)
|
|||
DoIO((struct IORequest*)request);
|
||||
|
||||
*tv = request->tr_time;
|
||||
tv->tv_secs = (long)tv->tv_secs - tzoffset;
|
||||
|
||||
delete_timer(request);
|
||||
return 0;
|
||||
|
@ -295,13 +297,17 @@ int amiga_set_time(struct timeval *tv)
|
|||
|
||||
void amiga_save_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
long tzoffset;
|
||||
|
||||
if(!validtime)
|
||||
return;
|
||||
|
||||
struct timeval tv;
|
||||
ResetBattClock();
|
||||
amiga_get_time(&tv);
|
||||
WriteBattClock(tv.tv_secs);
|
||||
|
||||
tzoffset = (long)round(utcoffset * 60.0 * 60.0);
|
||||
WriteBattClock((long)tv.tv_secs + tzoffset);
|
||||
}
|
||||
|
||||
void amiga_sync_time(int seconds)
|
||||
|
|
Loading…
Reference in New Issue