home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / program / s / timeout1 / ?TimeOut next >
Encoding:
Text File  |  1991-03-27  |  5.0 KB  |  159 lines

  1. Document concerning the module 'TimeOut' v0.04 :
  2. ++++++++++++++++++++++++++++++++++++++++++++++
  3.  
  4.  
  5. ***************************  Copyright Notice  **************************
  6. *                                                                       *
  7. *   The object code and documentation for the 'TimeOut' module are      *
  8. *   the exclusive copyright of John A.M. TYTGAT and are freely          *
  9. *   distributable, provided this notice is left intact and all of the   *
  10. *   files listed below are included, UNALTERED.                         *
  11. *                                                                       *
  12. *************************************************************************
  13.  
  14.  
  15. Files included :
  16. ==============
  17.  
  18. (1) The 'TimeOut' module v1.04 : "TimeOut"
  19. (2) The help file              : "HelpTimeOut"
  20. (3) An example BASIC program   : "ExTimeOut"
  21.  
  22. AIM :
  23. ===
  24.  
  25. 'TimeOut' generates after a certain amounth of time an user-defined error.
  26. This can be very handy in programs where you have to leave an infinite loop
  27. after a certain amounth of time or where there is a time limitation in a
  28. subroutine (ex. in serial communication).
  29. You have to setup a local error routine (see the example BASIC file
  30. "ExTimeOut") checking if it is a TimeOut error or not.
  31.  
  32. How to use it ?
  33. =============
  34.  
  35. The module 'TimeOut' does only support SWI's.  Some characteristics of the
  36. module are :
  37.  
  38. Module title          : 'TimeOut'
  39. Module help           : 'Watchdog timer'
  40. SWI chunk base number : &C0080
  41. Error base number     : &30080
  42. SWI group prefix      : 'TimeOut'
  43.  
  44. Currently defined SWI are :
  45.  
  46. SWI "TimeOut_Duration",R0 TO R0,R1
  47. ----------------------------------
  48.  
  49. DESC. | Reads/Writes the TimeOut duration in csecs
  50. ENTRY | If R0 = 0 Reads the TimeOut duration
  51.         If R0 <> 0 Writes the TimeOut duration
  52. EXIT  | R0 = Old TimeOut duration
  53.         R1 = Time left till the following TimeOut
  54. COMM. | SWI is re-entrant
  55. MODES | All
  56.  
  57. This SWI sets the length of time in csecs between 'SWI "TimeOut_Start"' and
  58. the TimeOut error as long as the program didn't issue a 'SWI "TimeOut_Stop"'.
  59. The default TimeOut duration is 100 csecs.
  60.  
  61. SWI "TimeOut_String",R0
  62. -----------------------
  63.  
  64. DESC. | Sets the TimeOut error string
  65. ENTRY | R0 = Pointer to the TimeOut error string (max. 252 chars)
  66. EXIT  | -
  67. COMM. | SWI is not re-entrant
  68. MODES | All
  69.  
  70. Using this SWI you can change the default TimeOut error string ("TimeOut
  71. runs out of time").
  72.  
  73. SWI "TimeOut_Start"
  74. -------------------
  75.  
  76. DESC. | Starts the TimeOut count-down
  77. ENTRY | -
  78. EXIT  | -
  79. COMM. | SWI is not re-entrant as it disables IRQ
  80. MODES | All
  81.  
  82. Before the actually count-down is started the counter is reseted.
  83.  
  84. SWI "TimeOut_Stop"
  85. ------------------
  86.  
  87. DESC. | Stops the TimeOut count-down
  88. ENTRY | -
  89. EXIT  | -
  90. COMM. | SWI is not re-entrant as it disables IRQ
  91. MODES | All
  92.  
  93. Using this SWI is the only way to prevent the TimeOut error generation.
  94.  
  95. How it works ?
  96. ============
  97.  
  98. Well, the counter is made using the TickerV vector.  If the counter reaches
  99. zero the module uses in the TickerV interrupt routine a SWI "OS_AddCallBack"
  100. to add a CallBack routine where the TimeOut error is generated using a SWI
  101. "OS_GenerateError". I have to use the CallBack principle because it seems it
  102. is not possible to generate an error in a interrupt routine.  Mind if you
  103. switch off the interrupts the counter isn't updated, so the TimeOut module
  104. would not work.
  105.  
  106. Errors :
  107. ======
  108.  
  109. &30080 : User defined, default 'TimeOut' message is "'TimeOut' runs out of time"
  110. &30081 : "Unknown TimeOut SWI operation"
  111. &30082 : "TimeOut error string is too long"
  112.  
  113. Versions :
  114. ========
  115.  
  116. v0.04 : First public domain version
  117.  
  118. BASS :
  119. ====
  120.  
  121. Module 'TimeOut' is released as a BASS product.  BASS (Belgian Archimedes
  122. Software-writers Society) is group of young enthousiast software-writers who
  123. like to write Archimedes public domain programs.  If you want to know more
  124. about us, please feel free to contact us !
  125.  
  126.  
  127. Conditions of use :
  128. =================
  129.  
  130. This software is supplied "as is"; no warranty, express or implied, of the
  131. merchantability of this software or its fitness for any particular purpose
  132. is given.  In no circumstances shall the providers of this software be
  133. liable for any damage, loss of profits, or any indirect or consequential
  134. loss arising out of the use of this software or inability to use this
  135. software.
  136.  
  137. You are free to give this application to anyone you please via any medium,
  138. provided it is delivered with ALL the supplied files, UNALTERED.  You may
  139. NOT sell this software, or use it otherwise for personal gain.  If you wish
  140. to post it on your Bulletin Board or include it in your Shareware library
  141. then that, too, is fine.
  142.  
  143. A large number of hours of work have gone into the production and
  144. maintenance of this module and although I have supplied the application
  145. free, donations will be gratefully received.
  146.  
  147. Please report any bugs you find to me, so that other users may benefit from
  148. improved versions.  I cannot guarantee to fix any bugs, but I will do my
  149. best.
  150.  
  151.  
  152. My address is:
  153.  
  154. John TYTGAT
  155. Brusselbaan 445
  156. B-1600 St.-Pieters-Leeuw
  157. BELGIUM
  158.  
  159. © BASS 1991