Author: [email protected]
Date: Wed Mar 25 02:27:58 2009
New Revision: 884
Removed:
trunk/sample/18f2450_blink_II.jal
trunk/sample/18f4550_blink_II.jal
Modified:
trunk/sample/18f2450_i2c_sw_l1.jal
trunk/sample/18f2450_i2c_sw_master_check_bus.jal
trunk/sample/18f2450_i2c_sw_master_echo.jal
trunk/sample/18f2450_lcd_hd44780_4.jal
trunk/sample/18f2450_pwm_led.jal
trunk/sample/18f2450_pwm_led_highres.jal
trunk/sample/18f2450_pwm_sound.jal
trunk/sample/18f2450_random.jal
trunk/sample/18f2450_serial_format.jal
trunk/sample/18f2450_serial_hardware.jal
trunk/sample/18f2450_serial_hw_int_cts.jal
trunk/sample/18f2450_serial_print.jal
trunk/sample/18f2450_usb_cdc.jal
trunk/sample/18f2450_usb_hid_generic.jal
trunk/sample/18f2450_usb_hid_keyboard.jal
trunk/sample/18f2450_usb_hid_mouse.jal
trunk/sample/18f4550_i2c_sw_l1.jal
trunk/sample/18f4550_i2c_sw_master_check_bus.jal
trunk/sample/18f4550_i2c_sw_master_echo.jal
trunk/sample/18f4550_lcd_hd44780_4.jal
trunk/sample/18f4550_random.jal
trunk/sample/18f4550_serial_format.jal
trunk/sample/18f4550_serial_hardware.jal
trunk/sample/18f4550_serial_hw_int_cts.jal
trunk/sample/18f4550_serial_print.jal
trunk/sample/18f4550_usb_cdc.jal
trunk/sample/18f4550_usb_hid_generic.jal
trunk/sample/18f4550_usb_hid_keyboard.jal
trunk/sample/18f4550_usb_hid_mouse.jal
trunk/test/peripheral/usb/test_usb_hid_generic.jal
trunk/test/peripheral/usb/test_usb_hid_keyboard.jal
Log:
fixed validation errors
Modified: trunk/sample/18f2450_i2c_sw_l1.jal
==============================================================================
--- trunk/sample/18f2450_i2c_sw_l1.jal (original)
+++ trunk/sample/18f2450_i2c_sw_l1.jal Wed Mar 25 02:27:58 2009
@@ -25,7 +25,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:20, from:
+-- This file has been generated on 03/25/09 10:21:32, from:
-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_l1.jal
--
Modified: trunk/sample/18f2450_i2c_sw_master_check_bus.jal
==============================================================================
--- trunk/sample/18f2450_i2c_sw_master_check_bus.jal (original)
+++ trunk/sample/18f2450_i2c_sw_master_check_bus.jal Wed Mar 25 02:27:58
2009
@@ -15,7 +15,7 @@
-- Sources:
--
--
--- This file has been generated on 03/24/09 20:40:14, from:
+-- This file has been generated on 03/25/09 10:21:26, from:
-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_master_check_bus.jal
--
Modified: trunk/sample/18f2450_i2c_sw_master_echo.jal
==============================================================================
--- trunk/sample/18f2450_i2c_sw_master_echo.jal (original)
+++ trunk/sample/18f2450_i2c_sw_master_echo.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
-- Sources:
--
--
--- This file has been generated on 03/24/09 20:40:05, from:
+-- This file has been generated on 03/25/09 10:21:19, from:
-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_master_echo.jal
--
Modified: trunk/sample/18f2450_lcd_hd44780_4.jal
==============================================================================
--- trunk/sample/18f2450_lcd_hd44780_4.jal (original)
+++ trunk/sample/18f2450_lcd_hd44780_4.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--------------------------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:03, from:
+-- This file has been generated on 03/25/09 10:21:17, from:
-- * board: board_18f2450_af.jal
-- * test : test_lcd_hd44780_4.jal
--
Modified: trunk/sample/18f2450_pwm_led.jal
==============================================================================
--- trunk/sample/18f2450_pwm_led.jal (original)
+++ trunk/sample/18f2450_pwm_led.jal Wed Mar 25 02:27:58 2009
@@ -12,7 +12,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:06, from:
+-- This file has been generated on 03/25/09 10:21:19, from:
-- * board: board_18f2450_af.jal
-- * test : test_pwm_led.jal
--
Modified: trunk/sample/18f2450_pwm_led_highres.jal
==============================================================================
--- trunk/sample/18f2450_pwm_led_highres.jal (original)
+++ trunk/sample/18f2450_pwm_led_highres.jal Wed Mar 25 02:27:58 2009
@@ -11,7 +11,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:08, from:
+-- This file has been generated on 03/25/09 10:21:21, from:
-- * board: board_18f2450_af.jal
-- * test : test_pwm_led_highres.jal
--
Modified: trunk/sample/18f2450_pwm_sound.jal
==============================================================================
--- trunk/sample/18f2450_pwm_sound.jal (original)
+++ trunk/sample/18f2450_pwm_sound.jal Wed Mar 25 02:27:58 2009
@@ -14,7 +14,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:10, from:
+-- This file has been generated on 03/25/09 10:21:22, from:
-- * board: board_18f2450_af.jal
-- * test : test_pwm_sound.jal
--
Modified: trunk/sample/18f2450_random.jal
==============================================================================
--- trunk/sample/18f2450_random.jal (original)
+++ trunk/sample/18f2450_random.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:05, from:
+-- This file has been generated on 03/25/09 10:21:18, from:
-- * board: board_18f2450_af.jal
-- * test : test_random.jal
--
Modified: trunk/sample/18f2450_serial_format.jal
==============================================================================
--- trunk/sample/18f2450_serial_format.jal (original)
+++ trunk/sample/18f2450_serial_format.jal Wed Mar 25 02:27:58 2009
@@ -16,7 +16,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:04, from:
+-- This file has been generated on 03/25/09 10:21:18, from:
-- * board: board_18f2450_af.jal
-- * test : test_serial_format.jal
--
Modified: trunk/sample/18f2450_serial_hardware.jal
==============================================================================
--- trunk/sample/18f2450_serial_hardware.jal (original)
+++ trunk/sample/18f2450_serial_hardware.jal Wed Mar 25 02:27:58 2009
@@ -22,7 +22,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:09, from:
+-- This file has been generated on 03/25/09 10:21:22, from:
-- * board: board_18f2450_af.jal
-- * test : test_serial_hardware.jal
--
Modified: trunk/sample/18f2450_serial_hw_int_cts.jal
==============================================================================
--- trunk/sample/18f2450_serial_hw_int_cts.jal (original)
+++ trunk/sample/18f2450_serial_hw_int_cts.jal Wed Mar 25 02:27:58 2009
@@ -22,7 +22,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:20, from:
+-- This file has been generated on 03/25/09 10:21:32, from:
-- * board: board_18f2450_af.jal
-- * test : test_serial_hw_int_cts.jal
--
Modified: trunk/sample/18f2450_serial_print.jal
==============================================================================
--- trunk/sample/18f2450_serial_print.jal (original)
+++ trunk/sample/18f2450_serial_print.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:05, from:
+-- This file has been generated on 03/25/09 10:21:18, from:
-- * board: board_18f2450_af.jal
-- * test : test_serial_print.jal
--
Modified: trunk/sample/18f2450_usb_cdc.jal
==============================================================================
--- trunk/sample/18f2450_usb_cdc.jal (original)
+++ trunk/sample/18f2450_usb_cdc.jal Wed Mar 25 02:27:58 2009
@@ -52,7 +52,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:14, from:
+-- This file has been generated on 03/25/09 10:21:26, from:
-- * board: board_18f2450_af.jal
-- * test : test_usb_cdc.jal
--
Modified: trunk/sample/18f2450_usb_hid_generic.jal
==============================================================================
--- trunk/sample/18f2450_usb_hid_generic.jal (original)
+++ trunk/sample/18f2450_usb_hid_generic.jal Wed Mar 25 02:27:58 2009
@@ -24,7 +24,7 @@
--
-- compiled with following flags: -loader18 -no-fuse -no-variable-reuse
--
--- This file has been generated on 03/24/09 20:40:06, from:
+-- This file has been generated on 03/25/09 10:21:19, from:
-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_generic.jal
--
@@ -315,11 +315,11 @@
-------------------------------- ADC STUFF
-------------------------------------
-const no_ADC = 0x06
-const ADC_hardware_Nchan = 1 ;number of selected channels
-const ADC_hardware_NVref = 0 ;number of external references
-const ADC_hardware_Rsource = 10_000 ;maximum source resistance
-const ADC_hardware_high_resolution = true ;true = high resolution = 10 bits
+const no_adc = 0x06
+const ADC_HARDWARE_NCHAN = 1
+const ADC_HARDWARE_NVREF = 0 ;number of external references
+const ADC_HARDWARE_RSOURCE = 10_000 ;maximum source resistance
+const ADC_HARDWARE_HIGH_RESOLUTION = true ;true = high resolution = 10 bits
-- get the library, after defining the constants
include adc_hardware
@@ -333,7 +333,7 @@
--
-----------------------------------------------------------------------------
-- timer 0 offset value
-const byte InitTMR0 = 106
+const byte TMR0_OFFSET = 106
------------------------------------------------------------
-- TIMER 0 configuration
@@ -344,8 +344,8 @@
-- timer 0 should divide by => 12 Mhz / 1 KHz = 12000
-- set pre-scaler to 1:8 and count to 150
--
--- InitTMR0 = ( 256 - 150 ) = 106
--- TMR0_delay=(256-InitTMR0)*4*prescaler/Fosc
+-- TMR0_OFFSET = ( 256 - 150 ) = 106
+-- TMR0_delay=(256-TMR0_OFFSET)*4*prescaler/Fosc
-- TMR0_delay=(256-6)*4*4/20_000_000= 0.1 msec.
--
-- Init TMR0, free run mode,
@@ -376,22 +376,22 @@
var byte hid_tx_buffer[ HID_OUT_REPORT_SIZE ]
-var bit sendTx = false
+var bit send_tx = false
var bit adc_enabled = false
-- TMR0 interrupt service routine
-procedure TMR0_ISR is
+procedure timer_0_isr() is
pragma interrupt
-- currently JAL does not save the FSR within the interrupt routine
-- therefore we save it ourselfs, since it is used in the AddToFifo
-- function
- var byte s_fsr0L = FSR0L
- var byte s_fsr0H = FSR0H
- var byte s_fsr1L = FSR1L
- var byte s_fsr1H = FSR1H
+ var byte s_fsr0l = FSR0L
+ var byte s_fsr0h = FSR0H
+ var byte s_fsr1l = FSR1L
+ var byte s_fsr1h = FSR1H
if REG_T0IF then
num_timer_ints = num_timer_ints + 1
@@ -401,7 +401,7 @@
hid_tx_buffer[ 0 ] = 0x10
hid_tx_buffer[ 1 ] = PORTA
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 200 ) then
@@ -409,7 +409,7 @@
hid_tx_buffer[ 0 ] = 0x11
hid_tx_buffer[ 1 ] = PORTB
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 300 ) then
@@ -417,14 +417,14 @@
hid_tx_buffer[ 0 ] = 0x12
hid_tx_buffer[ 1 ] = PORTC
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 400 ) then
-- send ADC event
hid_tx_buffer[ 0 ] = 0x13
- sendTx = true
+ send_tx = true
end if
-- only send value every 100 ms second
@@ -444,22 +444,22 @@
hid_tx_buffer[ 1 ] = adc_hbyte
hid_tx_buffer[ 2 ] = adc_lbyte
- sendTx = true
+ send_tx = true
end if
end if
- -- Do timer offset InitTMR0
- TMR0 = TMR0 + InitTMR0
+ -- Do timer offset TMR0_OFFSET
+ TMR0 = TMR0 + TMR0_OFFSET
-- Clear timer 0 interrupt flag
REG_T0IF = low
end if
-- restore FSR register
- FSR0L = s_fsr0L
- FSR0H = s_fsr0H
- FSR1L = s_fsr1L
- FSR1H = s_fsr1H
+ FSR0L = s_fsr0l
+ FSR0H = s_fsr0h
+ FSR1L = s_fsr1l
+ FSR1H = s_fsr1h
end procedure
@@ -526,7 +526,7 @@
end loop
- sendTx = true
+ send_tx = true
case cmd of
0x01:
@@ -599,9 +599,9 @@
-- Servicing Hardware
-- use polling method
usb_handle_isr()
- if ( sendTx ) then
+ if ( send_tx ) then
usb_send_data(USB_HID_ENDPOINT, hid_tx_buffer, count(
hid_tx_buffer ),
low )
- sendTx = false
+ send_tx = false
end if
end procedure
@@ -668,9 +668,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
end if
end if
Modified: trunk/sample/18f2450_usb_hid_keyboard.jal
==============================================================================
--- trunk/sample/18f2450_usb_hid_keyboard.jal (original)
+++ trunk/sample/18f2450_usb_hid_keyboard.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:10, from:
+-- This file has been generated on 03/25/09 10:21:23, from:
-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_keyboard.jal
--
@@ -595,12 +595,12 @@
pin_b5_direction = input
-var byte keyValue = 4
+var byte key_value = 4
var bit sw3 is pin_b5
var bit latched_sw3 = sw3
-var bit sendKeystroke = false
+var bit send_key_stroke = false
-- disable analog unit, all ports set to digital
enable_digital_io()
@@ -644,10 +644,10 @@
latched_sw3 = sw3
if ( sw3 == low )then
- hid_report_in[2] = keyValue
- keyValue = keyValue + 1
- if ( keyValue == 40 ) then
- keyValue = 4
+ hid_report_in[2] = key_value
+ key_value = key_value + 1
+ if ( key_value == 40 ) then
+ key_value = 4
end if
else
hid_report_in[2] = 0
@@ -665,9 +665,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
end if
end if
Modified: trunk/sample/18f2450_usb_hid_mouse.jal
==============================================================================
--- trunk/sample/18f2450_usb_hid_mouse.jal (original)
+++ trunk/sample/18f2450_usb_hid_mouse.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:18, from:
+-- This file has been generated on 03/25/09 10:21:31, from:
-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_mouse.jal
--
Modified: trunk/sample/18f4550_i2c_sw_l1.jal
==============================================================================
--- trunk/sample/18f4550_i2c_sw_l1.jal (original)
+++ trunk/sample/18f4550_i2c_sw_l1.jal Wed Mar 25 02:27:58 2009
@@ -25,7 +25,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:40, from:
+-- This file has been generated on 03/25/09 10:21:51, from:
-- * board: board_18f4550_af.jal
-- * test : test_i2c_sw_l1.jal
--
Modified: trunk/sample/18f4550_i2c_sw_master_check_bus.jal
==============================================================================
--- trunk/sample/18f4550_i2c_sw_master_check_bus.jal (original)
+++ trunk/sample/18f4550_i2c_sw_master_check_bus.jal Wed Mar 25 02:27:58
2009
@@ -15,7 +15,7 @@
-- Sources:
--
--
--- This file has been generated on 03/24/09 20:40:33, from:
+-- This file has been generated on 03/25/09 10:21:44, from:
-- * board: board_18f4550_af.jal
-- * test : test_i2c_sw_master_check_bus.jal
--
Modified: trunk/sample/18f4550_i2c_sw_master_echo.jal
==============================================================================
--- trunk/sample/18f4550_i2c_sw_master_echo.jal (original)
+++ trunk/sample/18f4550_i2c_sw_master_echo.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
-- Sources:
--
--
--- This file has been generated on 03/24/09 20:40:24, from:
+-- This file has been generated on 03/25/09 10:21:36, from:
-- * board: board_18f4550_af.jal
-- * test : test_i2c_sw_master_echo.jal
--
Modified: trunk/sample/18f4550_lcd_hd44780_4.jal
==============================================================================
--- trunk/sample/18f4550_lcd_hd44780_4.jal (original)
+++ trunk/sample/18f4550_lcd_hd44780_4.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--------------------------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:21, from:
+-- This file has been generated on 03/25/09 10:21:33, from:
-- * board: board_18f4550_af.jal
-- * test : test_lcd_hd44780_4.jal
--
Modified: trunk/sample/18f4550_random.jal
==============================================================================
--- trunk/sample/18f4550_random.jal (original)
+++ trunk/sample/18f4550_random.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:23, from:
+-- This file has been generated on 03/25/09 10:21:35, from:
-- * board: board_18f4550_af.jal
-- * test : test_random.jal
--
Modified: trunk/sample/18f4550_serial_format.jal
==============================================================================
--- trunk/sample/18f4550_serial_format.jal (original)
+++ trunk/sample/18f4550_serial_format.jal Wed Mar 25 02:27:58 2009
@@ -16,7 +16,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:22, from:
+-- This file has been generated on 03/25/09 10:21:34, from:
-- * board: board_18f4550_af.jal
-- * test : test_serial_format.jal
--
Modified: trunk/sample/18f4550_serial_hardware.jal
==============================================================================
--- trunk/sample/18f4550_serial_hardware.jal (original)
+++ trunk/sample/18f4550_serial_hardware.jal Wed Mar 25 02:27:58 2009
@@ -22,7 +22,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:27, from:
+-- This file has been generated on 03/25/09 10:21:39, from:
-- * board: board_18f4550_af.jal
-- * test : test_serial_hardware.jal
--
Modified: trunk/sample/18f4550_serial_hw_int_cts.jal
==============================================================================
--- trunk/sample/18f4550_serial_hw_int_cts.jal (original)
+++ trunk/sample/18f4550_serial_hw_int_cts.jal Wed Mar 25 02:27:58 2009
@@ -22,7 +22,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:39, from:
+-- This file has been generated on 03/25/09 10:21:50, from:
-- * board: board_18f4550_af.jal
-- * test : test_serial_hw_int_cts.jal
--
Modified: trunk/sample/18f4550_serial_print.jal
==============================================================================
--- trunk/sample/18f4550_serial_print.jal (original)
+++ trunk/sample/18f4550_serial_print.jal Wed Mar 25 02:27:58 2009
@@ -19,7 +19,7 @@
--
-- ------------------------------------------------------
--
--- This file has been generated on 03/24/09 20:40:23, from:
+-- This file has been generated on 03/25/09 10:21:35, from:
-- * board: board_18f4550_af.jal
-- * test : test_serial_print.jal
--
Modified: trunk/sample/18f4550_usb_cdc.jal
==============================================================================
--- trunk/sample/18f4550_usb_cdc.jal (original)
+++ trunk/sample/18f4550_usb_cdc.jal Wed Mar 25 02:27:58 2009
@@ -52,7 +52,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:33, from:
+-- This file has been generated on 03/25/09 10:21:44, from:
-- * board: board_18f4550_af.jal
-- * test : test_usb_cdc.jal
--
Modified: trunk/sample/18f4550_usb_hid_generic.jal
==============================================================================
--- trunk/sample/18f4550_usb_hid_generic.jal (original)
+++ trunk/sample/18f4550_usb_hid_generic.jal Wed Mar 25 02:27:58 2009
@@ -24,7 +24,7 @@
--
-- compiled with following flags: -loader18 -no-fuse -no-variable-reuse
--
--- This file has been generated on 03/24/09 20:40:24, from:
+-- This file has been generated on 03/25/09 10:21:36, from:
-- * board: board_18f4550_af.jal
-- * test : test_usb_hid_generic.jal
--
@@ -323,11 +323,11 @@
-------------------------------- ADC STUFF
-------------------------------------
-const no_ADC = 0x06
-const ADC_hardware_Nchan = 1 ;number of selected channels
-const ADC_hardware_NVref = 0 ;number of external references
-const ADC_hardware_Rsource = 10_000 ;maximum source resistance
-const ADC_hardware_high_resolution = true ;true = high resolution = 10 bits
+const no_adc = 0x06
+const ADC_HARDWARE_NCHAN = 1
+const ADC_HARDWARE_NVREF = 0 ;number of external references
+const ADC_HARDWARE_RSOURCE = 10_000 ;maximum source resistance
+const ADC_HARDWARE_HIGH_RESOLUTION = true ;true = high resolution = 10 bits
-- get the library, after defining the constants
include adc_hardware
@@ -341,7 +341,7 @@
--
-----------------------------------------------------------------------------
-- timer 0 offset value
-const byte InitTMR0 = 106
+const byte TMR0_OFFSET = 106
------------------------------------------------------------
-- TIMER 0 configuration
@@ -352,8 +352,8 @@
-- timer 0 should divide by => 12 Mhz / 1 KHz = 12000
-- set pre-scaler to 1:8 and count to 150
--
--- InitTMR0 = ( 256 - 150 ) = 106
--- TMR0_delay=(256-InitTMR0)*4*prescaler/Fosc
+-- TMR0_OFFSET = ( 256 - 150 ) = 106
+-- TMR0_delay=(256-TMR0_OFFSET)*4*prescaler/Fosc
-- TMR0_delay=(256-6)*4*4/20_000_000= 0.1 msec.
--
-- Init TMR0, free run mode,
@@ -384,22 +384,22 @@
var byte hid_tx_buffer[ HID_OUT_REPORT_SIZE ]
-var bit sendTx = false
+var bit send_tx = false
var bit adc_enabled = false
-- TMR0 interrupt service routine
-procedure TMR0_ISR is
+procedure timer_0_isr() is
pragma interrupt
-- currently JAL does not save the FSR within the interrupt routine
-- therefore we save it ourselfs, since it is used in the AddToFifo
-- function
- var byte s_fsr0L = FSR0L
- var byte s_fsr0H = FSR0H
- var byte s_fsr1L = FSR1L
- var byte s_fsr1H = FSR1H
+ var byte s_fsr0l = FSR0L
+ var byte s_fsr0h = FSR0H
+ var byte s_fsr1l = FSR1L
+ var byte s_fsr1h = FSR1H
if REG_T0IF then
num_timer_ints = num_timer_ints + 1
@@ -409,7 +409,7 @@
hid_tx_buffer[ 0 ] = 0x10
hid_tx_buffer[ 1 ] = PORTA
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 200 ) then
@@ -417,7 +417,7 @@
hid_tx_buffer[ 0 ] = 0x11
hid_tx_buffer[ 1 ] = PORTB
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 300 ) then
@@ -425,14 +425,14 @@
hid_tx_buffer[ 0 ] = 0x12
hid_tx_buffer[ 1 ] = PORTC
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 400 ) then
-- send ADC event
hid_tx_buffer[ 0 ] = 0x13
- sendTx = true
+ send_tx = true
end if
-- only send value every 100 ms second
@@ -452,22 +452,22 @@
hid_tx_buffer[ 1 ] = adc_hbyte
hid_tx_buffer[ 2 ] = adc_lbyte
- sendTx = true
+ send_tx = true
end if
end if
- -- Do timer offset InitTMR0
- TMR0 = TMR0 + InitTMR0
+ -- Do timer offset TMR0_OFFSET
+ TMR0 = TMR0 + TMR0_OFFSET
-- Clear timer 0 interrupt flag
REG_T0IF = low
end if
-- restore FSR register
- FSR0L = s_fsr0L
- FSR0H = s_fsr0H
- FSR1L = s_fsr1L
- FSR1H = s_fsr1H
+ FSR0L = s_fsr0l
+ FSR0H = s_fsr0h
+ FSR1L = s_fsr1l
+ FSR1H = s_fsr1h
end procedure
@@ -534,7 +534,7 @@
end loop
- sendTx = true
+ send_tx = true
case cmd of
0x01:
@@ -607,9 +607,9 @@
-- Servicing Hardware
-- use polling method
usb_handle_isr()
- if ( sendTx ) then
+ if ( send_tx ) then
usb_send_data(USB_HID_ENDPOINT, hid_tx_buffer, count(
hid_tx_buffer ),
low )
- sendTx = false
+ send_tx = false
end if
end procedure
@@ -676,9 +676,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
end if
end if
Modified: trunk/sample/18f4550_usb_hid_keyboard.jal
==============================================================================
--- trunk/sample/18f4550_usb_hid_keyboard.jal (original)
+++ trunk/sample/18f4550_usb_hid_keyboard.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:28, from:
+-- This file has been generated on 03/25/09 10:21:40, from:
-- * board: board_18f4550_af.jal
-- * test : test_usb_hid_keyboard.jal
--
@@ -603,12 +603,12 @@
pin_b5_direction = input
-var byte keyValue = 4
+var byte key_value = 4
var bit sw3 is pin_b5
var bit latched_sw3 = sw3
-var bit sendKeystroke = false
+var bit send_key_stroke = false
-- disable analog unit, all ports set to digital
enable_digital_io()
@@ -652,10 +652,10 @@
latched_sw3 = sw3
if ( sw3 == low )then
- hid_report_in[2] = keyValue
- keyValue = keyValue + 1
- if ( keyValue == 40 ) then
- keyValue = 4
+ hid_report_in[2] = key_value
+ key_value = key_value + 1
+ if ( key_value == 40 ) then
+ key_value = 4
end if
else
hid_report_in[2] = 0
@@ -673,9 +673,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
end if
end if
Modified: trunk/sample/18f4550_usb_hid_mouse.jal
==============================================================================
--- trunk/sample/18f4550_usb_hid_mouse.jal (original)
+++ trunk/sample/18f4550_usb_hid_mouse.jal Wed Mar 25 02:27:58 2009
@@ -23,7 +23,7 @@
--
--
--
--- This file has been generated on 03/24/09 20:40:38, from:
+-- This file has been generated on 03/25/09 10:21:49, from:
-- * board: board_18f4550_af.jal
-- * test : test_usb_hid_mouse.jal
--
Modified: trunk/test/peripheral/usb/test_usb_hid_generic.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_hid_generic.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_generic.jal Wed Mar 25 02:27:58
2009
@@ -267,11 +267,11 @@
-------------------------------- ADC STUFF
-------------------------------------
-const no_ADC = 0x06
-const ADC_hardware_Nchan = 1 ;number of selected channels
-const ADC_hardware_NVref = 0 ;number of external references
-const ADC_hardware_Rsource = 10_000 ;maximum source resistance
-const ADC_hardware_high_resolution = true ;true = high resolution = 10 bits
+const no_adc = 0x06
+const ADC_HARDWARE_NCHAN = 1
+const ADC_HARDWARE_NVREF = 0 ;number of external references
+const ADC_HARDWARE_RSOURCE = 10_000 ;maximum source resistance
+const ADC_HARDWARE_HIGH_RESOLUTION = true ;true = high resolution = 10 bits
-- get the library, after defining the constants
include adc_hardware
@@ -285,7 +285,7 @@
--
-----------------------------------------------------------------------------
-- timer 0 offset value
-const byte InitTMR0 = 106
+const byte TMR0_OFFSET = 106
------------------------------------------------------------
-- TIMER 0 configuration
@@ -296,8 +296,8 @@
-- timer 0 should divide by => 12 Mhz / 1 KHz = 12000
-- set pre-scaler to 1:8 and count to 150
--
--- InitTMR0 = ( 256 - 150 ) = 106
--- TMR0_delay=(256-InitTMR0)*4*prescaler/Fosc
+-- TMR0_OFFSET = ( 256 - 150 ) = 106
+-- TMR0_delay=(256-TMR0_OFFSET)*4*prescaler/Fosc
-- TMR0_delay=(256-6)*4*4/20_000_000= 0.1 msec.
--
-- Init TMR0, free run mode,
@@ -328,22 +328,22 @@
var byte hid_tx_buffer[ HID_OUT_REPORT_SIZE ]
-var bit sendTx = false
+var bit send_tx = false
var bit adc_enabled = false
-- TMR0 interrupt service routine
-procedure TMR0_ISR is
+procedure timer_0_isr() is
pragma interrupt
-- currently JAL does not save the FSR within the interrupt routine
-- therefore we save it ourselfs, since it is used in the AddToFifo
-- function
- var byte s_fsr0L = FSR0L
- var byte s_fsr0H = FSR0H
- var byte s_fsr1L = FSR1L
- var byte s_fsr1H = FSR1H
+ var byte s_fsr0l = FSR0L
+ var byte s_fsr0h = FSR0H
+ var byte s_fsr1l = FSR1L
+ var byte s_fsr1h = FSR1H
if REG_T0IF then
num_timer_ints = num_timer_ints + 1
@@ -353,7 +353,7 @@
hid_tx_buffer[ 0 ] = 0x10
hid_tx_buffer[ 1 ] = PORTA
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 200 ) then
@@ -361,7 +361,7 @@
hid_tx_buffer[ 0 ] = 0x11
hid_tx_buffer[ 1 ] = PORTB
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 300 ) then
@@ -369,14 +369,14 @@
hid_tx_buffer[ 0 ] = 0x12
hid_tx_buffer[ 1 ] = PORTC
- sendTx = true
+ send_tx = true
end if
if ( num_timer_ints == 400 ) then
-- send ADC event
hid_tx_buffer[ 0 ] = 0x13
- sendTx = true
+ send_tx = true
end if
-- only send value every 100 ms second
@@ -396,22 +396,22 @@
hid_tx_buffer[ 1 ] = adc_hbyte
hid_tx_buffer[ 2 ] = adc_lbyte
- sendTx = true
+ send_tx = true
end if
end if
- -- Do timer offset InitTMR0
- TMR0 = TMR0 + InitTMR0
+ -- Do timer offset TMR0_OFFSET
+ TMR0 = TMR0 + TMR0_OFFSET
-- Clear timer 0 interrupt flag
REG_T0IF = low
end if
-- restore FSR register
- FSR0L = s_fsr0L
- FSR0H = s_fsr0H
- FSR1L = s_fsr1L
- FSR1H = s_fsr1H
+ FSR0L = s_fsr0l
+ FSR0H = s_fsr0h
+ FSR1L = s_fsr1l
+ FSR1H = s_fsr1h
end procedure
@@ -478,7 +478,7 @@
end loop
- sendTx = true
+ send_tx = true
case cmd of
0x01:
@@ -551,9 +551,9 @@
-- Servicing Hardware
-- use polling method
usb_handle_isr()
- if ( sendTx ) then
+ if ( send_tx ) then
usb_send_data(USB_HID_ENDPOINT, hid_tx_buffer, count(
hid_tx_buffer ),
low )
- sendTx = false
+ send_tx = false
end if
end procedure
@@ -620,9 +620,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
end if
end if
Modified: trunk/test/peripheral/usb/test_usb_hid_keyboard.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_hid_keyboard.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_keyboard.jal Wed Mar 25 02:27:58
2009
@@ -547,12 +547,12 @@
pin_b5_direction = input
-var byte keyValue = 4
+var byte key_value = 4
var bit sw3 is pin_b5
var bit latched_sw3 = sw3
-var bit sendKeystroke = false
+var bit send_key_stroke = false
-- disable analog unit, all ports set to digital
enable_digital_io()
@@ -596,10 +596,10 @@
latched_sw3 = sw3
if ( sw3 == low )then
- hid_report_in[2] = keyValue
- keyValue = keyValue + 1
- if ( keyValue == 40 ) then
- keyValue = 4
+ hid_report_in[2] = key_value
+ key_value = key_value + 1
+ if ( key_value == 40 ) then
+ key_value = 4
end if
else
hid_report_in[2] = 0
@@ -617,9 +617,6 @@
if defined( HAS_SERIAL_DEBUG_PORT ) == true then
if PIR1_RCIF then
- var byte tmpB = portb
- serial_hw_write( RCREG )
- print_byte_hex(serial_hw_data, tmpB )
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
-~----------~----~----~----~------~----~------~--~---