Ignore:
Timestamp:
Nov 4, 2010, 5:05:55 PM (9 years ago)
Author:
mulligan
Message:

Back to the drawing board with interrupts ... giving up and implementing
timer 2 instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/ASMInterpret.ml

    r216 r217  
    13041304;;
    13051305
     1306let timer2 status ticks =
     1307  let (tf2,exf2,rclk,tclk),(exen2,tr2,ct2,cp2) = bits_of_byte status.t2con in
     1308    (* Timer2 is enabled *)
     1309    if tr2 then
     1310      (* Counter/interval mode *)
     1311      if ct2 then
     1312        assert false
     1313      (* Capture mode *)
     1314      else if cp2 then
     1315        assert false
     1316      else
     1317        status
     1318    else
     1319      status
     1320;;
     1321
    13061322let timers status ticks =
    13071323  (* DPM: Clock/Timer code follows. *)
     
    15531569    if ea then
    15541570      match (ps,pt1,px1,pt0,px0) with
    1555         (* Check priorities of interrupts *)
    1556         (false,false,false,false,false) ->
    1557           (* Standard priority, so just do regular polling sequence *)
    1558           let status = external0_interrupt status ex0 in
    1559           let status = timer0_interrupt status et0 in
    1560           let status = external1_interrupt status ex1 in
    1561           let status = timer1_interrupt status et1 in
    1562           let status = external_serial_interrupt status es in
    1563             status
    1564       | (true,false,false,false,false) ->
    1565           if status.es_running then
    1566             (* External interrupt is currently running, and cannot be interrupted *)
    1567             status
    1568           else
    1569             (* Standard priority, so just do regular polling sequence *)
    1570             let status = external0_interrupt status ex0 in
    1571             let status = timer0_interrupt status et0 in
    1572             let status = external1_interrupt status ex1 in
    1573             let status = timer1_interrupt status et1 in
    1574             let status = external_serial_interrupt status es in
    1575               status
    1576       | (false,true,false,false,false) ->
    1577           if status.t1i_running then
    1578             (* Timer1 interrupt is currently running, and cannot be interrupted *)
    1579             status
    1580           else
    1581             (* Standard priority, so just do regular polling sequence *)
    1582             let status = external0_interrupt status ex0 in
    1583             let status = timer0_interrupt status et0 in
    1584             let status = external1_interrupt status ex1 in
    1585             let status = timer1_interrupt status et1 in
    1586             let status = external_serial_interrupt status es in
    1587               status
    1588       | (false,false,true,false,false) ->
    1589           if status.e1i_running then
    1590             (* External1 interrupt is currently running, and cannot be interrupted *)
    1591             status
    1592           else
    1593             (* Standard priority, so just do regular polling sequence *)
    1594             let status = external0_interrupt status ex0 in
    1595             let status = timer0_interrupt status et0 in
    1596             let status = external1_interrupt status ex1 in
    1597             let status = timer1_interrupt status et1 in
    1598             let status = external_serial_interrupt status es in
    1599               status
    1600       | (false,false,false,true,false) ->
    1601           if status.t0i_running then
    1602             (* Timer0 interrupt is currently running, and cannot be interrupted *)
    1603             status
    1604           else
    1605             (* Standard priority, so just do regular polling sequence *)
    1606             let status = external0_interrupt status ex0 in
    1607             let status = timer0_interrupt status et0 in
    1608             let status = external1_interrupt status ex1 in
    1609             let status = timer1_interrupt status et1 in
    1610             let status = external_serial_interrupt status es in
    1611               status
    1612       | (false,false,false,false,true) ->
    1613           if status.e0i_running then
    1614             (* External0 interrupt is currently running, and cannot be interrupted *)
    1615             status
    1616           else
    1617             (* Standard priority, so just do regular polling sequence *)
    1618             let status = external0_interrupt status ex0 in
    1619             let status = timer0_interrupt status et0 in
    1620             let status = external1_interrupt status ex1 in
    1621             let status = timer1_interrupt status et1 in
    1622             let status = external_serial_interrupt status es in
    1623               status
    1624       | (false,true,true,false,false) ->
    1625           if status.t1i_running && status.e1i_running then
    1626             (* Cannot have two interrupts with same priority running together *)
    1627             assert false
    1628           else if status.t1i_running || status.e1i_running then
    1629             status
    1630           else
    1631             (* Standard priority, so just do regular polling sequence *)
    1632             let status = external0_interrupt status ex0 in
    1633             let status = timer0_interrupt status et0 in
    1634             let status = external1_interrupt status ex1 in
    1635             let status = timer1_interrupt status et1 in
    1636             let status = external_serial_interrupt status es in
    1637               status
     1571        _ -> assert false
    16381572    else
    16391573      status
Note: See TracChangeset for help on using the changeset viewer.