Author: jsuijs
Date: Sun Mar  8 00:16:11 2009
New Revision: 838

Modified:
    trunk/include/external/lcd/lcd_hd44780_common.jal
    trunk/sample/test/external/lcd/test_display_hd44780_4_line.jal

Log:
inline removed, cursor pos for line 3 and 4 fixed

Modified: trunk/include/external/lcd/lcd_hd44780_common.jal
==============================================================================
--- trunk/include/external/lcd/lcd_hd44780_common.jal   (original)
+++ trunk/include/external/lcd/lcd_hd44780_common.jal   Sun Mar  8 00:16:11  
2009
@@ -112,8 +112,8 @@
     case line of
        0: return 0x00
        1: return 0x40
-      2: return 0x14
-      3: return 0x54
+      2: return 0x00 + LCD_CHARS
+      3: return 0x40 + LCD_CHARS
     end case

  end function
@@ -144,13 +144,13 @@
  --  
----------------------------------------------------------------------------
  --  
----------------------------------------------------------------------------
  procedure lcd'put(byte in data) is
-   pragma inline
+;   pragma inline -- disabled due to complier bug with inline +  
pseudovar/arrays.
     _lcd_write_data(data)
  end procedure
  --  
----------------------------------------------------------------------------

  --  
----------------------------------------------------------------------------
--- lcd_set_cursor - Specify row and column (0-based)
+-- lcd_cursor_position - Specify row and column (0-based)
  --  
----------------------------------------------------------------------------
  -- About cursor positions: the LCDs are internally 2x40 char devices.
  -- The first line starts at offset 0, the second line at offset 64 (0x40).
@@ -273,7 +273,12 @@

  --  
----------------------------------------------------------------------------
  -- lcd_progress- Displays a progress bar
---  
----------------------------------------------------------------------------
+--  
----------------------------------------------------------------------------
+-- The progress bar starts at position 0 of a line.
+--
+-- line: line on which progress bar is displayed
+-- amount: number of bar chars that are displayed
+--
  -- (0xFF is a common pattern)
  --  
----------------------------------------------------------------------------
  procedure lcd_progress(byte in line, byte in amount, byte in pattern) is
@@ -309,9 +314,10 @@
  end procedure


--- set:
--- const bit no_depricated_functions = true
--- if you don't want to have depricated functions
+--  
----------------------------------------------------------------------------
+-- if you don't want to have depricated functions, set:
+--    const bit no_depricated_functions = true
+--  
----------------------------------------------------------------------------
  if (defined(no_depricated_functions) == false) then
     const bit no_depricated_functions = false
  end if

Modified: trunk/sample/test/external/lcd/test_display_hd44780_4_line.jal
==============================================================================
--- trunk/sample/test/external/lcd/test_display_hd44780_4_line.jal       
(original)
+++ trunk/sample/test/external/lcd/test_display_hd44780_4_line.jal      Sun Mar 
  
8 00:16:11 2009
@@ -69,11 +69,84 @@
  ;   delay_100ms (10)


+--  
-----------------------------------------------------------------------------
  -- Define all unit tests required
  -- (testname string constants are optional)
+--  
-----------------------------------------------------------------------------

-const byte testname_a[] = "shift test"
+
+const byte testname_a[] = "clear screen"
  procedure unit_test_a() is
+   lcd_clear_screen()
+end procedure
+
+const byte testname_b[] = "home"
+procedure unit_test_b() is
+   lcd_clear_screen()
+end procedure
+
+const byte testname_c[] = "set cursor position to 0,0 (start line 0)"
+procedure unit_test_c() is
+   lcd_cursor_position(0,0)
+end procedure
+
+const byte testname_d[] = "set cursor position to 1,0 (start line 1)"
+procedure unit_test_d() is
+   lcd_cursor_position(1,0)
+end procedure
+
+const byte testname_e[] = "set cursor position to 2,0 (start line 2)"
+procedure unit_test_e() is
+   lcd_cursor_position(2,0)
+end procedure
+
+const byte testname_f[] = "set cursor position to 3,0 (start line 3)"
+procedure unit_test_f() is
+   lcd_cursor_position(3,0)
+end procedure
+
+const byte testname_g[] = "set cursor position to 0,5"
+procedure unit_test_g() is
+   lcd_cursor_position(0,5)
+end procedure
+
+const byte testname_h[] = "print 'abcd' to cursor pos with lcd_write_char"
+procedure unit_test_h() is
+   lcd_write_char("a")
+   lcd_write_char("b")
+   lcd_write_char("c")
+   lcd_write_char("d")
+end procedure
+
+const byte testname_i[] = "print 'abcd' to cursor pos with lcd'put"
+procedure unit_test_i() is
+   lcd = "a"
+   lcd = "b"
+   lcd = "c"
+   lcd = "d"
+end procedure
+
+const byte testname_p[] = "progress bar"
+procedure unit_test_p() is
+   const byte bar_divider = (255 / (LCD_CHARS-1))
+
+   lcd_cursor_blink_display (off,off,on)
+   lcd_clear_line(1)
+   value = 0
+   while value < 255  loop
+;         lcd_bvalue_dp_line_pos_left_sign ( value, 0, 1, 5, true, false)
+      value = value + 1
+      delay_1ms(50)
+      lcd_progress(1, value/ bar_divider +1, 0xFF)
+   end loop
+;      lcd_bvalue_dp_line_pos_left_sign ( value, 0, 1, 5, true, false)
+   delay_100ms (20)
+   lcd_clear_screen()
+end procedure
+
+
+const byte testname_z[] = "shift test"
+procedure unit_test_z() is

        lcd_cursor_position (2, 1)
        print_string(lcd, teststring)
@@ -86,8 +159,8 @@

  end procedure

-const byte testname_b[] = "blink on test"
-procedure unit_test_b() is
+const byte testname_y[] = "blink on test"
+procedure unit_test_y() is

        lcd_cursor_position (2, 1)

@@ -109,8 +182,8 @@
  end procedure


-const byte testname_c[] = "blink off test"
-procedure unit_test_c() is
+const byte testname_x[] = "blink off test"
+procedure unit_test_x() is

        lcd_cursor_blink_display (off,off,on)
        lcd_clear_line  (2)
@@ -126,8 +199,8 @@
        lcd_clear_screen()
  end procedure

-const byte testname_d[] = "blink off test"
-procedure unit_test_d() is
+const byte testname_w[] = "blink off test"
+procedure unit_test_w() is

  ;      lcd_bvalue_dp_line_pos_left_sign ( 200, 0, 1, 1, true, false)
  ;      delay_100ms (10)
@@ -179,8 +252,8 @@
  ;      delay_100ms (30)
  end procedure

-const byte testname_e[] = "hex run test"
-procedure unit_test_e() is
+const byte testname_v[] = "hex run test"
+procedure unit_test_v() is

        lcd_clear_screen()


--~--~---------~--~----~------------~-------~--~----~
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