]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Enable pullups on all gpio pins. cleanup
authorLeo C <erbl259-lmu@yahoo.de>
Tue, 25 Nov 2014 09:47:55 +0000 (10:47 +0100)
committerLeo C <erbl259-lmu@yahoo.de>
Tue, 25 Nov 2014 09:47:55 +0000 (10:47 +0100)
avr/cmd_help.c
avr/command.c
avr/command_tbl.c
avr/con-utils.c
avr/main.c
avr/z180-serv.c

index b42fc878e5055f7053751e348415068283c6c99b..8f81b2d889b18e892af5b247d4570943a73aa216 100644 (file)
@@ -7,26 +7,3 @@ command_ret_t do_help(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        const int len = cmd_tbl_item_count();
        return _do_help(cmd_tbl, len, cmdtp, flag, argc, argv);
 }
-
-
-#if 0
-
-U_BOOT_CMD(
-       help,   CONFIG_SYS_MAXARGS,     1,      do_help,
-       "print command description/usage",
-       "\n"
-       "       - print brief description of all commands\n"
-       "help command ...\n"
-       "       - print detailed usage of 'command'"
-);
-
-/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
-ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
-       "?",    CONFIG_SYS_MAXARGS,     1,      do_help,
-       "alias for 'help'",
-#ifdef  CONFIG_SYS_LONGHELP
-       ""
-#endif /* CONFIG_SYS_LONGHELP */
-};
-
-#endif
index bb887941e462eccc0552c7a1485cf0c928f813ed..c080527bb166822847f78cc17bb903f66dc81e40 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include <stdio.h>
 
 #include "config.h"
 #include "print-utils.h"
@@ -35,7 +34,7 @@ int strcmp_PP(const FLASH char *s1, const FLASH char *s2)
 {
        unsigned char c1, c2;
 
-       while ((c1 = *(const FLASH unsigned char *)s1++) 
+       while ((c1 = *(const FLASH unsigned char *)s1++)
                        == (c2 = *(const FLASH unsigned char *)s2++))
                if (c1 == 0)
                        return 0;
@@ -43,9 +42,9 @@ int strcmp_PP(const FLASH char *s1, const FLASH char *s2)
        return c1 - c2;
 }
 
-int cmpstringp(const void *p1, const void *p2)
+int cmpstring_PP(const void *p1, const void *p2)
 {
-       return strcmp_PP((*(const FLASH cmd_tbl_t **) p1)->name, 
+       return strcmp_PP((*(const FLASH cmd_tbl_t **) p1)->name,
                         (*(const FLASH cmd_tbl_t **) p2)->name);
 }
 
@@ -87,7 +86,7 @@ command_ret_t _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp,
                }
 
                /* Sort command list */
-               qsort(cmd_array, cmd_items, sizeof (cmd_tbl_t *), cmpstringp);
+               qsort(cmd_array, cmd_items, sizeof (cmd_tbl_t *), cmpstring_PP);
 
                /* print short help (usage) */
                for (i = 0; i < cmd_items; i++) {
@@ -98,10 +97,10 @@ command_ret_t _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp,
                                return CMD_RET_FAILURE;
                        if (usage == NULL)
                                continue;
-#ifdef GCC_BUG_61443 
+#ifdef GCC_BUG_61443
                        print_usage_line(cmd_array[i]->name, max_len, usage);
 #else
-                       printf_P(PSTR("%-" stringify(8) /*FIXME*/ "S - %S\n"), 
+                       printf_P(PSTR("%-" stringify(8) /*FIXME*/ "S - %S\n"),
                                        cmd_array[i]->name, usage);
 #endif
                }
index 6b53fad26353361d08d787d0ae13e780fca2c903..61c61a6dd17e1d690c6c9269795ee5bfcb4badc9 100644 (file)
@@ -190,7 +190,7 @@ CMD_TBL_ITEM(
        "addr1 addr2 count"
 ),
 CMD_TBL_ITEM(
-       base,   2,      1,      do_mem_base,
+       base,   2,      0,      do_mem_base,
        "print or set address offset",
        "\n"
        "    - print address offset for memory commands\n"
index b8017ed4f7f70a1528ef2e747f1d5d645efb5925..f4023ff4e896be07ddbb7965a3682abfab026cae 100644 (file)
@@ -15,7 +15,7 @@ uint_fast8_t tstc(void)
 int my_getchar(uint_fast8_t waitforchar)
 {
        int c;
-       
+
        do {
                bg_shed();
                c = serial_getc();
@@ -92,4 +92,3 @@ void clear_ctrlc(void)
 {
        ctrlc_was_pressed = 0;
 }
-
index af082a3d9c8cb8a6d3d4ede5d3c602e4f00afa68..7e832bf493a216e4392267e99c93336e2c90972d 100644 (file)
@@ -19,6 +19,7 @@
 #include "env.h"
 #include "z180-serv.h"
 #include "spi.h"
+#include "gpio.h"
 
 static uint8_t mcusr;
 
@@ -229,7 +230,8 @@ int main(void)
 {
        setup_avr();
        z80_setup_bus();
-
+       for (int i = 0; i < GPIO_MAX; i++)
+               gpio_config(i, INPUT_PULLUP);
        env_init();
 
        if (reset_reason_is_power_on())
index a920465209ac9f83017846d155222d8b6f17d1b4..e3bca1662fac89a14d871c44078e057a88c9c163 100644 (file)
@@ -218,22 +218,6 @@ void restart_z180_serv(void)
 
 /*--------------------------------------------------------------------------*/
 
-#if 0
-void dump_mem(const FLASH uint8_t *addr, uint32_t len)
-{
-       DBG_P(1, "hdrom dump:");
-       while (len) {
-               DBG_P(1, "\n    %.5x:", addr);
-               for (unsigned i = 0; i<16; i++)
-                       DBG_P(1, " %.2x", *addr++);
-               len -= len > 16 ? 16 : len;
-       }
-       DBG_P(1, "\n");
-}
-#endif
-/*--------------------------------------------------------------------------*/
-
-
 const FLASH uint8_t iniprog[] = {
        0xAF,                   // xor     a
        0xED, 0x39, 0x36,       // out0    (rcr),a         ;disable  DRAM refresh
@@ -283,6 +267,3 @@ const FLASH uint8_t test1[] = {
        0x00,              //   db      0               ;dst
        0x00, 0x00,        //   dw      0               ;count (64k)
 };
-
-
-