Changeset 3443
- Timestamp:
- Nov 20, 2012 2:49:48 AM (6 months ago)
- File:
-
- 1 edited
-
cpu/arm/olpc/bsl.fth (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/bsl.fth
r3383 r3443 87 87 88 88 \ These are MMP2/3 dependent 89 \ Section 1.4 of TI slau319c.pdf says to wait 1.2 ms after receiving a 90 \ character from MSP430 BSL prior to sending a new character. 91 0 value bsl-time 92 : set-bsl-time ( -- ) 93 \ MMP2 Timer 0 runs at 6.5 MHz so 1.2 ms is 1200 * 13 / 2 ticks 94 timer0@ [ d# 1200 d# 13 2 */ ] literal + to bsl-time 95 ; 96 : wait-send ( -- ) begin timer0@ bsl-time - 0>= until ; 89 97 90 98 : bsl-baud ( baud-rate -- ) \ 9600,8,e,1 … … 97 105 ; 98 106 99 : bsl-send ( char -- ) uart-base >r bsl-uart-base to uart-base uemit r> to uart-base ; 107 : bsl-send ( char -- ) 108 wait-send 109 uart-base >r bsl-uart-base to uart-base uemit r> to uart-base 110 ; 100 111 101 112 : receive? ( -- false | char true ) 102 113 uart-base >r bsl-uart-base to uart-base 103 ukey? if ukey true else false then114 ukey? if ukey true set-bsl-time else false then 104 115 r> to uart-base 105 116 ; … … 117 128 118 129 d# 9600 bsl-baud 130 set-bsl-time 119 131 ; 120 132 : bsl-close ( -- ) … … 145 157 get-msecs d# 2000 + ( limit ) 146 158 begin 147 receive? 0= if drop exit then ( limit char )159 receive? 0= if drop exit then ( limit char ) 148 160 drop dup get-msecs - 0< ( limit timeout? ) 149 161 until … … 225 237 defer bsl-progress ' 2drop is bsl-progress ( offset size -- ) 226 238 : rx-data-block ( adr len device-adr -- ) 227 dup h# 8000 - h# 8000 bsl-progress228 239 over h# 12 frame( ( adr len device-adr ) 229 240 send-summed ( adr len ) \ device address … … 492 503 ." Programming" cr 493 504 begin ( ) 505 ifd @ ftell ifd @ fsize bsl-progress 494 506 [char] . emit 495 507 bsl-line-buf d# 100 ifd @ read-line abort" Read line failed"
Note: See TracChangeset
for help on using the changeset viewer.
