Backing up an unused program in case of future need

Dependencies:   mbed

Committer:
andrewboyson
Date:
Wed Apr 13 09:21:02 2016 +0000
Revision:
0:09f915e6f9f6
Child:
2:06fa34661f19
Fixed memory allocation issues and added enumeration to log.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 0:09f915e6f9f6 1 #include "mbed.h"
andrewboyson 0:09f915e6f9f6 2 #define ONE_MILLION 1000000
andrewboyson 0:09f915e6f9f6 3
andrewboyson 0:09f915e6f9f6 4 Ticker ticker;
andrewboyson 0:09f915e6f9f6 5 uint64_t unixTime16ths;
andrewboyson 0:09f915e6f9f6 6 static void tick(void)
andrewboyson 0:09f915e6f9f6 7 {
andrewboyson 0:09f915e6f9f6 8 unixTime16ths++;
andrewboyson 0:09f915e6f9f6 9 }
andrewboyson 0:09f915e6f9f6 10 void TimeInit()
andrewboyson 0:09f915e6f9f6 11 {
andrewboyson 0:09f915e6f9f6 12 ticker.attach_us(&tick, ONE_MILLION >> 4);
andrewboyson 0:09f915e6f9f6 13 }
andrewboyson 0:09f915e6f9f6 14 void TimeSet(uint32_t t)
andrewboyson 0:09f915e6f9f6 15 {
andrewboyson 0:09f915e6f9f6 16 unixTime16ths = (uint64_t)t << 4;
andrewboyson 0:09f915e6f9f6 17 }
andrewboyson 0:09f915e6f9f6 18 uint32_t TimeGet()
andrewboyson 0:09f915e6f9f6 19 {
andrewboyson 0:09f915e6f9f6 20 return unixTime16ths >> 4;
andrewboyson 0:09f915e6f9f6 21 }
andrewboyson 0:09f915e6f9f6 22 void TimeSet16ths(uint64_t t)
andrewboyson 0:09f915e6f9f6 23 {
andrewboyson 0:09f915e6f9f6 24 unixTime16ths = t;
andrewboyson 0:09f915e6f9f6 25 }
andrewboyson 0:09f915e6f9f6 26 uint64_t TimeGet16ths()
andrewboyson 0:09f915e6f9f6 27 {
andrewboyson 0:09f915e6f9f6 28 return unixTime16ths;
andrewboyson 0:09f915e6f9f6 29 }