1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 07:24:58 +02:00

fw/antorcha.c: cleanup

- rename "param" to send_param"
- move "map" from add_param to compilation unit scope
This commit is contained in:
Werner Almesberger 2012-06-27 03:32:10 -03:00
parent 558f5a7503
commit fe3ff8d5e1

View File

@ -296,12 +296,7 @@ static struct params params = {
.tp_bwd_pix = TP_BWD_PIX_DEFAULT,
};
static int have_params = 0;
static void add_param(const char *arg, const char *eq)
{
struct map {
static struct map {
const char *name; /* NULL to mark end */
void *p;
int bytes; /* 1, 2, or 4 */
@ -318,6 +313,12 @@ static void add_param(const char *arg, const char *eq)
{ "tp_bwd_pix", &params.tp_bwd_pix, 2 },
{ NULL }
};
static int have_params = 0;
static void add_param(const char *arg, const char *eq)
{
const struct map *m;
size_t len;
unsigned long v;
@ -355,7 +356,7 @@ static void add_param(const char *arg, const char *eq)
}
static void param(struct atrf_dsc *dsc)
static void send_param(struct atrf_dsc *dsc)
{
uint8_t payload[PAYLOAD];
@ -550,7 +551,7 @@ int main(int argc, char **argv)
usage(*argv);
if (optind != argc)
image(dsc, argv[optind]);
param(dsc);
send_param(dsc);
}
return 0;