From 6223a58552f54b9bb7ad50f1fee09dc305bd66b8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 20 Jun 2012 07:45:04 -0300 Subject: [PATCH] fw/: move image data from sweep.[ch] to new image.[ch] --- fw/Makefile | 2 +- fw/image.c | 17 +++++++++++++++++ fw/image.h | 32 ++++++++++++++++++++++++++++++++ fw/sweep.c | 1 + fw/sweep.h | 12 ------------ 5 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 fw/image.c create mode 100644 fw/image.h diff --git a/fw/Makefile b/fw/Makefile index 365acd2..04df26c 100644 --- a/fw/Makefile +++ b/fw/Makefile @@ -30,7 +30,7 @@ OBJCOPY = $(AVR_PREFIX)objcopy #OBJDUMP = $(AVR_PREFIX)objdump SIZE = $(AVR_PREFIX)size -OBJS = $(NAME).o dispatch.o hash.o reset.o sweep.o $(COMMON_OBJS) +OBJS = $(NAME).o dispatch.o hash.o image.o reset.o sweep.o $(COMMON_OBJS) BOOT_OBJS = boot.o flash.o fw.o $(COMMON_OBJS) COMMON_OBJS = rf.o spi.o diff --git a/fw/image.c b/fw/image.c new file mode 100644 index 0000000..975fdc1 --- /dev/null +++ b/fw/image.c @@ -0,0 +1,17 @@ +/* + * fw/image.c - Image data (upload and conversion) + * + * Written 2012 by Werner Almesberger + * Copyright 2012 Werner Almesberger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + + +#include "image.h" + + +extern struct line image[MAX_LINES]; diff --git a/fw/image.h b/fw/image.h new file mode 100644 index 0000000..972eba0 --- /dev/null +++ b/fw/image.h @@ -0,0 +1,32 @@ +/* + * fw/image.h - Image data (upload and conversion) + * + * Written 2012 by Werner Almesberger + * Copyright 2012 Werner Almesberger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + + +#ifndef IMAGE_H +#define IMAGE_H + +#include +#include + + +#define MAX_LINES 100 + + +struct line { + uint8_t d; /* port D0-D7 */ + uint8_t cb; /* port C0-C5, B6-B7 */ +}; + + +extern struct line image[MAX_LINES]; + +#endif /* !IMAGE_H */ diff --git a/fw/sweep.c b/fw/sweep.c index 94ca0d2..0a09d0c 100644 --- a/fw/sweep.c +++ b/fw/sweep.c @@ -17,6 +17,7 @@ #include #include +#include "image.h" #include "sweep.h" diff --git a/fw/sweep.h b/fw/sweep.h index 33eb36a..564976e 100644 --- a/fw/sweep.h +++ b/fw/sweep.h @@ -18,15 +18,6 @@ #include -#define MAX_LINES 100 - - -struct line { - uint8_t d; /* port D0-D7 */ - uint8_t cb; /* port C0-C5, B6-B7 */ -}; - - struct sweep { uint32_t wait_ticks; /* number of ticks to wait before image */ uint16_t pixel_ticks; /* number of ticks per pixel */ @@ -36,9 +27,6 @@ struct sweep { }; -extern struct line image[MAX_LINES]; - - void image_sweep(const struct sweep *sweep); void sweep_init(void);