Changeset 3443


Ignore:
Timestamp:
Nov 20, 2012, 2:49:48 AM (17 months ago)
Author:
quozl
Message:

OLPC XO-4 - touchscreen firmware programming, fix INCREDIBLE slowness problem #12327 by following TI specification, convert progress bar to using hex file byte position instead of load address, since load address is outside our control.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/bsl.fth

    r3383 r3443  
    8787 
    8888\ 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. 
     910 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  ; 
    8997 
    9098: bsl-baud  ( baud-rate -- )   \ 9600,8,e,1 
     
    97105; 
    98106 
    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; 
    100111 
    101112: receive?  ( -- false | char true ) 
    102113   uart-base >r  bsl-uart-base to uart-base 
    103    ukey?  if  ukey true  else  false  then 
     114   ukey?  if  ukey true  set-bsl-time  else  false  then 
    104115   r> to uart-base 
    105116; 
     
    117128 
    118129   d# 9600 bsl-baud 
     130   set-bsl-time 
    119131; 
    120132: bsl-close  ( -- ) 
     
    145157   get-msecs d# 2000 +                  ( limit ) 
    146158   begin 
    147       receive?  0=  if drop exit  then      ( limit char ) 
     159      receive?  0=  if drop exit then      ( limit char ) 
    148160      drop  dup get-msecs - 0<          ( limit timeout? ) 
    149161   until 
     
    225237defer bsl-progress  ' 2drop is bsl-progress  ( offset size -- ) 
    226238: rx-data-block  ( adr len device-adr -- ) 
    227    dup h# 8000 - h# 8000 bsl-progress 
    228239   over  h# 12 frame(     ( adr len device-adr ) 
    229240   send-summed            ( adr len )   \ device address 
     
    492503   ." Programming" cr 
    493504   begin                ( ) 
     505      ifd @ ftell  ifd @ fsize  bsl-progress 
    494506      [char] . emit 
    495507      bsl-line-buf d# 100 ifd @ read-line abort" Read line failed" 
Note: See TracChangeset for help on using the changeset viewer.