CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
copy_file_blob_main.c File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
#include "lfs.h"
Include dependency graph for copy_file_blob_main.c:

Macros

#define LFS_MAX_PATH_LENGTH   200
#define FW_SNPRINTF   ((snprintf_fn_t) (0x0802ff2cUL | 0x1))
#define FW_LOG_MESSAGE   ((LOG_message_fn_t) (0x08015360UL | 0x1))
#define LOG(severity, fmt, ...)

Typedefs

typedef int(* snprintf_fn_t) (char *buf, unsigned int size, const char *fmt,...)
typedef void(* LOG_message_fn_t) (uint32_t source, LOG_severity_enum_t severity, uint32_t sink_mask, const char *fmt,...)

Enumerations

enum  LOG_severity_enum_t {
  LOG_SEVERITY_DEBUG = 1 << 0 , LOG_SEVERITY_NORMAL = 1 << 1 , LOG_SEVERITY_WARNING = 1 << 2 , LOG_SEVERITY_ERROR = 1 << 3 ,
  LOG_SEVERITY_CRITICAL = 1 << 4
}

Functions

void * memset (void *s, int c, __SIZE_TYPE__ n)
static uint32_t TIME_uptime_ms ()
static uint16_t parse_token (const char *src, uint16_t src_offset, uint16_t src_len, char *dst, uint16_t dst_size)
static uint16_t str_len (const char *s)
static int8_t hex_to_int (char c)
static int32_t parse_int (const char *s, bool *ok)
 Parse a string into an integer.
static int8_t copy_lfs_file_chunk (const char *src_file_path, const char *dest_file_path, uint32_t start_offset, uint32_t byte_count)
 __attribute__ ((used, section(".text.entry")))

Variables

static const uint32_t LOG_SYSTEM_TELECOMMAND = 1 << 12
static const uint32_t LOG_SINK_ALL = (1 << 4) - 1
static lfs_t *const LFS_filesystem_ptr = (lfs_t *)(0x20028064UL)
static volatile uint32_t *const TIME_uptime_ms_from_tim6_ptr = (volatile uint32_t *)(0x200706d0UL)
static int(*const fw_lfs_file_open )(lfs_t *lfs, lfs_file_t *file, const char *path, int flags) = (void*)(0x08012f30UL | 0x1)
static lfs_soff_t(*const fw_lfs_file_size )(lfs_t *lfs, lfs_file_t *file) = (void*)(0x08012f70UL | 0x1)
static lfs_soff_t(*const fw_lfs_file_seek )(lfs_t *lfs, lfs_file_t *file, lfs_soff_t off, int whence) = (void*)(0x08012f68UL | 0x1)
static lfs_ssize_t(*const fw_lfs_file_read )(lfs_t *lfs, lfs_file_t *file, void *buffer, lfs_size_t size) = (void*)(0x08012f58UL | 0x1)
static lfs_ssize_t(*const fw_lfs_file_write )(lfs_t *lfs, lfs_file_t *file, const void *buffer, lfs_size_t size) = (void*)(0x08012f60UL | 0x1)
static int(*const fw_lfs_file_close )(lfs_t *lfs, lfs_file_t *file) = (void*)(0x08012f48UL | 0x1)

Macro Definition Documentation

◆ FW_LOG_MESSAGE

#define FW_LOG_MESSAGE   ((LOG_message_fn_t) (0x08015360UL | 0x1))

◆ FW_SNPRINTF

#define FW_SNPRINTF   ((snprintf_fn_t) (0x0802ff2cUL | 0x1))

◆ LFS_MAX_PATH_LENGTH

#define LFS_MAX_PATH_LENGTH   200

◆ LOG

#define LOG ( severity,
fmt,
... )
Value:
FW_LOG_MESSAGE(LOG_SYSTEM_TELECOMMAND, severity, LOG_SINK_ALL, fmt, ##__VA_ARGS__)
#define FW_LOG_MESSAGE
Definition copy_file_blob_main.c:49
@ LOG_SYSTEM_TELECOMMAND
Definition log.h:45
@ LOG_SINK_ALL
Definition log.h:24

Typedef Documentation

◆ LOG_message_fn_t

typedef void(* LOG_message_fn_t) (uint32_t source, LOG_severity_enum_t severity, uint32_t sink_mask, const char *fmt,...)

◆ snprintf_fn_t

typedef int(* snprintf_fn_t) (char *buf, unsigned int size, const char *fmt,...)

Enumeration Type Documentation

◆ LOG_severity_enum_t

Enumerator
LOG_SEVERITY_DEBUG 
LOG_SEVERITY_NORMAL 
LOG_SEVERITY_WARNING 
LOG_SEVERITY_ERROR 
LOG_SEVERITY_CRITICAL 

Function Documentation

◆ __attribute__()

__attribute__ ( (used, section(".text.entry")) )
Here is the call graph for this function:

◆ copy_lfs_file_chunk()

int8_t copy_lfs_file_chunk ( const char * src_file_path,
const char * dest_file_path,
uint32_t start_offset,
uint32_t byte_count )
static
Here is the caller graph for this function:

◆ hex_to_int()

int8_t hex_to_int ( char c)
static
Here is the caller graph for this function:

◆ memset()

void * memset ( void * s,
int c,
__SIZE_TYPE__ n )
Here is the caller graph for this function:

◆ parse_int()

int32_t parse_int ( const char * s,
bool * ok )
static

Parse a string into an integer.

Parameters
sString to parse. Valid formats: "0x<digits>" or "<digits>". Underscores are ignored.
Returns
Parsed integer, or 0 if invalid.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_token()

uint16_t parse_token ( const char * src,
uint16_t src_offset,
uint16_t src_len,
char * dst,
uint16_t dst_size )
static
Here is the caller graph for this function:

◆ str_len()

uint16_t str_len ( const char * s)
static
Here is the caller graph for this function:

◆ TIME_uptime_ms()

uint32_t TIME_uptime_ms ( void )
inlinestatic
Here is the caller graph for this function:

Variable Documentation

◆ fw_lfs_file_close

int(*const fw_lfs_file_close) (lfs_t *lfs, lfs_file_t *file) ( lfs_t * lfs,
lfs_file_t * file ) = (void*)(0x08012f48UL | 0x1)
static

◆ fw_lfs_file_open

int(*const fw_lfs_file_open) (lfs_t *lfs, lfs_file_t *file, const char *path, int flags) ( lfs_t * lfs,
lfs_file_t * file,
const char * path,
int flags ) = (void*)(0x08012f30UL | 0x1)
static

◆ fw_lfs_file_read

lfs_ssize_t(*const fw_lfs_file_read) (lfs_t *lfs, lfs_file_t *file, void *buffer, lfs_size_t size) ( lfs_t * lfs,
lfs_file_t * file,
void * buffer,
lfs_size_t size ) = (void*)(0x08012f58UL | 0x1)
static

◆ fw_lfs_file_seek

lfs_soff_t(*const fw_lfs_file_seek) (lfs_t *lfs, lfs_file_t *file, lfs_soff_t off, int whence) ( lfs_t * lfs,
lfs_file_t * file,
lfs_soff_t off,
int whence ) = (void*)(0x08012f68UL | 0x1)
static

◆ fw_lfs_file_size

lfs_soff_t(*const fw_lfs_file_size) (lfs_t *lfs, lfs_file_t *file) ( lfs_t * lfs,
lfs_file_t * file ) = (void*)(0x08012f70UL | 0x1)
static

◆ fw_lfs_file_write

lfs_ssize_t(*const fw_lfs_file_write) (lfs_t *lfs, lfs_file_t *file, const void *buffer, lfs_size_t size) ( lfs_t * lfs,
lfs_file_t * file,
const void * buffer,
lfs_size_t size ) = (void*)(0x08012f60UL | 0x1)
static

◆ LFS_filesystem_ptr

lfs_t* const LFS_filesystem_ptr = (lfs_t *)(0x20028064UL)
static

◆ LOG_SINK_ALL

const uint32_t LOG_SINK_ALL = (1 << 4) - 1
static

◆ LOG_SYSTEM_TELECOMMAND

const uint32_t LOG_SYSTEM_TELECOMMAND = 1 << 12
static

◆ TIME_uptime_ms_from_tim6_ptr

volatile uint32_t* const TIME_uptime_ms_from_tim6_ptr = (volatile uint32_t *)(0x200706d0UL)
static