zy1000 1.47
[openocd.git] / src / ecosboard.c
index 47153490b16c411f7b211672f84b150fb1d01769..757d4da90a009d770a9fd77eda99209479a474a4 100644 (file)
@@ -59,6 +59,7 @@
 #include <cyg/athttpd/handler.h>
 #include <cyg/athttpd/cgi.h>
 #include <cyg/athttpd/forms.h>
+#include <cyg/discover/discover.h>
 #include <cyg/hal/hal_diag.h>
 #include <cyg/kernel/kapi.h>
 #include <cyg/io/serialio.h>
@@ -80,6 +81,7 @@
 #include <ifaddrs.h>
 #include <string.h>
 
+
 #include <unistd.h>
 #include <stdio.h>
 #define MAX_IFS 64
@@ -96,7 +98,7 @@ struct tftpd_fileops fileops =
 
 #endif
 
-#define ZYLIN_VERSION "1.45"
+#define ZYLIN_VERSION "1.47"
 #define ZYLIN_DATE __DATE__
 #define ZYLIN_TIME __TIME__
 /* hmmm....  we can't pick up the right # during build if we've checked this out
@@ -1334,92 +1336,11 @@ static void zylinjtag_startNetwork()
        webRunning = true;
 
        diag_printf("Web server running\n");
-}
 
-static bool readPowerDropout()
-{
-       cyg_uint32 state;
-       // sample and clear power dropout
-       HAL_WRITE_UINT32(0x08000010, 0x80);
-       HAL_READ_UINT32(0x08000010, state);
-       bool powerDropout;
-       powerDropout = (state & 0x80) != 0;
-       return powerDropout;
+       discover_launch();
 }
 
-bool readSRST()
-{
-       cyg_uint32 state;
-       // sample and clear SRST sensing
-       HAL_WRITE_UINT32(0x08000010, 0x00000040);
-       HAL_READ_UINT32(0x08000010, state);
-       bool srstAsserted;
-       srstAsserted = (state & 0x40) != 0;
-       return srstAsserted;
-}
 
-// every 300ms we check for reset & powerdropout and issue a "reset halt" if
-// so.
-
-
-static int sense_handler(void *priv)
-{
-       struct command_context_s *cmd_ctx;
-       cmd_ctx = (struct command_context_s *) priv;
-
-       static bool prevSrstAsserted = false;
-       static bool prevPowerdropout = false;
-
-       bool powerDropout;
-       powerDropout = readPowerDropout();
-
-       bool powerRestored;
-       powerRestored = prevPowerdropout && !powerDropout;
-       if (powerRestored)
-       {
-               LOG_USER("Sensed power restore.");
-       }
-
-       cyg_tick_count_t current = cyg_current_time();
-       static cyg_tick_count_t lastPower = 0;
-       bool waitMore = lastPower + 200 > current;
-       if (powerDropout && !waitMore)
-       {
-               LOG_USER("Sensed power dropout.");
-               lastPower = current;
-       }
-
-       bool srstAsserted = readSRST();
-
-       bool srstDeasserted;
-       srstDeasserted = prevSrstAsserted && !srstAsserted;
-
-       static cyg_tick_count_t lastSrst = 0;
-       waitMore = lastSrst + 200 > current;
-       if (srstDeasserted && !waitMore)
-       {
-               LOG_USER("Sensed nSRST deasserted");
-               lastSrst = current;
-       }
-
-       if (!prevSrstAsserted && srstAsserted)
-       {
-               LOG_USER("Sensed nSRST asserted");
-       }
-
-       prevSrstAsserted = srstAsserted;
-       prevPowerdropout = powerDropout;
-
-       if (srstDeasserted || powerRestored)
-       {
-               /* Other than logging the event we can't do anything here.
-                * Issuing a reset is a particularly bad idea as we might
-                * be inside a reset already.
-                */
-       }
-
-       return ERROR_OK;
-}
 
 
 
@@ -1999,8 +1920,6 @@ int main(int argc, char *argv[])
 
        zylinjtag_parse_config_file(cmd_ctx, "/rom/openocd.cfg");
 
-       target_register_timer_callback(sense_handler, 200, 1, cmd_ctx);
-
        // FIX!!!  Yuk!
        // diag_printf() is really invoked from many more places than we trust it
        // not to cause instabilities(e.g. invoking fputc() from an interrupt is *BAD*).

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)