Author: sebastien.lelong
Date: Wed Jan 21 13:01:48 2009
New Revision: 741

Modified:
    trunk/sample/by_device/16f88/16f88_i2c_hw_slave_echo.jal

Log:
migrate to new API, add blinking LED

Modified: trunk/sample/by_device/16f88/16f88_i2c_hw_slave_echo.jal
==============================================================================
--- trunk/sample/by_device/16f88/16f88_i2c_hw_slave_echo.jal    (original)
+++ trunk/sample/by_device/16f88/16f88_i2c_hw_slave_echo.jal    Wed Jan 21  
13:01:48 2009
@@ -13,11 +13,14 @@
  -- This sample is aimed to be used with *_i2c_hw_master_echo.jal samples,
  -- which is the master part.
  --
-----
--- This file has been generated on Sun Jan  4 15:03:18 2009, from:
+--
+--
+-- This file has been generated on Wed Jan 21 21:58:00 2009, from:
  --    * board: board_16f88_sl.jal
  --    * test : test_i2c_hw_slave_echo.jal
  --
+
+
  ;@jallib section chipdef
  -- chip setup
  include 16f88
@@ -40,12 +43,7 @@
  serial_hw_init()
  -- tell the world we're ready
  serial_hw_write("!")
-;@jallib section i2c
--- I2C io definition
-var volatile bit i2c_scl            is pin_b4
-var volatile bit i2c_scl_direction  is pin_b4_direction
-var volatile bit i2c_sda            is pin_b1
-var volatile bit i2c_sda_direction  is pin_b1_direction
+
  include i2c_hw_slave
  -- this will be the slave address. It looks like:
  --      0b_0101_1100
@@ -122,8 +120,21 @@

  -- callbacks are defined, now include ISR
  include i2c_hw_slave_isr
+;@jallib section led
+-- LED IO definition
+var bit led             is pin_b3
+var bit led_direction   is pin_b3_direction
+var bit led2            is pin_b1
+var bit led2_direction  is pin_b1_direction
+-- blink a little to tell the world we're up
+led_direction = output
+for 4 loop
+   led = on
+   _usec_delay(100000)
+   led = off
+   _usec_delay(100000)
+end loop

-
+-- just loop until interrupt is raised
  forever loop
-       -- just loop until interrupt is raised
  end loop

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