summaryrefslogtreecommitdiffstats
path: root/app/abs.c
diff options
context:
space:
mode:
authorroot <root@ka-ata-killa.ourano.james.local>2021-03-02 12:54:03 +0000
committerroot <root@ka-ata-killa.ourano.james.local>2021-03-02 12:54:03 +0000
commit8c7ee88332652e7e79f6c1e4baacabe2183f7e8e (patch)
treea26ca60a089015822fa81ef44567927c1d8e334d /app/abs.c
parent3d48137c00511b3f2d35511482d1a76f8d06382d (diff)
downloadclock-8c7ee88332652e7e79f6c1e4baacabe2183f7e8e.tar.gz
clock-8c7ee88332652e7e79f6c1e4baacabe2183f7e8e.tar.bz2
clock-8c7ee88332652e7e79f6c1e4baacabe2183f7e8e.zip
working, with hybrid FLL/PLL, new refclk input and support for max7219 displays, neo 5 and neo 7 and a bazillion other fixes
Diffstat (limited to 'app/abs.c')
-rw-r--r--app/abs.c121
1 files changed, 0 insertions, 121 deletions
diff --git a/app/abs.c b/app/abs.c
index 7a6b5d5..636b721 100644
--- a/app/abs.c
+++ b/app/abs.c
@@ -1,124 +1,3 @@
#include "project.h"
-static uint32_t high_tick;
-
-#if HW_CLOCK_LEN == 32
-
-#define QUARTER (1UL << 29)
-#define HALF (1UL << 30)
-#define THREE_QUARTERS (HALF+QUARTER)
-#define ONE (~(uint32_t)0)
-
-
-uint64_t abs_extend (uint32_t now)
-{
- static int m;
- uint64_t ret;
-
-
- if (!m) {
- ret = high_tick;
- ret <<= 32;
- ret |= now;
-
-
- if ((now > THREE_QUARTERS) && (now <= ONE)) {
- high_tick++;
- m = 1;
- }
-
- } else {
- if (now < HALF) {
- ret = high_tick;
- ret <<= 32;
- ret |= now;
- } else {
- ret = high_tick - 1;
- ret <<= 32;
- ret |= now;
- }
-
- if ((now > QUARTER) && (now < HALF))
- m = 0;
- }
-
- return ret;
-}
-#elif HW_CLOCK_LEN == 31
-
-#define QUARTER (1UL << 28)
-#define HALF (1UL << 29)
-#define THREE_QUARTERS (HALF+QUARTER)
-#define ONE (0x7fffffff)
-
-
-uint64_t abs_extend (uint32_t now)
-{
- static int m;
- uint64_t ret;
-
-
- if (!m) {
- ret = high_tick;
- ret <<= 31;
- ret |= now;
-
- if ((now > THREE_QUARTERS) && (now <= ONE)) {
- high_tick++;
- m = 1;
- }
-
- } else {
- if (now < HALF) {
- ret = high_tick;
- ret <<= 31;
- ret |= now;
- } else {
- ret = high_tick - 1;
- ret <<= 31;
- ret |= now;
- }
-
- if ((now > QUARTER) && (now < HALF))
- m = 0;
- }
-
- return ret;
-}
-
-
-
-
-
-#else
-#error unknown hardware clock length
-#endif
-
-
-
-
-
-
-
-
-void abs_meh (void)
-{
- printf ("HT %d\n", (int) high_tick);
-}
-
-
-
-
-
-uint64_t abs_get (void)
-{
- uint32_t now = HW_CLOCK_REG;
- return abs_extend (now);
-}
-
-
-void abs_slow_tick()
-{
- abs_get();
-}