summaryrefslogtreecommitdiff
path: root/sec.h
diff options
context:
space:
mode:
Diffstat (limited to 'sec.h')
-rw-r--r--sec.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/sec.h b/sec.h
index d4e98ce..0a05698 100644
--- a/sec.h
+++ b/sec.h
@@ -70,7 +70,7 @@
#define NONUPDATE_DWELL_TIME 600 /* 600 samples, or 75ms */
-typedef struct
+struct echo_can_state
{
int tx_power;
int rx_power;
@@ -98,11 +98,11 @@ typedef struct
int32_t latest_correction; /* Indication of the magnitude of the latest
adaption, or a code to indicate why adaption
was skipped, for test purposes */
-} echo_can_state_t;
+};
-static echo_can_state_t *echo_can_create(int len, int adaption_mode);
-static void echo_can_free(echo_can_state_t *ec);
-static int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx);
+static struct echo_can_state *echo_can_create(int len, int adaption_mode);
+static void echo_can_free(struct echo_can_state *ec);
+static int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx);
/* Original parameters :
#define MIN_TX_POWER_FOR_ADAPTION 256
@@ -117,12 +117,12 @@ static int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx);
#define MIN_RX_POWER_FOR_ADAPTION 64
*/
-static inline echo_can_state_t *echo_can_create(int len, int adaption_mode)
+static inline struct echo_can_state *echo_can_create(int len, int adaption_mode)
{
- echo_can_state_t *ec;
+ struct echo_can_state *ec;
void *ptr;
- ptr = ec = (echo_can_state_t *) MALLOC(sizeof(*ec) + len * sizeof(int32_t) +
+ ptr = ec = (struct echo_can_state *) MALLOC(sizeof(*ec) + len * sizeof(int32_t) +
len * 3 * sizeof(int16_t));
if (ec == NULL)
return NULL;
@@ -141,13 +141,13 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode)
}
/*- End of function --------------------------------------------------------*/
-static inline void echo_can_free(echo_can_state_t *ec)
+static inline void echo_can_free(struct echo_can_state *ec)
{
FREE(ec);
}
/*- End of function --------------------------------------------------------*/
-static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx)
+static inline int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx)
{
int32_t echo_value;
int clean_rx;
@@ -268,7 +268,7 @@ static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t
}
/*- End of function --------------------------------------------------------*/
-static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val)
+static inline int echo_can_traintap(struct echo_can_state *ec, int pos, short val)
{
/* Reset hang counter to avoid adjustments after
initial forced training */