diff options
author | Leo C | 2014-07-11 17:14:53 +0200 |
---|---|---|
committer | Leo C | 2014-07-11 17:14:53 +0200 |
commit | 64045ba0916623ab9e7c2f1eed837a2aae081e63 (patch) | |
tree | 2fd245ca15b7f32485e168d4598565efd98f00c4 /stm32/z180-stamp-stm32.c | |
parent | e598b357f1cdfa103c2dc9985321f8c4e11d49ee (diff) | |
download | z180-stamp-64045ba0916623ab9e7c2f1eed837a2aae081e63.zip |
Refactor Tupfiles
Diffstat (limited to 'stm32/z180-stamp-stm32.c')
-rw-r--r-- | stm32/z180-stamp-stm32.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/stm32/z180-stamp-stm32.c b/stm32/z180-stamp-stm32.c index 15d732d..96d724c 100644 --- a/stm32/z180-stamp-stm32.c +++ b/stm32/z180-stamp-stm32.c @@ -1,7 +1,6 @@ /* */ -#include <stdio.h> #include <libopencmsis/core_cm3.h> #include <libopencm3/cm3/nvic.h> @@ -11,6 +10,8 @@ #include <libopencm3/stm32/gpio.h> #include <libopencm3/stm32/timer.h> +#include <stdio.h> + #define ODR 0x0c #define IDR 0x08 @@ -394,7 +395,7 @@ static uint32_t z80_sram_cmp(uint32_t addr, uint32_t length, uint8_t wval, int i uint8_t rval; int_fast8_t errors = 0; - DBG_P(1, "SRAM: Check %#.5x byte... ", length); + DBG_P(1, "SRAM: Check 0x%.5lX byte... ", length); while (length--) { if ((rval = z80_read(addr)) != wval) { if (errors == 0) { @@ -462,6 +463,8 @@ const char * const qbcat = "Zhe quick brown fox jumps over the lazy cat!"; #endif +/*--------------------------------------------------------------------------*/ + uint8_t z80_get_byte(uint32_t adr) { uint8_t data; @@ -508,6 +511,7 @@ struct msg_item { void (*func)(uint8_t, int, uint8_t *); }; +static uint32_t msg_to_addr(uint8_t *msg) { uint32_t addr = msg[0] | (msg[1] << 8) | ((uint32_t)msg[2] << 16); @@ -516,6 +520,7 @@ uint32_t msg_to_addr(uint8_t *msg) } +static void do_msg_ini_msgfifo(uint8_t subf, int len, uint8_t * msg) { (void)subf; (void)len; @@ -524,6 +529,7 @@ void do_msg_ini_msgfifo(uint8_t subf, int len, uint8_t * msg) } +static void do_msg_ini_memfifo(uint8_t subf, int len, uint8_t * msg) { (void)len; @@ -532,6 +538,7 @@ void do_msg_ini_memfifo(uint8_t subf, int len, uint8_t * msg) } +static void do_msg_char_out(uint8_t subf, int len, uint8_t * msg) { (void)subf; @@ -541,6 +548,7 @@ void do_msg_char_out(uint8_t subf, int len, uint8_t * msg) } +static const struct msg_item z80_messages[] = { { 0, /* fct nr. */ @@ -561,6 +569,7 @@ const struct msg_item z80_messages[] = +static void do_message(int len, uint8_t *msg) { uint8_t fct, sub_fct; @@ -605,6 +614,7 @@ void do_message(int len, uint8_t *msg) #define CTRBUF_LEN 256 +static void check_msg_fifo(void) { int ch; |