Author: sebastien.lelong
Date: Fri Sep 5 00:37:17 2008
New Revision: 272
Modified:
trunk/unvalidated/include/jal/format.jal
trunk/unvalidated/include/jal/print.jal
trunk/unvalidated/sample/jal/print_serial_numbers_16f877a.jal
Log:
now JSG compliant...
Modified: trunk/unvalidated/include/jal/format.jal
==============================================================================
--- trunk/unvalidated/include/jal/format.jal (original)
+++ trunk/unvalidated/include/jal/format.jal Fri Sep 5 00:37:17 2008
@@ -72,7 +72,7 @@
--
-----------------------------------------------------------------------------
--
-----------------------------------------------------------------------------
-procedure _write_digit (volatile byte out device, byte in digit, bit in
point) is
+procedure _write_digit(volatile byte out device, byte in digit, bit in
point) is
_format_digit = digit
if point then
@@ -94,7 +94,7 @@
-- n_tot = the total length (including sign and decimal point)
-- N2 = number of digits behind the point
--
-----------------------------------------------------------------------------
-procedure format_byte_dec (volatile byte out device, byte in data, byte in
n_tot, byte in N2) is
+procedure format_byte_dec(volatile byte out device, byte in data, byte in
n_tot, byte in N2) is
const word C100 = 100
const word C10 = 10
@@ -129,7 +129,7 @@
-- n_tot = the total length (including sign and decimal point)
-- N2 = number of digits behind the point
--
-----------------------------------------------------------------------------
-procedure format_word_dec (volatile byte out device, word in data, byte in
n_tot, byte in N2) is
+procedure format_word_dec(volatile byte out device, word in data, byte in
n_tot, byte in N2) is
const word C10000 = 10000
const word C1000 = 1000
@@ -178,7 +178,7 @@
-- n_tot = the total length (including sign and decimal point)
-- N2 = number of digits behind the point
--
-----------------------------------------------------------------------------
-procedure format_sbyte_dec (volatile byte out device, sbyte in data, byte
in n_tot, byte in N2) is
+procedure format_sbyte_dec(volatile byte out device, sbyte in data, byte
in n_tot, byte in N2) is
var bit sign at data:7
@@ -201,7 +201,7 @@
-- n_tot = the total length (including sign and decimal point)
-- N2 = number of digits behind the point
--
-----------------------------------------------------------------------------
-procedure format_sword_dec (volatile byte out device, sword in data, byte
in n_tot, byte in N2) is
+procedure format_sword_dec(volatile byte out device, sword in data, byte
in n_tot, byte in N2) is
;var byte digit
;var byte B[2] at data
@@ -224,7 +224,7 @@
--
-----------------------------------------------------------------------------
-- writes hex formatted byte to output device
--
-----------------------------------------------------------------------------
-procedure format_byte_hex (volatile byte out device, byte in data) is
+procedure format_byte_hex(volatile byte out device, byte in data) is
var byte digit
@@ -245,7 +245,7 @@
--
-----------------------------------------------------------------------------
-- writes hex formatted word to output device
--
-----------------------------------------------------------------------------
-procedure format_word_hex (volatile byte out device, word in data) is
+procedure format_word_hex(volatile byte out device, word in data) is
var byte digit
var byte B[2] at data
@@ -268,7 +268,7 @@
-- Displays a time in HH:MM notation at specified position
-- Hours and minutes are specified separate
--
-----------------------------------------------------------------------------
-procedure format_time_bytes (volatile byte out device,byte in HH, byte in
MM) is
+procedure format_time_bytes(volatile byte out device,byte in HH, byte in
MM) is
var byte D10
D10 = HH / 10
@@ -292,7 +292,7 @@
-- Displays a time in HH:MM notation at specified position
-- the input is specified in minutes
--
-----------------------------------------------------------------------------
-procedure format_time_word (volatile byte out device,word in minutes) is
+procedure format_time_word(volatile byte out device,word in minutes) is
var byte D10
var byte HH
var byte MM
Modified: trunk/unvalidated/include/jal/print.jal
==============================================================================
--- trunk/unvalidated/include/jal/print.jal (original)
+++ trunk/unvalidated/include/jal/print.jal Fri Sep 5 00:37:17 2008
@@ -50,17 +50,14 @@
--
; prototypes
-procedure _print_universal_dec
- (volatile byte out device, dword in data, sdword in digit_divisor, byte
in digit_number)
-procedure _print_suniversal_dec
- (volatile byte out device, sdword in data, sdword in digit_divisor,
byte in digit_number)
-procedure print_byte_binary
- (volatile byte out device, byte in data)
+procedure _print_universal_dec(volatile byte out device, dword in data,
sdword in digit_divisor, byte in digit_number)
+procedure _print_suniversal_dec(volatile byte out device, sdword in data,
sdword in digit_divisor, byte in digit_number)
+procedure print_byte_binary(volatile byte out device, byte in data)
const byte nibble2hex[] = "0123456789ABCDEF" -- conversion string
-procedure print_crlf (volatile byte out device) is
+procedure print_crlf(volatile byte out device) is
device = 13 -- ASCII CR (cariage return)
device = 10 -- ASCII LF (line feed)
end procedure
@@ -75,7 +72,7 @@
end procedure
-procedure print_bit_truefalse (volatile byte out device, bit in data) is
+procedure print_bit_truefalse(volatile byte out device, bit in data) is
const byte str1[] = "true"
const byte str0[] = "false"
@@ -88,7 +85,7 @@
end procedure
-procedure print_bit_highlow (volatile byte out device, bit in data) is
+procedure print_bit_highlow(volatile byte out device, bit in data) is
const byte str1[] = "high"
const byte str0[] = "low"
@@ -101,7 +98,7 @@
end procedure
-procedure print_bit_10 (volatile byte out device, bit in data) is
+procedure print_bit_10(volatile byte out device, bit in data) is
if (data) then
device = "1"
@@ -111,7 +108,7 @@
end procedure
-procedure print_dword_binary (volatile byte out device, dword in data) is
+procedure print_dword_binary(volatile byte out device, dword in data) is
print_byte_binary(device, byte(data>>24))
print_byte_binary(device, byte(data>>16))
@@ -120,14 +117,14 @@
end procedure
-procedure print_word_binary (volatile byte out device, word in data) is
+procedure print_word_binary(volatile byte out device, word in data) is
print_byte_binary(device, byte(data>>8))
print_byte_binary(device, byte(data))
end procedure
-procedure print_byte_binary (volatile byte out device, byte in data) is
+procedure print_byte_binary(volatile byte out device, byte in data) is
for 8 loop
if ((data & 0x80) != 0) then
@@ -141,7 +138,7 @@
end procedure
-procedure print_dword_hex (volatile byte out device, dword in data) is
+procedure print_dword_hex(volatile byte out device, dword in data) is
device = nibble2hex[0x0F & (data>>28)]
device = nibble2hex[0x0F & (data>>24)]
@@ -154,7 +151,7 @@
end procedure
-procedure print_word_hex (volatile byte out device, word in data) is
+procedure print_word_hex(volatile byte out device, word in data) is
device = nibble2hex[0x0F & (data>>12)]
device = nibble2hex[0x0F & (data>>8)]
@@ -163,51 +160,51 @@
end procedure
-procedure print_byte_hex (volatile byte out device, byte in data) is
+procedure print_byte_hex(volatile byte out device, byte in data) is
device = nibble2hex[0x0F & (data>>4)]
device = nibble2hex[0x0F & (data)]
end procedure
-procedure print_sdword_dec (volatile byte out device, sdword in data) is
+procedure print_sdword_dec(volatile byte out device, sdword in data) is
_print_suniversal_dec(device, data, 1000000000, 10)
end procedure
-procedure print_sword_dec (volatile byte out device, sword in data) is
+procedure print_sword_dec(volatile byte out device, sword in data) is
_print_suniversal_dec(device, data, 10000, 5)
end procedure
-procedure print_sbyte_dec (volatile byte out device, sbyte in data) is
+procedure print_sbyte_dec(volatile byte out device, sbyte in data) is
_print_suniversal_dec(device, data, 100, 3)
end procedure
-procedure print_dword_dec (volatile byte out device, dword in data) is
+procedure print_dword_dec(volatile byte out device, dword in data) is
_print_universal_dec(device, data, 1000000000, 10)
end procedure
-procedure print_word_dec (volatile byte out device, word in data) is
+procedure print_word_dec(volatile byte out device, word in data) is
_print_universal_dec(device, data, 10000, 5)
end procedure
-procedure print_byte_dec (volatile byte out device, byte in data) is
+procedure print_byte_dec(volatile byte out device, byte in data) is
_print_universal_dec(device, data, 100, 3)
end procedure
-procedure _print_byte_binary (volatile byte out device, byte in data) is
+procedure _print_byte_binary(volatile byte out device, byte in data) is
for 8 loop
@@ -222,7 +219,7 @@
end procedure
-procedure _print_suniversal_dec (volatile byte out device, sdword in data,
sdword in digit_divisor, byte in digit_number) is
+procedure _print_suniversal_dec(volatile byte out device, sdword in data,
sdword in digit_divisor, byte in digit_number) is
if (data < 0) then
data = -data
@@ -234,7 +231,7 @@
end procedure
-procedure _print_universal_dec (volatile byte out device, dword in data,
sdword in digit_divisor, byte in digit_number) is
+procedure _print_universal_dec(volatile byte out device, dword in data,
sdword in digit_divisor, byte in digit_number) is
var byte digit
var bit no_digits_printed_yet;
Modified: trunk/unvalidated/sample/jal/print_serial_numbers_16f877a.jal
==============================================================================
--- trunk/unvalidated/sample/jal/print_serial_numbers_16f877a.jal
(original)
+++ trunk/unvalidated/sample/jal/print_serial_numbers_16f877a.jal Fri Sep
5 00:37:17 2008
@@ -14,15 +14,14 @@
--
include 16f877a
-pragma target clock 16_000_000
+pragma target CLOCK 16_000_000
pragma target OSC hs
-pragma target WDT Disabled ; WatchdogTimerEnable
-pragma target pwrte Enabled ; PowerUpTimer
-pragma target CP Disabled ; code protection
-pragma target BROWNOUT Enabled
-pragma target LVP Disabled
+pragma target WDT disabled ; WatchdogTimerEnable
+pragma target pwrte enabled ; PowerUpTimer
+pragma target CP disabled ; code protection
+pragma target BROWNOUT enabled
+pragma target LVP disabled
-const bit Ask_Library_IDentity = false
include delay_any_mc
-- setup serial (see echo.jal for more details)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---