summaryrefslogtreecommitdiffstats
path: root/app/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/httpd.c')
-rw-r--r--app/httpd.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/app/httpd.c b/app/httpd.c
index 71c62a4..1c8fb17 100644
--- a/app/httpd.c
+++ b/app/httpd.c
@@ -52,11 +52,11 @@ static uint32_t make_alarm (void)
}
PTB_ADD (" UTC: %s\n", buf);
- PTB_ADD (" RA: %.9f\n", ra);
+ PTB_ADD (" RA: %sf\n", fd1 (ra, 0, 1, 9));
PTB_ADD ("</pre>\n");
PTB_ADD ("<table>\n");
- PTB_ADD ("<tr><td><form method='get' action='/alarm_set.cgi'><td>LRA:</td><td><input type='text' name='lra' value='%.9f' size='32' maxlength='32' /></td><td><input type='submit' value='set' /></td></form></tr>\n", lra);
+ PTB_ADD ("<tr><td><form method='get' action='/alarm_set.cgi'><td>LRA:</td><td><input type='text' name='lra' value='%s' size='32' maxlength='32' /></td><td><input type='submit' value='set' /></td></form></tr>\n", fd1 (lra, 0, 1, 9));
PTB_ADD ("<tr><td><form method='get' action='/alarm_set.cgi'><td>LST:</td><td><input type='text' name='lst' value='%02d:%02d:%02d.%06d' size='32' maxlength='32' /></td><td><input type='submit' value='set' /></td></form></tr>\n", l.hour, l.minute, l.second, l.nanosecond / 1000);
PTB_ADD ("</table>\n");
@@ -94,8 +94,8 @@ static uint32_t make_index (void)
PTB_ADD ("<pre>\n");
PTB_ADD (" UTC: %s\n", buf);
- PTB_ADD (" RA: %.9f\n", ra);
- PTB_ADD (" LRA: %.9f\n", lra);
+ PTB_ADD (" RA: %s\n", fd1 (ra, 0, 1, 9));
+ PTB_ADD (" LRA: %s\n", fd1 (lra, 0, 1, 9));
PTB_ADD (" LST: %02d:%02d:%02d.%06d\n", l.hour, l.minute, l.second, l.nanosecond / 1000);
PTB_ADD ("</pre>\n");
PTB_ADD ("\n");
@@ -125,8 +125,8 @@ static uint32_t make_index (void)
}
PTB_ADD (" UTC: %s\n", buf);
- PTB_ADD (" RA: %.9f\n", ra);
- PTB_ADD (" LRA: %.9f\n", lra);
+ PTB_ADD (" RA: %s\n", fd1 (ra, 0, 1, 9));
+ PTB_ADD (" LRA: %s\n", fd1 (lra, 0, 1, 9));
PTB_ADD (" LST: %02d:%02d:%02d.%06d\n", l.hour, l.minute, l.second, l.nanosecond / 1000);
PTB_ADD ("</pre>\n");
@@ -259,22 +259,18 @@ int fs_open_custom (struct fs_file *file, const char *name)
{
if (!strcmp (name, "/index.html")) {
- file->data = (const char *)html_buf;
- file->len = make_index();
- }
- else if (!strcmp (name, "/alarm.html")) {
- file->data = (const char *)html_buf;
+ file->data = (const char *)html_buf;
+ file->len = make_index();
+ } else if (!strcmp (name, "/alarm.html")) {
+ file->data = (const char *)html_buf;
file->len = make_alarm();
- }
- else if (!strcmp (name, "/meteotime.dat")) {
- file->data = (const char *)meteotime_data;
- file->len=sizeof(meteotime_data);
- }
- else if (!strcmp (name, "/ephemeris.dat")) {
- file->data = (const char *)ephemeris;
- file->len=sizeof(ephemeris);
- }
- else {
+ } else if (!strcmp (name, "/meteotime.dat")) {
+ file->data = (const char *)meteotime_data;
+ file->len = sizeof (meteotime_data);
+ } else if (!strcmp (name, "/ephemeris.dat")) {
+ file->data = (const char *)ephemeris;
+ file->len = sizeof (ephemeris);
+ } else {
printf ("looking for url=%s, found nothing\n", name);
return 0;
}