Introduces watch/, a real Pebble watchapp (built via pebble build) that
build / build (push) Successful in 30s
build / build (push) Successful in 30s
shows the daily tarot/astrology reading on-device: persistence, reading computation, and UI screens, driven by the existing engine/interpreter code linked in unchanged where possible. Required engine-side changes to make that linking work: - A compact low-precision ephemeris (lowprec_ephemeris.c) replacing the vendored ~127KB Astronomy Engine, which doesn't fit the watch's ~64KB app budget. - Hand-rolled sqrt/atan2/sin/cos replacements for that ephemeris and astro.c's Ascendant calculation - Pebble's statically-linked libm hard-faults on real hardware under this app's -fPIE link for all four. - narrative.c/guidance.c refactored from FILE*/fprintf onto snprintf- based buffers, since Pebble's SDK blocks fprintf at compile time.
This commit is contained in:
+12
-1
@@ -1,8 +1,15 @@
|
||||
#ifndef DECK_READING_H
|
||||
#define DECK_READING_H
|
||||
|
||||
/* See astro.h's own comment on this same #ifdef - Pebble's SDK
|
||||
* pre-defines <time.h>'s include guard and declares time_t/struct tm
|
||||
* itself inside pebble.h. */
|
||||
#ifdef PBL_SDK_3
|
||||
#include <pebble.h>
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "astro.h"
|
||||
#include "tarot.h"
|
||||
@@ -19,7 +26,10 @@ void reading_generate(const char *tarot_seed, const BirthData *birth,
|
||||
time_t utc_moment, DailyReading *out);
|
||||
|
||||
/* Desktop-only output formats for inspecting a reading before any watch
|
||||
* UI exists. Not used by (and not needed by) the watchapp. */
|
||||
* UI exists - use fprintf, which Pebble's SDK blocks at compile time, so
|
||||
* these aren't even declared (and reading.c doesn't define them) when
|
||||
* building for the watch. Not used by (and not needed by) the watchapp. */
|
||||
#ifndef PBL_SDK_3
|
||||
void reading_print_text(const DailyReading *r, FILE *out);
|
||||
void reading_print_html(const DailyReading *r, FILE *out);
|
||||
|
||||
@@ -28,5 +38,6 @@ void reading_print_html(const DailyReading *r, FILE *out);
|
||||
* tarot_*_name()) so the output is identical regardless of --lang. This
|
||||
* is the interchange format interpreter/ reads - see its json.c. */
|
||||
void reading_print_json(const DailyReading *r, FILE *out);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user