Compare commits
No commits in common. "b9eaad375a6ed306472bde8115091c3a7cd61d10" and "314f6913d7c86aa1fd63d7b37410713e14da6be6" have entirely different histories.
b9eaad375a
...
314f6913d7
4 changed files with 14 additions and 21 deletions
3
d3d.rc
3
d3d.rc
|
|
@ -11,5 +11,4 @@ statusfile d3d/irena-status
|
|||
datafile d3d/irena-%Y-%m-%dT%H:%M:%SZ.dat
|
||||
counterfile d3d/irena-%Y-%m-%dT%H:%M:%SZ.hst
|
||||
socket unix d3d/irena-control interactive force
|
||||
cron next init reset 60 script d3dinit.rc
|
||||
cron next ever 60 script dribble.rc
|
||||
cron next init 60 script d3dinit.rc
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
irena pres/inj
|
||||
irena uart/base=85
|
||||
irena var uart_size = -1
|
||||
irena var rtc_drift[3] = 0x20f04
|
||||
irena v rtc_drift[3] = 0x20f04
|
||||
clock_sync 3600
|
||||
set_clock fudge config
|
||||
set_clock
|
||||
set_clock drift config
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
irena var/rom[D & 0x7fffc]
|
||||
irena var/ram[D & 0x7ffc]
|
||||
irena var D=D+4
|
||||
22
irena.c
22
irena.c
|
|
@ -2412,11 +2412,11 @@ int set_clock(int do_sleep)
|
|||
struct timespec ts;
|
||||
poll_uart(1);
|
||||
if (!clock_gettime(CLOCK_REALTIME, &ts)) {
|
||||
while (ts.tv_nsec < 900000000) {
|
||||
ts.tv_nsec += 50000000;
|
||||
while (ts.tv_nsec < 750000000) {
|
||||
ts.tv_nsec += 100000000;
|
||||
clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, 0);
|
||||
if (verbose(3))
|
||||
fprintf(mout, "slept 50ms ns=%lu\n", ts.tv_nsec);
|
||||
if (verbose(2))
|
||||
fprintf(mout, "slept 100ms ns=%lu\n", ts.tv_nsec);
|
||||
poll_uart(1);
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
}
|
||||
|
|
@ -3059,7 +3059,7 @@ int process_cmd(char *l)
|
|||
}
|
||||
|
||||
if (!strcmp(av[0], "irena") || !strcmp(av[0],"var")) {
|
||||
if (help || na <= 1) {
|
||||
if (help) {
|
||||
fprintf(mout,
|
||||
"usage: irena «command»\n"
|
||||
"usage: var «variable command»\n"
|
||||
|
|
@ -3080,19 +3080,19 @@ int process_cmd(char *l)
|
|||
}
|
||||
|
||||
if (!strcmp(av[0], "set_clock")) {
|
||||
int do_sleep = 1;
|
||||
int do_sleep = clock_sleep;
|
||||
if (na >= 2) {
|
||||
do_sleep = 0;
|
||||
int config = !strcmp(av[na-1], "config");
|
||||
if ( !strcmp(av[1], "nosleep")) do_sleep = 0;
|
||||
else if (!strcmp(av[1], "sleep")) do_sleep = 1;
|
||||
if (!strcmp(av[1], "sleep")) do_sleep = 1;
|
||||
else if (!strcmp(av[1], "drift")) do_sleep = 2;
|
||||
else if (!strcmp(av[1], "fudge")) do_sleep = 3;
|
||||
else if (!config || na>2) do_sleep = -1;
|
||||
if (na>3 || na>2 && !config)
|
||||
else if (!config) do_sleep = -1;
|
||||
if (na>3 || na>2 && !do_sleep)
|
||||
do_sleep = -1;
|
||||
if (help || do_sleep < 0) {
|
||||
fprintf(mout,
|
||||
"usage: set_clock [nosleep|sleep|drift|fudge] [config]\n"
|
||||
"usage: set_clock [sleep|drift|fudge] [config]\n"
|
||||
"- set the µC RTC to the current host time.\n"
|
||||
"option `sleep`: Wait until the end of the current second.\n"
|
||||
"option `drift`: Sleep, set clock and ask the µC to adjust the clock speed.\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue