projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Declare all public functions in header files
[fw/altos]
/
src
/
kernel
/
ao_log_fireone.c
diff --git
a/src/kernel/ao_log_fireone.c
b/src/kernel/ao_log_fireone.c
index 1a82673d4344e387e505148dcd58815409056ea0..e1bf1601bc83ede0f776dfb8eb6b7355557dd94d 100644
(file)
--- a/
src/kernel/ao_log_fireone.c
+++ b/
src/kernel/ao_log_fireone.c
@@
-21,12
+21,12
@@
#include <ao_data.h>
#include <ao_flight.h>
#include <ao_data.h>
#include <ao_flight.h>
-static
__xdata
struct ao_log_firetwo log;
+static struct ao_log_firetwo log;
-
__code
uint8_t ao_log_format = AO_LOG_FORMAT_TELEFIRETWO;
+
const
uint8_t ao_log_format = AO_LOG_FORMAT_TELEFIRETWO;
static uint8_t
static uint8_t
-ao_log_csum(
__xdata uint8_t *b) __reentrant
+ao_log_csum(
uint8_t *b)
{
uint8_t sum = 0x5a;
uint8_t i;
{
uint8_t sum = 0x5a;
uint8_t i;
@@
-37,12
+37,12
@@
ao_log_csum(__xdata uint8_t *b) __reentrant
}
uint8_t
}
uint8_t
-ao_log_firetwo(
__xdata struct ao_log_firetwo *log) __reentrant
+ao_log_firetwo(
struct ao_log_firetwo *log)
{
uint8_t wrote = 0;
/* set checksum */
log->csum = 0;
{
uint8_t wrote = 0;
/* set checksum */
log->csum = 0;
- log->csum = ao_log_csum((
__xdata
uint8_t *) log);
+ log->csum = ao_log_csum((uint8_t *) log);
ao_mutex_get(&ao_log_mutex); {
if (ao_log_current_pos >= ao_log_end_pos && ao_log_running)
ao_log_stop();
ao_mutex_get(&ao_log_mutex); {
if (ao_log_current_pos >= ao_log_end_pos && ao_log_running)
ao_log_stop();
@@
-57,16
+57,8
@@
ao_log_firetwo(__xdata struct ao_log_firetwo *log) __reentrant
return wrote;
}
return wrote;
}
-static uint8_t
-ao_log_dump_check_data(void)
-{
- if (ao_log_csum((uint8_t *) &log) != 0)
- return 0;
- return 1;
-}
-
#if HAS_ADC
#if HAS_ADC
-static
__data uint8_t
ao_log_data_pos;
+static
uint8_t
ao_log_data_pos;
/* a hack to make sure that ao_log_metrums fill the eeprom block in even units */
typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_firetwo))] ;
/* a hack to make sure that ao_log_metrums fill the eeprom block in even units */
typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_firetwo))] ;
@@
-131,15
+123,3
@@
ao_log(void)
} while (ao_log_running);
}
} while (ao_log_running);
}
-uint16_t
-ao_log_flight(uint8_t slot)
-{
- if (!ao_storage_read(ao_log_pos(slot),
- &log,
- sizeof (struct ao_log_firetwo)))
- return 0;
-
- if (ao_log_dump_check_data() && log.type == AO_LOG_FLIGHT)
- return log.u.flight.flight;
- return 0;
-}