Prusa MINI Firmware overview
|
|
static int | read (struct _reent *_r, void *pv, char *pc, int n) |
|
static int | write (struct _reent *_r, void *pv, const char *pc, int n) |
|
static int | close (struct _reent *_r, void *pv) |
|
static _fpos_t | seek (struct _reent *_r, void *pv, _fpos_t fpos, int ipos) |
|
int | f_gcode_thumb_open (FILE *fp, FIL *gcode_fp) |
|
int | f_gcode_thumb_close (FILE *fp) |
|
static bool | read_line (FIL *fp, SLine &line) |
|
static char * | str_trim (char *str) |
|
bool | f_gcode_get_next_comment_assignment (FIL *fp, char *name_buffer, int name_buffer_len, char *value_buffer, int value_buffer_len) |
|
◆ DBG
◆ read()
static int read |
( |
struct _reent * |
_r, |
|
|
void * |
pv, |
|
|
char * |
pc, |
|
|
int |
n |
|
) |
| |
|
static |
◆ write()
static int write |
( |
struct _reent * |
_r, |
|
|
void * |
pv, |
|
|
const char * |
pc, |
|
|
int |
n |
|
) |
| |
|
static |
◆ close()
static int close |
( |
struct _reent * |
_r, |
|
|
void * |
pv |
|
) |
| |
|
static |
◆ seek()
static _fpos_t seek |
( |
struct _reent * |
_r, |
|
|
void * |
pv, |
|
|
_fpos_t |
fpos, |
|
|
int |
ipos |
|
) |
| |
|
static |
◆ f_gcode_thumb_open()
int f_gcode_thumb_open |
( |
FILE * |
fp, |
|
|
FIL * |
gcode_fp |
|
) |
| |
31 DBG(
"a gcode png file is already open");
38 memset(fp, 0,
sizeof(FILE));
46 fp->_bf._base = (
uint8_t *)malloc(fp->_lbfsize);
47 fp->_bf._size = fp->_lbfsize;
◆ f_gcode_thumb_close()
int f_gcode_thumb_close |
( |
FILE * |
fp | ) |
|
53 if (fp && fp->_bf._base) {
◆ read_line()
static bool read_line |
( |
FIL * |
fp, |
|
|
SLine & |
line |
|
) |
| |
|
static |
67 if (
f_read(fp, &
byte, 1, &bytes_read) !=
FR_OK || bytes_read != 1)
◆ str_trim()
static char* str_trim |
( |
char * |
str | ) |
|
|
static |
86 char *
end = str + strlen(str) - 1;
87 while (
end > str && *
end ==
' ')
◆ f_gcode_get_next_comment_assignment()
bool f_gcode_get_next_comment_assignment |
( |
FIL * |
fp, |
|
|
char * |
name_buffer, |
|
|
int |
name_buffer_len, |
|
|
char * |
value_buffer, |
|
|
int |
value_buffer_len |
|
) |
| |
Parse comment line in given file
Reads from the file current line and parses it. Example: Read line: ; infill extrusion width = 0.40mm\n
Ouptut: name = "infill extrusion width", value = "0.40mm"
104 if (strncmp(line,
";", 1) != 0)
108 int equal_sign_pos = -1;
109 for (
int i = 1;
i < (
int)strlen(line);
i++) {
110 if (line[
i] ==
'=') {
115 if (equal_sign_pos == -1)
120 while (name_start < equal_sign_pos && line[name_start] ==
' ')
122 int value_start = equal_sign_pos + 1;
123 while (line[value_start] ==
' ')
127 snprintf(name_buffer, name_buffer_len,
"%.*s",
128 equal_sign_pos - name_start,
129 (
const char *)line.
l + name_start);
130 snprintf(value_buffer, value_buffer_len,
"%s",
131 (
const char *)line.
l + value_start);
◆ gcode_thumb_fp
FIL* gcode_thumb_fp = nullptr |
|
static |
void AppendByte(uint8_t b)
Definition: gcode_thumb_decoder.h:36
static GCodeThumbDecoder & Instance()
Definition: gcode_thumb_decoder.h:145
#define DBG
Definition: gcode_file.cpp:5
static FIL * gcode_thumb_fp
Definition: gcode_file.cpp:7
void Reset()
Definition: gcode_thumb_decoder.h:156
uint8_t size
Definition: gcode_thumb_decoder.h:28
uint8_t i
Definition: screen_test_graph.c:72
Definition: gcode_thumb_decoder.h:26
uint8_t l[MAX+1]
Definition: gcode_thumb_decoder.h:32
static bool read_line(FIL *fp, SLine &line)
Definition: gcode_file.cpp:60
end
Definition: createSpeedLookupTable.py:33
int Read(FIL *f, char *pc, int n)
Definition: gcode_thumb_decoder.cpp:71
static int close(struct _reent *_r, void *pv)
Definition: gcode_file.cpp:21
void Reset()
Definition: gcode_thumb_decoder.h:43
static _fpos_t seek(struct _reent *_r, void *pv, _fpos_t fpos, int ipos)
Definition: gcode_file.cpp:25
const uint8_t[]
Definition: 404_html.c:3
#define f_eof(fp)
Definition: ff.h:277
static int read(struct _reent *_r, void *pv, char *pc, int n)
Definition: gcode_file.cpp:9
static char * str_trim(char *str)
Definition: gcode_file.cpp:76
int
Definition: createSpeedLookupTable.py:15
uint8_t byte
Definition: wiring_constants.h:112
unsigned int UINT
Definition: onboard_sd.h:16
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:3499
static int write(struct _reent *_r, void *pv, const char *pc, int n)
Definition: gcode_file.cpp:17