projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Add SPI bus parameter to ao_spi_speed
[fw/altos]
/
src
/
kernel
/
ao_log_tiny.c
diff --git
a/src/kernel/ao_log_tiny.c
b/src/kernel/ao_log_tiny.c
index 7769b7b5749773c3ffa51a42c90e138d83297172..ccdb3aac38fe8ca63ee70e463de617863a0340a8 100644
(file)
--- a/
src/kernel/ao_log_tiny.c
+++ b/
src/kernel/ao_log_tiny.c
@@
-18,7
+18,7
@@
#include "ao.h"
#include "ao.h"
-static
__data uint16_t
ao_log_tiny_interval;
+static
AO_TICK_TYPE
ao_log_tiny_interval;
#define AO_LOG_TINY_INTERVAL_DEFAULT AO_MS_TO_TICKS(1000)
#if USE_FAST_ASCENT_LOG
#define AO_LOG_TINY_INTERVAL_DEFAULT AO_MS_TO_TICKS(1000)
#if USE_FAST_ASCENT_LOG
@@
-29,10
+29,8
@@
static __data uint16_t ao_log_tiny_interval;
#define AO_PAD_RING 2
#endif
#define AO_PAD_RING 2
#endif
-__code uint8_t ao_log_format = AO_LOG_FORMAT_TINY;
-
void
void
-ao_log_tiny_set_interval(
uint16_t
ticks)
+ao_log_tiny_set_interval(
AO_TICK_TYPE
ticks)
{
ao_log_tiny_interval = ticks;
}
{
ao_log_tiny_interval = ticks;
}
@@
-43,13
+41,13
@@
static void ao_log_tiny_data(uint16_t d)
if (ao_log_current_pos >= ao_log_end_pos && ao_log_running)
ao_log_stop();
if (ao_log_running) {
if (ao_log_current_pos >= ao_log_end_pos && ao_log_running)
ao_log_stop();
if (ao_log_running) {
- ao_storage_write(ao_log_current_pos,
DATA_TO_XDATA(&d)
, 2);
+ ao_storage_write(ao_log_current_pos,
&d
, 2);
ao_log_current_pos += 2;
}
}
ao_log_current_pos += 2;
}
}
-static
__xdata
uint16_t ao_log_pad_ring[AO_PAD_RING];
-static
__pdata
uint8_t ao_log_pad_ring_pos;
+static uint16_t ao_log_pad_ring[AO_PAD_RING];
+static uint8_t ao_log_pad_ring_pos;
#define ao_pad_ring_next(n) (((n) + 1) & (AO_PAD_RING - 1))
#define ao_pad_ring_next(n) (((n) + 1) & (AO_PAD_RING - 1))
@@
-104,7
+102,7
@@
ao_log(void)
/*
* Add in pending sample data
*/
/*
* Add in pending sample data
*/
- ao_sleep(
DATA_TO_XDATA(&ao_sample_data)
);
+ ao_sleep(
&ao_sample_data
);
while (ao_log_data != ao_sample_data) {
sum += ao_data_pres(&ao_data_ring[ao_log_data]);
count++;
while (ao_log_data != ao_sample_data) {
sum += ao_data_pres(&ao_data_ring[ao_log_data]);
count++;
@@
-136,7
+134,7
@@
ao_log(void)
* Write out the sample when finished
*/
now = ao_time();
* Write out the sample when finished
*/
now = ao_time();
- if ((
int16_t
) (now - (last_time + ao_log_tiny_interval)) >= 0 && count) {
+ if ((
AO_TICK_SIGNED
) (now - (last_time + ao_log_tiny_interval)) >= 0 && count) {
count = sum / count;
if (ao_log_started)
ao_log_tiny_data(count);
count = sum / count;
if (ao_log_started)
ao_log_tiny_data(count);
@@
-149,10
+147,10
@@
ao_log(void)
}
}
}
}
-
u
int16_t
+int16_t
ao_log_flight(uint8_t slot)
{
ao_log_flight(uint8_t slot)
{
- static
__xdata
uint16_t flight;
+ static uint16_t flight;
(void) slot;
ao_storage_read(0, &flight, 2);
(void) slot;
ao_storage_read(0, &flight, 2);