Make useful functions from developer_optc.c available
This commit is contained in:
parent
696574d1eb
commit
192e118d2c
|
@ -51,7 +51,7 @@
|
||||||
#include "developer_opts.h"
|
#include "developer_opts.h"
|
||||||
#include "developer_opts_private.h"
|
#include "developer_opts_private.h"
|
||||||
|
|
||||||
static char cmdbitchar(CMDBIT cb) {
|
char cmdbitchar(CMDBIT cb) {
|
||||||
switch(cb.type) {
|
switch(cb.type) {
|
||||||
case AVR_CMDBIT_IGNORE:
|
case AVR_CMDBIT_IGNORE:
|
||||||
return 'x';
|
return 'x';
|
||||||
|
@ -68,8 +68,9 @@ static char cmdbitchar(CMDBIT cb) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *cmdbitstr(CMDBIT cb) {
|
|
||||||
char space[10];
|
char *cmdbitstr(CMDBIT cb) {
|
||||||
|
char space[32];
|
||||||
|
|
||||||
*space = cmdbitchar(cb);
|
*space = cmdbitchar(cb);
|
||||||
if(*space == 'a')
|
if(*space == 'a')
|
||||||
|
@ -81,9 +82,8 @@ static char *cmdbitstr(CMDBIT cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char *opcodename(int opcode) {
|
||||||
static const char *opcodename(int what) {
|
switch(opcode) {
|
||||||
switch(what) {
|
|
||||||
case AVR_OP_READ:
|
case AVR_OP_READ:
|
||||||
return "read";
|
return "read";
|
||||||
case AVR_OP_WRITE:
|
case AVR_OP_WRITE:
|
||||||
|
@ -192,8 +192,6 @@ static int opcodecmp(OPCODE *op1, OPCODE *op2, int opnum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void printopcode(AVRPART *p, const char *d, OPCODE *op, int what) {
|
static void printopcode(AVRPART *p, const char *d, OPCODE *op, int what) {
|
||||||
unsigned char cmd[4];
|
unsigned char cmd[4];
|
||||||
int i;
|
int i;
|
||||||
|
@ -218,7 +216,7 @@ static void printallopcodes(AVRPART *p, const char *d, OPCODE **opa) {
|
||||||
|
|
||||||
|
|
||||||
// returns position 0..31 of highest bit set or INT_MIN if no bit is set
|
// returns position 0..31 of highest bit set or INT_MIN if no bit is set
|
||||||
static int intlog2(unsigned int n) {
|
int intlog2(unsigned int n) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if(!n)
|
if(!n)
|
||||||
|
@ -402,7 +400,7 @@ static void dev_stack_out(bool tsv, AVRPART *p, const char *name, unsigned char
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// order in which memories are processed, runtime adds unknown ones
|
// order in which memories are processed, runtime adds unknown ones (but there shouldn't be any)
|
||||||
static const char *mem_order[100] = {
|
static const char *mem_order[100] = {
|
||||||
"eeprom", "flash", "application", "apptable",
|
"eeprom", "flash", "application", "apptable",
|
||||||
"boot", "lfuse", "hfuse", "efuse",
|
"boot", "lfuse", "hfuse", "efuse",
|
||||||
|
@ -750,7 +748,7 @@ static void dev_part_strct(AVRPART *p, bool tsv, AVRPART *base) {
|
||||||
|
|
||||||
#define FOLD(c) ({ int _c = (unsigned char) (c); isascii(_c)? tolower(_c): _c; })
|
#define FOLD(c) ({ int _c = (unsigned char) (c); isascii(_c)? tolower(_c): _c; })
|
||||||
|
|
||||||
static int part_match(const char *pattern, const char *string) {
|
int part_match(const char *pattern, const char *string) {
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
const char *p = pattern, *n = string;
|
const char *p = pattern, *n = string;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
#ifndef developer_opts_h
|
#ifndef developer_opts_h
|
||||||
#define developer_opts_h
|
#define developer_opts_h
|
||||||
|
|
||||||
void dev_output_part_defs();
|
char cmdbitchar(CMDBIT cb);
|
||||||
|
char *cmdbitstr(CMDBIT cb);
|
||||||
|
const char *opcodename(int opcode);
|
||||||
|
int intlog2(unsigned int n);
|
||||||
|
int part_match(const char *pattern, const char *string);
|
||||||
|
void dev_output_part_defs(char *partdesc);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue