diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-03 15:34:29 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-07-03 15:35:28 +0200 |
commit | 0f390b743634ef4cdda03da8cb3f175524d59bd0 (patch) | |
tree | 829dd7907fdf11190cb8b153d76bab0a3e8d1c1a /ppmsum.cpp | |
parent | 1a8771c5d0e23fb91cb926614933405f39049d63 (diff) |
Removed old stuff.
Diffstat (limited to 'ppmsum.cpp')
-rw-r--r-- | ppmsum.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/ppmsum.cpp b/ppmsum.cpp deleted file mode 100644 index ce601e5..0000000 --- a/ppmsum.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "ppmsum.h" - -#include <ch.h> -#include <hal.h> - -namespace { - icucnt_t last_width, last_period; - - PPMSum* ppmsum; - int ppm_n = 0; - - static void icuwidthcb(ICUDriver *icup) { - last_width = icuGetWidthI(icup); - ppmsum->data[ppm_n] = last_width - 1050; - } - - static void icuperiodcb(ICUDriver *icup) { - last_period = icuGetPeriodI(icup); - if(last_period > 5000) { - ppm_n = 0; - } else { - ppm_n = (ppm_n + 1) % 4; - } - } - - static ICUConfig icucfg = { - ICU_INPUT_ACTIVE_HIGH, - 1000000, - icuwidthcb, - icuperiodcb - }; -}; - -void PPMSum::start() { - ppmsum = this; - - icuStart(&ICUD4, &icucfg); - icuEnable(&ICUD4); -} |