Skip to content
Snippets Groups Projects
Commit 4d301463 authored by Christos Gentsos's avatar Christos Gentsos
Browse files

Refactor: shorten names of manufacturer const strs, query cmd fncs

parent 2ffb8b66
Branches
Tags
No related merge requests found
......@@ -8,14 +8,14 @@
#include <usb_debug.h>
const char MFR_ID[] = "CERN (be/co)";
const char MFR_MODEL[] = "DIOT MoniMod";
const char MFR_REVISION[] = "0.1.0";
const char MFR_LOCATION[] = "Geneva";
const char MFR_DATE[] = "190801";
const char MFR_SERIAL[] = "123456789";
void proc_query_prp();
void proc_query_cln();
const char MFR_MDL[] = "DIOT MoniMod";
const char MFR_REV[] = "0.1.0";
const char MFR_LOC[] = "Geneva";
const char MFR_DAT[] = "190801";
const char MFR_SER[] = "123456789";
void query_prp();
void query_cln();
uint8_t query_result;
extern uint32_t secondary_fw_start;
......@@ -30,13 +30,13 @@ static cmd_space_t cmds = {
{4, 2, (uint8_t[]){0xde, 0xad}, (fp_t)NULL, (fp_t)NULL},
{5, 1, (uint8_t *)NULL, (fp_t)NULL, (fp_t)NULL},
{6, 2, (uint8_t *)NULL, (fp_t)NULL, (fp_t)NULL},
{0x1A, -1, (uint8_t *)NULL, proc_query_prp, proc_query_cln},
{0x99, -(int8_t)sizeof(MFR_ID), (uint8_t *)&MFR_ID, (fp_t)NULL, (fp_t)NULL},
{0x9A, -(int8_t)sizeof(MFR_MODEL), (uint8_t *)&MFR_MODEL, (fp_t)NULL, (fp_t)NULL},
{0x9B, -(int8_t)sizeof(MFR_REVISION), (uint8_t *)&MFR_REVISION, (fp_t)NULL, (fp_t)NULL},
{0x9C, -(int8_t)sizeof(MFR_LOCATION), (uint8_t *)&MFR_LOCATION, (fp_t)NULL, (fp_t)NULL},
{0x9D, -(int8_t)sizeof(MFR_DATE), (uint8_t *)&MFR_DATE, (fp_t)NULL, (fp_t)NULL},
{0x9E, -(int8_t)sizeof(MFR_SERIAL), (uint8_t *)&MFR_SERIAL, (fp_t)NULL, (fp_t)NULL}}
{0x1A, -1, (uint8_t *)NULL, query_prp, query_cln},
{0x99, -(int8_t)sizeof(MFR_ID), (uint8_t *)&MFR_ID, (fp_t)NULL, (fp_t)NULL},
{0x9A, -(int8_t)sizeof(MFR_MDL), (uint8_t *)&MFR_MDL, (fp_t)NULL, (fp_t)NULL},
{0x9B, -(int8_t)sizeof(MFR_REV), (uint8_t *)&MFR_REV, (fp_t)NULL, (fp_t)NULL},
{0x9C, -(int8_t)sizeof(MFR_LOC), (uint8_t *)&MFR_LOC, (fp_t)NULL, (fp_t)NULL},
{0x9D, -(int8_t)sizeof(MFR_DAT), (uint8_t *)&MFR_DAT, (fp_t)NULL, (fp_t)NULL},
{0x9E, -(int8_t)sizeof(MFR_SER), (uint8_t *)&MFR_SER, (fp_t)NULL, (fp_t)NULL}}
};
void written_fw_block();
......@@ -153,7 +153,7 @@ void setup_I2C_structs(cmd_space_t **impl_cmds, cmd_space_t **impl_ext_cmds)
fw_write_buf = (uint8_t *)malloc(FLASH_ROW_SIZE);
}
void proc_query_prp()
void query_prp()
{
uint8_t query_cmd;
uint16_t query_cmd_idx;
......@@ -170,7 +170,7 @@ void proc_query_prp()
query_result = 0;
}
void proc_query_cln()
void query_cln()
{
cmds.cmds[in_addr_space(&cmds, 0x1A)].data_pnt = 0;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment