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 LOG(severity, 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

int snprintf (char *buf, unsigned int size, const char *fmt,...)
int strlen (const char *s)
void LOG_message (uint32_t source, LOG_severity_enum_t severity, uint32_t sink_mask, const char *fmt,...)
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 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 const char ARG_DELIM = ';'
lfs_t LFS_filesystem
volatile uint32_t TIME_uptime_ms_from_tim6

Macro Definition Documentation

◆ LFS_MAX_PATH_LENGTH

#define LFS_MAX_PATH_LENGTH   200

◆ LOG

#define LOG ( severity,
fmt,
... )
Value:
LOG_message(LOG_SYSTEM_TELECOMMAND, severity, LOG_SINK_ALL, fmt, ##__VA_ARGS__)
void LOG_message(LOG_system_enum_t source, LOG_severity_enum_t severity, uint32_t sink_mask, const char fmt[],...) __attribute__((format(printf
@ LOG_SYSTEM_TELECOMMAND
Definition log.h:45
@ LOG_SINK_ALL
Definition log.h:24

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 call graph for this function:
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:

◆ LOG_message()

void LOG_message ( uint32_t source,
LOG_severity_enum_t severity,
uint32_t sink_mask,
const char * fmt,
... )
extern

◆ 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:

◆ snprintf()

int snprintf ( char * buf,
unsigned int size,
const char * fmt,
... )
extern
Here is the caller graph for this function:

◆ strlen()

int strlen ( const char * s)
extern
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

◆ ARG_DELIM

const char ARG_DELIM = ';'
static

◆ LFS_filesystem

lfs_t LFS_filesystem
extern

littlefs_helper.h

Created on: May 2, 2024 Author: Saksham Puri

◆ 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

volatile uint32_t TIME_uptime_ms_from_tim6
extern