projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/easytimer-v2: Add logging bits
[fw/altos]
/
src
/
attiny
/
ao_clock.c
diff --git
a/src/attiny/ao_clock.c
b/src/attiny/ao_clock.c
index 2ac0500b217f307466fd8be143eae566969eac89..e5681edbc66858356370df185c08da9c1864a6ce 100644
(file)
--- a/
src/attiny/ao_clock.c
+++ b/
src/attiny/ao_clock.c
@@
-24,14
+24,14
@@
static volatile AO_TICK_TYPE ao_wakeup_count;
ISR(TIMER1_COMPA_vect)
{
++ao_tick_count;
ISR(TIMER1_COMPA_vect)
{
++ao_tick_count;
- if ((
int16_t
) (ao_tick_count - ao_wakeup_count) >= 0)
+ if ((
AO_TICK_SIGNED
) (ao_tick_count - ao_wakeup_count) >= 0)
ao_wakeup((void *) &ao_tick_count);
}
AO_TICK_TYPE
ao_time(void)
{
ao_wakeup((void *) &ao_tick_count);
}
AO_TICK_TYPE
ao_time(void)
{
-
uint16_t
r;
+
AO_TICK_TYPE
r;
cli();
r = ao_tick_count;
cli();
r = ao_tick_count;
@@
-127,17
+127,17
@@
void ao_delay_us(uint16_t us)
}
void
}
void
-ao_delay_until(
uint16_t
target)
+ao_delay_until(
AO_TICK_TYPE
target)
{
cli();
ao_wakeup_count = target;
{
cli();
ao_wakeup_count = target;
- while ((
int16_t
) (target - ao_tick_count) > 0)
+ while ((
AO_TICK_SIGNED
) (target - ao_tick_count) > 0)
ao_sleep((void *) &ao_tick_count);
sei();
}
void
ao_sleep((void *) &ao_tick_count);
sei();
}
void
-ao_delay(
uint16_t
ticks)
+ao_delay(
AO_TICK_TYPE
ticks)
{
ao_delay_until(ao_time() + ticks);
}
{
ao_delay_until(ao_time() + ticks);
}