50 } __attribute__((packed));
57 static uint16_t current_sequence_id = 0;
60 for (i = 0; i < array_size; i++) {
63 if (
array[i] == sequence[current_sequence_id]) {
64 current_sequence_id++;
65 if (current_sequence_id >= sequence_size) {
67 current_sequence_id = 0;
71 current_sequence_id = 0;
75 if (
array[i] == 0xFF) {
78 if (count_ff >= 1000) {
80 current_sequence_id = 0;
157 end_idx = seq_idx + 5;
161 for (i = 5; i < end_idx; i++) {
static int32_t seq_in_array(uint8_t *array, uint16_t array_size, uint8_t *sequence, uint16_t sequence_size)
void direct_memory_logger_periodic(void)
static struct LogStruct log_struct
static void direct_memory_spi_cb(struct spi_transaction *trans)
void direct_memory_logger_set(uint8_t val)
static uint8_t stop_log_sequence[6]
static uint32_t dm_counter
static uint8_t start_log_sequence[6]
void direct_memory_logger_init(void)
struct DirectMemoryLogger dml
Write logs directly to flash memory chips.
#define DML_BUF_SIZE
The read buffer size.
enum DMLStatus status
The status of the Direct Memory Logger.
uint8_t buffer[DML_BUF_SIZE]
The buffer for writing and reading.
@ DML_START
The DML is starting the logger.
@ DML_STOP
The DML is busy stopping.
@ DML_INIT
The DML is initializing.
@ DML_IDLE
The DML is idle.
@ DML_ERASE
The DML is busy erasing itself.
@ DML_READ
The DML is busy starting read.
@ DML_LOGGING
The DML is busy logging.
@ DML_READING
The DML is busy reading.
struct SST25VFxxxx sst
The memory chip.
SPI transaction structure.
struct Imu imu
global IMU state
Inertial Measurement Unit interface.
void uart_put_byte(struct uart_periph *periph, long fd, uint8_t data)
void sst25vfxxxx_write(struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length)
Write bytes.
void sst25vfxxxx_read(struct SST25VFxxxx *sst, uint8_t *transfer_buffer, uint8_t transfer_length)
Read bytes Need 5 more extra bytes because of SPI overhead.
void sst25vfxxxx_init(struct SST25VFxxxx *sst, struct spi_periph *spi_p, const uint8_t slave_idx, SPICallback spi_cb)
Initializing the sst25vfxxxx chip.
void sst25vfxxxx_chip_erase(struct SST25VFxxxx *sst)
Full chip erase.
void sst25vfxxxx_after_cb(struct SST25VFxxxx *sst)
Callback of the SPI after going one level higher for gathering the sst pointer.
@ SST25VFXXXX_IDLE
The chip is idle and can be used.
uint32_t flash_addr
The flash address to write at.
enum SST25VFxxxxStatus status
The status of the SST25VFxxxx flash chip.
struct Stabilization stabilization
General stabilization interface for rotorcrafts.
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.