ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
ack_cache.c File Reference
#include "ack_cache.h"
#include <string.h>
Include dependency graph for ack_cache.c:

Go to the source code of this file.

Data Structures

struct  entry_t
 

Functions

void ackc_reset (void)
 
static entry_t * find (uint8_t op, uint8_t seq)
 
static entry_t * slot (void)
 
uint8_t ackc_begin (uint8_t op, uint8_t seq, uint8_t *result, uint8_t *reason)
 Looks up (op, seq).
 
void ackc_finish (uint8_t op, uint8_t seq, uint8_t result, uint8_t reason)
 Completes the entry (or creates it if it was evicted meanwhile).
 

Variables

static entry_t s_e [ACK_CACHE_LEN]
 
static uint32_t s_clock
 

Function Documentation

◆ ackc_reset()

void ackc_reset ( void  )

Definition at line 12 of file ack_cache.c.

References s_clock, and s_e.

Referenced by app_init(), and app_step().

Here is the caller graph for this function:

◆ find()

static entry_t * find ( uint8_t  op,
uint8_t  seq 
)
static

Definition at line 14 of file ack_cache.c.

References ACK_CACHE_LEN, s_e, seq, and used.

Referenced by ackc_begin(), and ackc_finish().

Here is the caller graph for this function:

◆ slot()

static entry_t * slot ( void  )
static

Definition at line 21 of file ack_cache.c.

References ACK_CACHE_LEN, s_e, and used.

Referenced by ackc_begin(), ackc_finish(), and imu_fifo_parse().

Here is the caller graph for this function:

◆ ackc_begin()

uint8_t ackc_begin ( uint8_t  op,
uint8_t  seq,
uint8_t *  result,
uint8_t *  reason 
)

Looks up (op, seq).

ACKC_DONE: result/reason filled, re-send them. ACKC_PENDING: ignore. ACKC_NEW: a pending entry was created, execute it.

Definition at line 31 of file ack_cache.c.

References ACKC_DONE, ACKC_NEW, ACKC_PENDING, entry_t::age, find(), entry_t::op, entry_t::reason, result(), entry_t::result, s_clock, seq, entry_t::seq, slot(), entry_t::state, and entry_t::used.

Referenced by commands(), and usb_commands().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ackc_finish()

void ackc_finish ( uint8_t  op,
uint8_t  seq,
uint8_t  result,
uint8_t  reason 
)

Completes the entry (or creates it if it was evicted meanwhile).

Definition at line 44 of file ack_cache.c.

References ACKC_DONE, entry_t::age, find(), entry_t::op, entry_t::reason, result(), entry_t::result, s_clock, seq, entry_t::seq, slot(), entry_t::state, and entry_t::used.

Referenced by ack_link().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_e

entry_t s_e[ACK_CACHE_LEN]
static

Definition at line 9 of file ack_cache.c.

Referenced by ackc_reset(), find(), and slot().

◆ s_clock

uint32_t s_clock
static

Definition at line 10 of file ack_cache.c.

Referenced by ackc_begin(), ackc_finish(), and ackc_reset().