Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r4721 - developers/werner/bin ([EMAIL PROTECTED])
   2. r4722 - developers/werner/neocon ([EMAIL PROTECTED])
--- Begin Message ---
Author: werner
Date: 2008-10-18 01:32:18 +0200 (Sat, 18 Oct 2008)
New Revision: 4721

Added:
   developers/werner/bin/ccache-setup
   developers/werner/bin/flashk
Log:
- flashk: handy script to update the kernel on GTA02 over SSH
- ccache-setup: set up ccache for local and cross builds



Added: developers/werner/bin/ccache-setup
===================================================================
--- developers/werner/bin/ccache-setup                          (rev 0)
+++ developers/werner/bin/ccache-setup  2008-10-17 23:32:18 UTC (rev 4721)
@@ -0,0 +1,6 @@
+#!/bin/sh
+for n in gcc g++; do
+    ln -s /usr/bin/ccache /usr/local/bin/$n
+    ln -s /usr/bin/ccache /usr/local/bin/arm-angstrom-linux-gnueabi-$n
+done
+ln -s /usr/bin/ccache /usr/local/bin/cc


Property changes on: developers/werner/bin/ccache-setup
___________________________________________________________________
Name: svn:executable
   + *

Added: developers/werner/bin/flashk
===================================================================
--- developers/werner/bin/flashk                                (rev 0)
+++ developers/werner/bin/flashk        2008-10-17 23:32:18 UTC (rev 4721)
@@ -0,0 +1,7 @@
+#!/bin/sh -ex
+# GTA02 only !!!!
+DEV=/dev/mtd3
+[ -r "$2" ] || exit
+ifconfig usb0 192.168.0.200 up
+scp $2 $1:
+ssh $1 "flash_eraseall $DEV && nandwrite -p $DEV `basename $2` && sync && 
sleep 1 && /sbin/reboot -f"


Property changes on: developers/werner/bin/flashk
___________________________________________________________________
Name: svn:executable
   + *




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-10-18 01:34:17 +0200 (Sat, 18 Oct 2008)
New Revision: 4722

Modified:
   developers/werner/neocon/README
   developers/werner/neocon/neocon.c
Log:
Add manual switch to next device with ~n to solve problem of dead or useless
devices on which we get stuck because they don't generate an error.

- neocon.c (scan): use pointer instead of index (beautification)
- neocon.c (scan, copy), README: let user manually switch to next line with ~n
- neocon.c (open_first_tty, main): select next tty instead of first, rename
  open_first_tty accordingly
- neocon.c (main): print device name when opening a tty
- README: the lockup issue has already been resolved a while ago



Modified: developers/werner/neocon/README
===================================================================
--- developers/werner/neocon/README     2008-10-17 23:32:18 UTC (rev 4721)
+++ developers/werner/neocon/README     2008-10-17 23:34:17 UTC (rev 4722)
@@ -20,12 +20,10 @@
 To leave neocon, type "~.". The escape character (~) can be changed
 with the option "-e escape".
 
+To manually switch to the next device, enter "~n".
 
+
 Known issues
 ------------
 
-Sometimes, the USB stack locks up without neocon ever noticing.
-To reproduce:
-
-- neocon with ttyACM* to u-boot
-- in u-boot, reset
+- the escape character is sent to the target

Modified: developers/werner/neocon/neocon.c
===================================================================
--- developers/werner/neocon/neocon.c   2008-10-17 23:32:18 UTC (rev 4721)
+++ developers/werner/neocon/neocon.c   2008-10-17 23:34:17 UTC (rev 4722)
@@ -37,6 +37,7 @@
 
 static char *const *ttys;
 static int num_ttys;
+static int curr_tty = -1; /* start with first tty */
 static speed_t speed = B115200;
 static struct termios console, tty;
 static FILE *log = NULL;
@@ -112,12 +113,13 @@
 }
 
 
-static int open_first_tty(void)
+static int open_next_tty(void)
 {
     int i, fd = -1;
 
     for (i = 0; i != num_ttys; i++) {
-       fd = open(ttys[i], O_RDWR | O_NDELAY);
+       curr_tty = (curr_tty+1) % num_ttys;
+       fd = open(ttys[curr_tty], O_RDWR | O_NDELAY);
        if (fd >= 0)
            break;
     }
@@ -127,25 +129,34 @@
 }
 
 
-static void scan(const char *s, size_t len)
+/*
+ * Return 1 if the user manually forces a device change.
+ */
+
+
+static int scan(const char *s, size_t len)
 {
     static int state = 0;
-    size_t i;
+    const char *p;
+    int res = 0;
 
-    for (i = 0; i != len; i++)
+    for (p = s; p != s+len; p++)
        switch (state) {
            case 0:
-               if (s[i] == escape)
+               if (*p == escape)
                    state++;
                else
                    state = 0;
                break;
            case 1:
-               if (s[i] == '.')
+               if (*p == '.')
                    exit(0);
+               if (*p == 'n')
+                   res = 1;
                state = 0;
                break;
        }
+    return res;
 }
 
 
@@ -217,15 +228,18 @@
 {
     char buffer[MAX_BUF];
     ssize_t got, wrote, pos;
- 
+
     got = read(in, buffer, single ? 1 : sizeof(buffer));
     if (got <= 0)
        return 0;
-    if (from_user)
-       scan(buffer, got);
-    else
+    if (from_user) {
+       if (scan(buffer, got))
+           return 0;
+    }
+    else {
        if (log)
            do_log(buffer, got);
+    }
     for (pos = 0; pos != got; pos += wrote) {
        wrote = write(out, buffer+pos, got-pos);
        if (wrote < 0)
@@ -257,6 +271,7 @@
 {
     if (tcsetattr(0, TCSANOW, &console) < 0)
        perror("tcsetattr");
+    write(1, "\n", 1);
 }
 
 
@@ -335,9 +350,13 @@
        int res;
 
        if (fd < 0) {
-           fd = open_first_tty();
-           if (fd > 0)
-               write_string("\r\n[Open]\r\n");
+           fd = open_next_tty();
+           if (fd > 0) {
+               char buf[1024]; /* enough :-) */
+
+               sprintf(buf, "\r\r[Open %s]\r\n", ttys[curr_tty]);
+               write_string(buf);
+           }
        }
        FD_ZERO(&set);
        if (!throttle)




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to