Date:2012-06-21 21:14:56 (7 years 7 months ago)
Author:Werner Almesberger
Commit:c7494c80fac7ae9be63a3943e92adbab50694ebd
Message:fw/accel.c: fix update() add interrupt-friendly update_irq()

Still untested.
Files: fw/sweep.c (2 diffs)
fw/sweep.h (1 diff)

Change Details

fw/sweep.c
8484}
8585
8686
87uint32_t uptime_irq(void)
88{
89    uint32_t t;
90
91    t = t_up+TCNT1;
92    if (TIFR1 & TOV1)
93        t += ICR1;
94    return t;
95}
96
97
8798uint32_t uptime(void)
8899{
89100    uint32_t a, b;
...... 
92103    do {
93104        cli();
94105        a = t_up;
95        d = ICR1;
106        d = TCNT1;
107        cli();
96108        b = t_up;
97109        sei();
98110    }
fw/sweep.h
2929
3030extern volatile bool sweeping;
3131
32uint32_t uptime_irq(void);
3233uint32_t uptime(void);
34
3335void sweep_image(const struct sweep *sweep);
3436void sweep_init(void);
3537

Archive Download the corresponding diff file

Branches:
master
tornado-v1



interactive