Revision: 1641
Author: [email protected]
Date: Fri Jan 29 14:24:50 2010
Log: regenerate samples, refactured boot delay in auto start bootloader
http://code.google.com/p/jallib/source/detail?r=1641
Modified:
/trunk/include/peripheral/usb/usb_drv_cdc_class.jal
/trunk/include/peripheral/usb/usb_serial.jal
/trunk/sample/18f14k50_data_eeprom.jal
/trunk/sample/18f14k50_i2c_hw_l0.jal
/trunk/sample/18f14k50_i2c_hw_l1.jal
/trunk/sample/18f14k50_i2c_hw_slave_check_bus.jal
/trunk/sample/18f14k50_i2c_hw_slave_echo.jal
/trunk/sample/18f14k50_i2c_hw_slave_eeprom_simulator.jal
/trunk/sample/18f14k50_i2c_hw_slave_msg.jal
/trunk/sample/18f14k50_i2c_sw_l1.jal
/trunk/sample/18f14k50_i2c_sw_master_check_bus.jal
/trunk/sample/18f14k50_i2c_sw_master_echo.jal
/trunk/sample/18f14k50_pwm_led.jal
/trunk/sample/18f14k50_pwm_led_highres.jal
/trunk/sample/18f14k50_pwm_sound.jal
/trunk/sample/18f14k50_random.jal
/trunk/sample/18f14k50_serial_format.jal
/trunk/sample/18f14k50_serial_hardware.jal
/trunk/sample/18f14k50_serial_hw_int_cts.jal
/trunk/sample/18f14k50_serial_print.jal
/trunk/sample/18f14k50_usb_bootloader.jal
/trunk/sample/18f14k50_usb_bootloader_autostart.jal
/trunk/sample/18f14k50_usb_hid_generic.jal
/trunk/sample/18f14k50_usb_hid_keyboard.jal
/trunk/sample/18f14k50_usb_hid_mouse.jal
/trunk/sample/18f14k50_usb_serial.jal
/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_bootloader.jal
/trunk/sample/18f2450_usb_bootloader_autostart.jal
/trunk/sample/18f2450_usb_hid_generic.jal
/trunk/sample/18f2450_usb_hid_keyboard.jal
/trunk/sample/18f2450_usb_hid_mouse.jal
/trunk/sample/18f2450_usb_serial.jal
/trunk/sample/18f4550_data_eeprom.jal
/trunk/sample/18f4550_i2c_hw_l0.jal
/trunk/sample/18f4550_i2c_hw_l1.jal
/trunk/sample/18f4550_i2c_hw_slave_check_bus.jal
/trunk/sample/18f4550_i2c_hw_slave_echo.jal
/trunk/sample/18f4550_i2c_hw_slave_eeprom_simulator.jal
/trunk/sample/18f4550_i2c_hw_slave_msg.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_pwm_led.jal
/trunk/sample/18f4550_pwm_led_highres.jal
/trunk/sample/18f4550_pwm_sound.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_seven_segment.jal
/trunk/sample/18f4550_usb_bootloader.jal
/trunk/sample/18f4550_usb_bootloader_autostart.jal
/trunk/sample/18f4550_usb_hid_generic.jal
/trunk/sample/18f4550_usb_hid_keyboard.jal
/trunk/sample/18f4550_usb_hid_mouse.jal
/trunk/sample/18f4550_usb_serial.jal
/trunk/test/peripheral/usb/test_usb_bootloader_autostart.jal
=======================================
--- /trunk/include/peripheral/usb/usb_drv_cdc_class.jal Sun Aug 16 16:42:16
2009
+++ /trunk/include/peripheral/usb/usb_drv_cdc_class.jal Fri Jan 29 14:24:50
2010
@@ -121,7 +121,7 @@
if USB_CDC_DEBUG > 0 then
const byte str[] = " GET_LINE len="
print_string(serial_hw_data,str)
- print_byte_hex(serial_hw_data,len & 0xFF)
+ print_byte_hex( serial_hw_data, byte( len) )
serial_hw_write(" ")
end if
@@ -157,7 +157,7 @@
if USB_CDC_DEBUG > 0 then
const byte str[] = "scls=" --dtr = bit 0, rts =
bit 1
print_string(serial_hw_data,str)
- print_byte_hex(serial_hw_data,val)
+ print_byte_hex(serial_hw_data,byte(val))
end if
-- no data, so just ack the status
usb_control_mode = USB_CM_CTRL_WRITE_SENDING_STATUS
=======================================
--- /trunk/include/peripheral/usb/usb_serial.jal Tue Jun 16 15:06:33 2009
+++ /trunk/include/peripheral/usb/usb_serial.jal Fri Jan 29 14:24:50 2010
@@ -109,8 +109,6 @@
var volatile byte usb_ep3out_buf[ USB_EP3_OUT_SIZE ] at USB_EP3_OUT_ADDR
var volatile byte usb_ep3in_buf[ USB_EP3_IN_SIZE ] at USB_EP3_IN_ADDR
-const word USB_CDC_LINE_CODING_LOC = (USB_BASE_ADDRESS + 0x00E8 )
-
if defined( USB_CDC_TX_BUFFER_SIZE ) == false then
-- -----------------------------------------------------------------------
-- USB_CDC_TX_BUFFER_SIZE contains the size of the transmit FIFO buffer
=======================================
--- /trunk/sample/18f14k50_data_eeprom.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_data_eeprom.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_data_eeprom.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_l0.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_hw_l0.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_l0.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_l1.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_hw_l1.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_l1.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_slave_check_bus.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f14k50_i2c_hw_slave_check_bus.jal Fri Jan 29 14:24:50
2010
@@ -17,7 +17,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_slave_check_bus.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_slave_echo.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_hw_slave_echo.jal Fri Jan 29 14:24:50 2010
@@ -16,7 +16,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_slave_echo.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_slave_eeprom_simulator.jal Thu Nov 12
11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_hw_slave_eeprom_simulator.jal Fri Jan 29
14:24:50 2010
@@ -17,7 +17,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_slave_eeprom_simulator.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_hw_slave_msg.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_hw_slave_msg.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
-- --
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_hw_slave_msg.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_sw_l1.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_sw_l1.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_sw_l1.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_sw_master_check_bus.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f14k50_i2c_sw_master_check_bus.jal Fri Jan 29 14:24:50
2010
@@ -16,7 +16,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_sw_master_check_bus.jal
--
=======================================
--- /trunk/sample/18f14k50_i2c_sw_master_echo.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_i2c_sw_master_echo.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_i2c_sw_master_echo.jal
--
=======================================
--- /trunk/sample/18f14k50_pwm_led.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_pwm_led.jal Fri Jan 29 14:24:50 2010
@@ -13,7 +13,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_pwm_led.jal
--
=======================================
--- /trunk/sample/18f14k50_pwm_led_highres.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_pwm_led_highres.jal Fri Jan 29 14:24:50 2010
@@ -12,7 +12,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_pwm_led_highres.jal
--
=======================================
--- /trunk/sample/18f14k50_pwm_sound.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_pwm_sound.jal Fri Jan 29 14:24:50 2010
@@ -15,7 +15,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_pwm_sound.jal
--
=======================================
--- /trunk/sample/18f14k50_random.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_random.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_random.jal
--
=======================================
--- /trunk/sample/18f14k50_serial_format.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_serial_format.jal Fri Jan 29 14:24:50 2010
@@ -17,7 +17,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_serial_format.jal
--
=======================================
--- /trunk/sample/18f14k50_serial_hardware.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_serial_hardware.jal Fri Jan 29 14:24:50 2010
@@ -23,7 +23,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_serial_hardware.jal
--
=======================================
--- /trunk/sample/18f14k50_serial_hw_int_cts.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_serial_hw_int_cts.jal Fri Jan 29 14:24:50 2010
@@ -23,7 +23,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_serial_hw_int_cts.jal
--
=======================================
--- /trunk/sample/18f14k50_serial_print.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_serial_print.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_serial_print.jal
--
=======================================
--- /trunk/sample/18f14k50_usb_bootloader.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_usb_bootloader.jal Fri Jan 29 14:24:50 2010
@@ -25,7 +25,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_bootloader.jal
--
=======================================
--- /trunk/sample/18f14k50_usb_bootloader_autostart.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f14k50_usb_bootloader_autostart.jal Fri Jan 29 14:24:50
2010
@@ -25,7 +25,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_bootloader_autostart.jal
--
@@ -95,6 +95,17 @@
alias bootloader_program_pin is pin_c4
alias bootloader_program_pin_direction is pin_c4_direction
+-- boot timer delay (practical values between 1..10 seconds)
+const BOOT_DELAY_IN_SECONDS = 10
+
+-- timer ticks: clock / 4 / prescaler = 8 / 16 timer overflow
+const TIMER_TICKS_PER_SECOND = target_clock / 65536 / 8 / 4
+const BOOT_TIMER_TICS = BOOT_DELAY_IN_SECONDS * TIMER_TICKS_PER_SECOND
+
+if ( BOOT_TIMER_TICS > 256) then
+ pragma error "Boot delay too large"
+end if
+
const byte READ_VERSION = 0x00
const byte READ_FLASH = 0x01
@@ -715,9 +726,8 @@
t1_count = t1_count + 1
PIR1_TMR1IF = 0
- -- 22 counts per second, ~10 seconds wait => 220 ticks
-- if expired, then jump to user location
- if t1_count > 220 then
+ if t1_count > BOOT_TIMER_TICS then
disable_boot()
-- start user app
=======================================
--- /trunk/sample/18f14k50_usb_hid_generic.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_usb_hid_generic.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
-- compiled with following flags: -loader18 -no-fuse -no-variable-reuse
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_hid_generic.jal
--
=======================================
--- /trunk/sample/18f14k50_usb_hid_keyboard.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_usb_hid_keyboard.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_hid_keyboard.jal
--
=======================================
--- /trunk/sample/18f14k50_usb_hid_mouse.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_usb_hid_mouse.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_hid_mouse.jal
--
=======================================
--- /trunk/sample/18f14k50_usb_serial.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f14k50_usb_serial.jal Fri Jan 29 14:24:50 2010
@@ -48,7 +48,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F14K50_AF.jal
+-- * board: board_18f14k50_af.jal
-- * test : test_usb_serial.jal
--
=======================================
--- /trunk/sample/18f2450_i2c_sw_l1.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_i2c_sw_l1.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_l1.jal
--
=======================================
--- /trunk/sample/18f2450_i2c_sw_master_check_bus.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f2450_i2c_sw_master_check_bus.jal Fri Jan 29 14:24:50
2010
@@ -16,7 +16,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_master_check_bus.jal
--
=======================================
--- /trunk/sample/18f2450_i2c_sw_master_echo.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_i2c_sw_master_echo.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_i2c_sw_master_echo.jal
--
=======================================
--- /trunk/sample/18f2450_lcd_hd44780_4.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_lcd_hd44780_4.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
--
--------------------------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_lcd_hd44780_4.jal
--
=======================================
--- /trunk/sample/18f2450_pwm_led.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_pwm_led.jal Fri Jan 29 14:24:50 2010
@@ -13,7 +13,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_pwm_led.jal
--
=======================================
--- /trunk/sample/18f2450_pwm_led_highres.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_pwm_led_highres.jal Fri Jan 29 14:24:50 2010
@@ -12,7 +12,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_pwm_led_highres.jal
--
=======================================
--- /trunk/sample/18f2450_pwm_sound.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_pwm_sound.jal Fri Jan 29 14:24:50 2010
@@ -15,7 +15,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_pwm_sound.jal
--
=======================================
--- /trunk/sample/18f2450_random.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_random.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_random.jal
--
=======================================
--- /trunk/sample/18f2450_serial_format.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_serial_format.jal Fri Jan 29 14:24:50 2010
@@ -17,7 +17,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_serial_format.jal
--
=======================================
--- /trunk/sample/18f2450_serial_hardware.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_serial_hardware.jal Fri Jan 29 14:24:50 2010
@@ -23,7 +23,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_serial_hardware.jal
--
=======================================
--- /trunk/sample/18f2450_serial_hw_int_cts.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_serial_hw_int_cts.jal Fri Jan 29 14:24:50 2010
@@ -23,7 +23,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_serial_hw_int_cts.jal
--
=======================================
--- /trunk/sample/18f2450_serial_print.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_serial_print.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_serial_print.jal
--
=======================================
--- /trunk/sample/18f2450_usb_bootloader.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_usb_bootloader.jal Fri Jan 29 14:24:50 2010
@@ -25,7 +25,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_bootloader.jal
--
=======================================
--- /trunk/sample/18f2450_usb_bootloader_autostart.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f2450_usb_bootloader_autostart.jal Fri Jan 29 14:24:50
2010
@@ -25,7 +25,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_bootloader_autostart.jal
--
@@ -90,6 +90,17 @@
alias bootloader_program_pin is pin_b5
alias bootloader_program_pin_direction is pin_b5_direction
+-- boot timer delay (practical values between 1..10 seconds)
+const BOOT_DELAY_IN_SECONDS = 10
+
+-- timer ticks: clock / 4 / prescaler = 8 / 16 timer overflow
+const TIMER_TICKS_PER_SECOND = target_clock / 65536 / 8 / 4
+const BOOT_TIMER_TICS = BOOT_DELAY_IN_SECONDS * TIMER_TICKS_PER_SECOND
+
+if ( BOOT_TIMER_TICS > 256) then
+ pragma error "Boot delay too large"
+end if
+
const byte READ_VERSION = 0x00
const byte READ_FLASH = 0x01
@@ -710,9 +721,8 @@
t1_count = t1_count + 1
PIR1_TMR1IF = 0
- -- 22 counts per second, ~10 seconds wait => 220 ticks
-- if expired, then jump to user location
- if t1_count > 220 then
+ if t1_count > BOOT_TIMER_TICS then
disable_boot()
-- start user app
=======================================
--- /trunk/sample/18f2450_usb_hid_generic.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_usb_hid_generic.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
-- compiled with following flags: -loader18 -no-fuse -no-variable-reuse
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_generic.jal
--
=======================================
--- /trunk/sample/18f2450_usb_hid_keyboard.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_usb_hid_keyboard.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_keyboard.jal
--
=======================================
--- /trunk/sample/18f2450_usb_hid_mouse.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_usb_hid_mouse.jal Fri Jan 29 14:24:50 2010
@@ -24,7 +24,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_hid_mouse.jal
--
=======================================
--- /trunk/sample/18f2450_usb_serial.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f2450_usb_serial.jal Fri Jan 29 14:24:50 2010
@@ -48,7 +48,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F2450_AF.jal
+-- * board: board_18f2450_af.jal
-- * test : test_usb_serial.jal
--
=======================================
--- /trunk/sample/18f4550_data_eeprom.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f4550_data_eeprom.jal Fri Jan 29 14:24:50 2010
@@ -20,7 +20,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_data_eeprom.jal
--
=======================================
--- /trunk/sample/18f4550_i2c_hw_l0.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f4550_i2c_hw_l0.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_i2c_hw_l0.jal
--
=======================================
--- /trunk/sample/18f4550_i2c_hw_l1.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f4550_i2c_hw_l1.jal Fri Jan 29 14:24:50 2010
@@ -26,7 +26,7 @@
-- ------------------------------------------------------
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_i2c_hw_l1.jal
--
=======================================
--- /trunk/sample/18f4550_i2c_hw_slave_check_bus.jal Thu Nov 12 11:58:40
2009
+++ /trunk/sample/18f4550_i2c_hw_slave_check_bus.jal Fri Jan 29 14:24:50
2010
@@ -17,7 +17,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_i2c_hw_slave_check_bus.jal
--
=======================================
--- /trunk/sample/18f4550_i2c_hw_slave_echo.jal Thu Nov 12 11:58:40 2009
+++ /trunk/sample/18f4550_i2c_hw_slave_echo.jal Fri Jan 29 14:24:50 2010
@@ -16,7 +16,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_i2c_hw_slave_echo.jal
--
=======================================
--- /trunk/sample/18f4550_i2c_hw_slave_eeprom_simulator.jal Thu Nov 12
11:58:40 2009
+++ /trunk/sample/18f4550_i2c_hw_slave_eeprom_simulator.jal Fri Jan 29
14:24:50 2010
@@ -17,7 +17,7 @@
--
--
-- This file has been generated from:
--- * board: board_18F4550_AF.jal
+-- * board: board_18f4550_af.jal
-- * test : test_i2c_hw_slave_eeprom_simulator.jal
--
=======================================
***Additional files exist in this changeset.***
--
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.