Changeset 3496
- Timestamp:
- Dec 14, 2012 8:32:27 AM (5 months ago)
- File:
-
- 1 edited
-
dev/olpc/dcon/mmp2dcon.fth (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dev/olpc/dcon/mmp2dcon.fth
r3449 r3496 60 60 : dcon! ( word reg# -- ) " reg-w!" $call-parent ; 61 61 62 : mode@ ( -- mode ) 1 dcon@ ; 63 : mode! ( mode -- ) 1 dcon! ; 64 : hres! ( hres -- ) 2 dcon! ; \ def: h# 458 d# 1200 65 : htotal! ( htotal -- ) 3 dcon! ; \ def: h# 4e8 d# 1256 66 : hsync! ( sync -- ) 4 dcon! ; \ def: h# 1808 d# 24,8 67 : vres! ( vres -- ) 5 dcon! ; \ def: h# 340 d# 900 68 : vtotal! ( htotal -- ) 6 dcon! ; \ def: h# 390 d# 912 69 : vsync! ( sync -- ) 7 dcon! ; \ def: h# 403 d# 4,3 70 : timeout! ( to -- ) 8 dcon! ; \ def: h# ffff 71 : scanint! ( si -- ) 9 dcon! ; \ def: h# 0000 72 73 : scanint-on ( -- ) mode@ h# 100 or mode! ; 74 : scanint-off ( -- ) mode@ h# 100 invert and mode! ; 75 62 76 : dcon-load ( -- ) dcon-load-gpio# gpio-set ; 63 77 : dcon-unload ( -- ) dcon-load-gpio# gpio-clr ; … … 73 87 0 value color? \ COLOUR 74 88 75 d# 905 value resumeline \ Configurable; should be set from args 76 77 : wait-output ( -- ) d# 40 ms ; 78 89 d# 850 value resumeline 79 90 : mark-time ( -- start-time ) get-msecs ; 80 91 : delta-ms ( start-time -- elapsed-ms ) mark-time swap - ; 92 93 : wait-output ( -- ) 94 mark-time ( start-time ) 95 resumeline scanint! setup-dcon-irq scanint-on ( ) 96 begin ( start-time ) 97 dcon-irq? if ( start-time ) 98 setup-dcon-irq ( start-time ) 99 begin ( start-time ) 100 dcon-irq? if ( start-time ) 101 drop scanint-off exit ( ) 102 then ( start-time ) 103 dup delta-ms d# 100 > ( start-time ) 104 until ( start-time ) 105 then ( start-time ) 106 dup delta-ms d# 100 > ( start-time reached? ) 107 until ( start-time ) 108 drop ( ) 109 ." Timeout leaving DCON mode" cr ( ) 110 scanint-off ( ) 111 ; 112 81 113 : wait-dcon-mode ( -- retry? ) 82 114 mark-time ( start-time ) … … 104 136 dup to vga? ( source ) 105 137 if 106 \ unblank-display 107 d# 50 ms 108 wait-output 109 dcon-load \ Put the DCON in VGA-refreshed mode 110 d# 25 ms \ Ensure that that DCON sees the DCONLOAD high 111 \ display-on 138 wait-output \ Wait for the DCON to reach the scan line 139 " wake" $call-screen \ Enable video signal from SoC 140 d# 5 ms 141 dcon-load \ Put the DCON in VGA-refreshed mode 142 d# 25 ms \ Ensure that that DCON sees the DCONLOAD high 112 143 else 113 144 has-dcon-ram? if … … 116 147 dcon-unload \ Put the DCON in self-refresh mode 117 148 wait-dcon-mode ( retry? ) 118 \ display-off ( retry? )119 149 while ( ) 120 150 \ We got a false ack from the DCON so start over from LOAD state 121 151 dcon-load d# 25 ms ( ) 122 152 repeat ( ) 153 " sleep" $call-screen 123 154 then 124 155 then … … 133 164 ; 134 165 135 : mode@ ( -- mode ) 1 dcon@ ;136 : mode! ( mode -- ) 1 dcon! ;137 : hres! ( hres -- ) 2 dcon! ; \ def: h# 458 d# 1200138 : htotal! ( htotal -- ) 3 dcon! ; \ def: h# 4e8 d# 1256139 : hsync! ( sync -- ) 4 dcon! ; \ def: h# 1808 d# 24,8140 : vres! ( vres -- ) 5 dcon! ; \ def: h# 340 d# 900141 : vtotal! ( htotal -- ) 6 dcon! ; \ def: h# 390 d# 912142 : vsync! ( sync -- ) 7 dcon! ; \ def: h# 403 d# 4,3143 : timeout! ( to -- ) 8 dcon! ; \ def: h# ffff144 : scanint! ( si -- ) 9 dcon! ; \ def: h# 0000145 166 [ifdef] old-way 146 167 : dcon-bright! ( level -- ) d# 10 dcon! ; \ def: h# xxxF … … 261 282 then 262 283 ; 284 285 [ifdef] notdef 286 : test-dcon-freeze-glitch 287 screen-ih remove-output 288 " gvsr" $call-screen 289 begin dcon-freeze dcon-unfreeze key? until key drop 290 screen-ih add-output 291 page 292 ; 293 [then] 263 294 264 295 \ LICENSE_BEGIN
Note: See TracChangeset
for help on using the changeset viewer.
