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
|
datafile d3d/irena-%Y-%m-%dT%H:%M:%SZ.dat
|
||||||
counterfile d3d/irena-%Y-%m-%dT%H:%M:%SZ.hst
|
counterfile d3d/irena-%Y-%m-%dT%H:%M:%SZ.hst
|
||||||
socket unix d3d/irena-control interactive force
|
socket unix d3d/irena-control interactive force
|
||||||
cron next init reset 60 script d3dinit.rc
|
cron next init 60 script d3dinit.rc
|
||||||
cron next ever 60 script dribble.rc
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
irena pres/inj
|
irena pres/inj
|
||||||
irena uart/base=85
|
irena v rtc_drift[3] = 0x20f04
|
||||||
irena var uart_size = -1
|
|
||||||
irena var rtc_drift[3] = 0x20f04
|
|
||||||
clock_sync 3600
|
clock_sync 3600
|
||||||
set_clock fudge config
|
set_clock drift config
|
||||||
set_clock
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
struct timespec ts;
|
||||||
poll_uart(1);
|
poll_uart(1);
|
||||||
if (!clock_gettime(CLOCK_REALTIME, &ts)) {
|
if (!clock_gettime(CLOCK_REALTIME, &ts)) {
|
||||||
while (ts.tv_nsec < 900000000) {
|
while (ts.tv_nsec < 750000000) {
|
||||||
ts.tv_nsec += 50000000;
|
ts.tv_nsec += 100000000;
|
||||||
clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, 0);
|
clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, 0);
|
||||||
if (verbose(3))
|
if (verbose(2))
|
||||||
fprintf(mout, "slept 50ms ns=%lu\n", ts.tv_nsec);
|
fprintf(mout, "slept 100ms ns=%lu\n", ts.tv_nsec);
|
||||||
poll_uart(1);
|
poll_uart(1);
|
||||||
clock_gettime(CLOCK_REALTIME, &ts);
|
clock_gettime(CLOCK_REALTIME, &ts);
|
||||||
}
|
}
|
||||||
|
|
@ -3059,7 +3059,7 @@ int process_cmd(char *l)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(av[0], "irena") || !strcmp(av[0],"var")) {
|
if (!strcmp(av[0], "irena") || !strcmp(av[0],"var")) {
|
||||||
if (help || na <= 1) {
|
if (help) {
|
||||||
fprintf(mout,
|
fprintf(mout,
|
||||||
"usage: irena «command»\n"
|
"usage: irena «command»\n"
|
||||||
"usage: var «variable command»\n"
|
"usage: var «variable command»\n"
|
||||||
|
|
@ -3080,19 +3080,19 @@ int process_cmd(char *l)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(av[0], "set_clock")) {
|
if (!strcmp(av[0], "set_clock")) {
|
||||||
int do_sleep = 1;
|
int do_sleep = clock_sleep;
|
||||||
if (na >= 2) {
|
if (na >= 2) {
|
||||||
|
do_sleep = 0;
|
||||||
int config = !strcmp(av[na-1], "config");
|
int config = !strcmp(av[na-1], "config");
|
||||||
if ( !strcmp(av[1], "nosleep")) do_sleep = 0;
|
if (!strcmp(av[1], "sleep")) do_sleep = 1;
|
||||||
else if (!strcmp(av[1], "sleep")) do_sleep = 1;
|
|
||||||
else if (!strcmp(av[1], "drift")) do_sleep = 2;
|
else if (!strcmp(av[1], "drift")) do_sleep = 2;
|
||||||
else if (!strcmp(av[1], "fudge")) do_sleep = 3;
|
else if (!strcmp(av[1], "fudge")) do_sleep = 3;
|
||||||
else if (!config || na>2) do_sleep = -1;
|
else if (!config) do_sleep = -1;
|
||||||
if (na>3 || na>2 && !config)
|
if (na>3 || na>2 && !do_sleep)
|
||||||
do_sleep = -1;
|
do_sleep = -1;
|
||||||
if (help || do_sleep < 0) {
|
if (help || do_sleep < 0) {
|
||||||
fprintf(mout,
|
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"
|
"- set the µC RTC to the current host time.\n"
|
||||||
"option `sleep`: Wait until the end of the current second.\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"
|
"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