summaryrefslogtreecommitdiff
path: root/digital/avr/modules/flash/test
diff options
context:
space:
mode:
authorNélio Laranjeiro2008-03-01 18:51:45 +0100
committerNélio Laranjeiro2008-03-01 18:51:45 +0100
commit566ebcdcc810172118dd0519225ad65846ea3cde (patch)
treea6e01ff80472721d1b3b4321ec81f62a36e3e957 /digital/avr/modules/flash/test
parent99e387e488e94ab78f50529fdc58b3fad7ec9cae (diff)
Update the spi and flash module.
testing in progress...
Diffstat (limited to 'digital/avr/modules/flash/test')
-rw-r--r--digital/avr/modules/flash/test/Makefile2
-rw-r--r--digital/avr/modules/flash/test/avrconfig.h17
-rw-r--r--digital/avr/modules/flash/test/test-flash.c10
3 files changed, 18 insertions, 11 deletions
diff --git a/digital/avr/modules/flash/test/Makefile b/digital/avr/modules/flash/test/Makefile
index e8552eb6..9fcc8790 100644
--- a/digital/avr/modules/flash/test/Makefile
+++ b/digital/avr/modules/flash/test/Makefile
@@ -4,7 +4,7 @@ test_flash_SOURCES = test-flash.c
MODULES = utils spi flash proto uart
CONFIGFILE = avrconfig.h
# atmega8, atmega8535, atmega128...
-AVR_MCU = atmega8
+AVR_MCU = atmega128
# -O2 : speed
# -Os : size
OPTIMIZE = -O2
diff --git a/digital/avr/modules/flash/test/avrconfig.h b/digital/avr/modules/flash/test/avrconfig.h
index ac0b3b3a..c4d9f159 100644
--- a/digital/avr/modules/flash/test/avrconfig.h
+++ b/digital/avr/modules/flash/test/avrconfig.h
@@ -32,16 +32,16 @@
/* uart - UART module. */
/** Select hardware uart for primary uart: 0, 1 or -1 to disable. */
-#define AC_UART0_PORT 0
+#define AC_UART0_PORT 1
/** Baudrate: 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 76800,
* 115200, 230400, 250000, 500000, 1000000. */
-#define AC_UART0_BAUDRATE 115200
+#define AC_UART0_BAUDRATE 38400
/** Send mode:
* - POLLING: no interrupts.
* - RING: interrupts, ring buffer. */
-#define AC_UART0_SEND_MODE RING
+#define AC_UART0_SEND_MODE POLLING
/** Recv mode, same as send mode. */
-#define AC_UART0_RECV_MODE RING
+#define AC_UART0_RECV_MODE POLLING
/** Character size: 5, 6, 7, 8, 9 (only 8 implemented). */
#define AC_UART0_CHAR_SIZE 8
/** Parity : ODD, EVEN, NONE. */
@@ -83,4 +83,13 @@
/** Support for quote parameter. */
#define AC_PROTO_QUOTE 1
+/* flash - Flash SPI AVR module. */
+/** Flash PORT used. */
+#define AC_FLASH_PORT PORTD
+/** Flash DDR used. */
+#define AC_FLASH_DDR DDRD
+/** Flash SS pin. */
+#define AC_FLASH_BIT_SS 5
+
+
#endif /* avrconfig_h */
diff --git a/digital/avr/modules/flash/test/test-flash.c b/digital/avr/modules/flash/test/test-flash.c
index 5ca564a7..e90db20f 100644
--- a/digital/avr/modules/flash/test/test-flash.c
+++ b/digital/avr/modules/flash/test/test-flash.c
@@ -25,6 +25,7 @@
#include "common.h"
#include "io.h"
#include "../flash.h"
+#include "modules/proto/proto.h"
void
proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
@@ -35,12 +36,9 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args)
int
main (void)
{
- uint8_t data;
-
+ proto_send0 ('z');
flash_init ();
- flash_write (0x0, 0x14);
- data = flash_read (0x0);
- data = flash_read_managed (1);
- return 1;
+
+ while (1);
}