10#define EV_MODE (1U << 4)
17static void to_emmc(
void* ctx, uint8_t type,
const void* data, uint8_t len) {
55 uint32_t ticks = (wait_us + 999U) / 1000U;
dev_bus_t board_devbus(board_spi_device_t device)
bool board_exti_route(uint16_t pin, osThreadId_t thread, uint32_t flags)
uint32_t board_exti_last_us(uint16_t pin)
uint32_t board_time_us(void)
#define osFlagsError
Error indicator.
#define osFlagsWaitAny
Wait for any flag (default).
#define osMutexPrioInherit
Priority inherit protocol.
osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr)
Create a thread and add it to Active Threads.
uint32_t osThreadFlagsSet(osThreadId_t thread_id, uint32_t flags)
Set the specified Thread Flags of a thread.
uint32_t osKernelGetTickCount(void)
Get the RTOS kernel tick count.
osThreadId_t osThreadGetId(void)
Return the thread ID of the current running thread.
#define osWaitForever
Wait forever timeout value.
osMutexId_t osMutexNew(const osMutexAttr_t *attr)
Create and Initialize a Mutex object.
osStatus_t osMutexAcquire(osMutexId_t mutex_id, uint32_t timeout)
Acquire a Mutex or timeout if it is locked.
uint32_t osThreadFlagsWait(uint32_t flags, uint32_t options, uint32_t timeout)
Wait for one or more Thread Flags of the current running thread to become signaled.
@ osPriorityRealtime
Priority: realtime.
osStatus_t osMutexRelease(osMutexId_t mutex_id)
Release a Mutex that was acquired by osMutexAcquire.
bool emmc_log_append(emmc_log_t *log, uint8_t type, uint32_t t_ms, const void *data, uint8_t len)
emmc_log_t * emmc_stm32_log(void)
static void to_emmc(void *ctx, uint8_t type, const void *data, uint8_t len)
static volatile bool want_active
static osThreadId_t thread
uint32_t sensors_core_wait_us(const sensors_core_t *c, uint32_t now_us)
void sensors_core_init(sensors_core_t *c, uint32_t now_us)
void sensors_core_stop(sensors_core_t *c)
void sensors_core_step(sensors_core_t *c, uint32_t events, uint32_t imu_edge_us, uint32_t highg_edge_us, uint32_t now_us)
void sensors_task_snapshot(sensors_core_t *out)
static void to_emmc(void *ctx, uint8_t type, const void *data, uint8_t len)
bool sensors_task_start(void)
static osMutexId_t snapshot_lock
static void sensors_task(void *argument)
void sensors_task_set_active(bool on)
Attributes structure for mutex.
Attributes structure for thread.