STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
emmc_log.c File Reference
#include "emmc_log.h"
#include <stddef.h>
#include <string.h>
Include dependency graph for emmc_log.c:

Go to the source code of this file.

Functions

static void put16 (uint8_t *p, uint16_t v)
static void put32 (uint8_t *p, uint32_t v)
static uint16_t get16 (const uint8_t *p)
static uint32_t get32 (const uint8_t *p)
uint32_t emmc_log_crc32 (const void *data, uint32_t len)
static void lock (emmc_log_t *log)
static void unlock (emmc_log_t *log)
static uint8_t * block_at (emmc_log_t *log, uint8_t chunk, uint8_t block)
static void chunk_complete (emmc_log_t *log)
static void close_block (emmc_log_t *log)
static void seal (emmc_log_t *log)
static bool acquire (emmc_log_t *log)
static bool put_record (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len)
static bool keep (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len)
emmc_log_config_t emmc_log_default_config (void)
emmc_status_t emmc_log_init (emmc_log_t *log, const emmc_port_t *port, void *context, const emmc_log_config_t *config, emmc_log_chunk_t *chunks, uint8_t chunk_count, uint8_t *scratch)
bool emmc_log_on_state (emmc_log_t *log, flight_state_t from, flight_state_t to, uint32_t now_ms)
bool emmc_log_append (emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len)
void emmc_log_flush (emmc_log_t *log)
uint8_t emmc_log_backlog (const emmc_log_t *log)
static void stop (emmc_log_t *log, emmc_disk_state_t why)
static void release_write_chunk (emmc_log_t *log, bool written)
static emmc_status_t probe (emmc_log_t *log, uint32_t k, bool *valid, uint32_t *session)
static emmc_status_t search (emmc_log_t *log, uint32_t lo, uint32_t hi, uint32_t *end)
static emmc_status_t format (emmc_log_t *log)
static emmc_status_t mount (emmc_log_t *log)
emmc_status_t emmc_log_service (emmc_log_t *log, uint32_t now_ms)

Function Documentation

◆ acquire()

◆ block_at()

uint8_t * block_at ( emmc_log_t * log,
uint8_t chunk,
uint8_t block )
static

◆ chunk_complete()

void chunk_complete ( emmc_log_t * log)
static

◆ close_block()

void close_block ( emmc_log_t * log)
static

◆ emmc_log_append()

bool emmc_log_append ( emmc_log_t * log,
uint8_t type,
uint32_t t_ms,
const void * data,
uint8_t len )

◆ emmc_log_backlog()

uint8_t emmc_log_backlog ( const emmc_log_t * log)

◆ emmc_log_crc32()

uint32_t emmc_log_crc32 ( const void * data,
uint32_t len )

Definition at line 31 of file emmc_log.c.

References p.

Referenced by emmc_log_service(), format(), mount(), probe(), and test_crc().

◆ emmc_log_default_config()

◆ emmc_log_flush()

◆ emmc_log_init()

◆ emmc_log_on_state()

◆ emmc_log_service()

◆ format()

emmc_status_t format ( emmc_log_t * log)
static

◆ get16()

uint16_t get16 ( const uint8_t * p)
static

Definition at line 20 of file emmc_log.c.

References p.

Referenced by probe().

◆ get32()

uint32_t get32 ( const uint8_t * p)
static

Definition at line 24 of file emmc_log.c.

References p.

Referenced by format(), mount(), and probe().

◆ keep()

◆ lock()

void lock ( emmc_log_t * log)
static

Definition at line 49 of file emmc_log.c.

References emmc_log_t::context, emmc_port_t::lock, and emmc_log_t::port.

◆ mount()

◆ probe()

◆ put16()

void put16 ( uint8_t * p,
uint16_t v )
static

Definition at line 8 of file emmc_log.c.

References p.

Referenced by close_block().

◆ put32()

void put32 ( uint8_t * p,
uint32_t v )
static

Definition at line 13 of file emmc_log.c.

References p.

Referenced by emmc_log_service(), format(), keep(), and put_record().

◆ put_record()

bool put_record ( emmc_log_t * log,
uint8_t type,
uint32_t t_ms,
const void * data,
uint8_t len )
static

◆ release_write_chunk()

◆ seal()

◆ search()

emmc_status_t search ( emmc_log_t * log,
uint32_t lo,
uint32_t hi,
uint32_t * end )
static

Definition at line 305 of file emmc_log.c.

References EMMC_OK, end(), NULL, and probe().

Referenced by mount().

◆ stop()

◆ unlock()