Revision: 1543
Author: bvwelch
Date: Wed Dec 16 12:05:06 2009
Log: minor corrections to ascii protocol, additional led blinks.

http://code.google.com/p/jallib/source/detail?r=1543

Modified:
  /trunk/sample/18f2585_can_serial_adapter.jal

=======================================
--- /trunk/sample/18f2585_can_serial_adapter.jal        Tue Dec 15 14:06:35 2009
+++ /trunk/sample/18f2585_can_serial_adapter.jal        Wed Dec 16 12:05:06 2009
@@ -117,6 +117,7 @@

     -- FIXME version
     if cmd == "V" then
+      device = "V"
        device = "0"
        device = "1"
        device = "0"
@@ -126,6 +127,7 @@

        -- FIXME Serial #
     elsif cmd == "N" then
+      device = "N"
        for 8 loop
           device = "9"
        end loop
@@ -140,6 +142,7 @@
        b = COMSTAT
        c = RXB0CON
        d = RXB1CON
+      device = "I"
        print_byte_hex(device, a)
        device = 32
        print_byte_hex(device, b)
@@ -248,6 +251,7 @@
     if cmd == "F" then
        var byte v
        v = COMSTAT
+      device = "F"
        print_byte_hex(device, v)
        device = 13
        return 1
@@ -255,11 +259,11 @@
        -- bridge CAN message
     elsif ascii_to_can(ascii_buf, can_id, can_data, data_len) then
        while can_send(0, can_id, can_data, data_len) == 0 loop end loop
-      if can_is_ext_id(can_id) then
-         device = "Z"
-      else
-         device = "z"
-      end if
+      -- if can_is_ext_id(can_id) then
+      --    device = "Z"
+      -- else
+      --    device = "z"
+      -- end if
        device = 13
        return 1
     end if
@@ -300,12 +304,14 @@

     if modeless_cmd(serial_hw_data, ascii_rxbuf) then
        ascii_rxcnt = 0
+      led = led ^ 1
        return
     end if

     if (is_open == 0) then
        if (closed_cmd(serial_hw_data, ascii_rxbuf) == 1) then
           ascii_rxcnt = 0
+         led = led ^ 1
           return
        end if
     end if
@@ -313,6 +319,7 @@
     if (is_open == 1) then
        if (open_cmd(serial_hw_data, ascii_rxbuf) == 1) then
           ascii_rxcnt = 0
+         led = led ^ 1
           return
        end if
     end if

--

You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.


Reply via email to