riotime.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /****************************************************************************
  2. ******* *******
  3. ******* T I M E
  4. ******* *******
  5. ****************************************************************************
  6. Author : Jeremy Rolls
  7. Date :
  8. *
  9. * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. Version : 0.01
  25. Mods
  26. ----------------------------------------------------------------------------
  27. Date By Description
  28. ----------------------------------------------------------------------------
  29. ***************************************************************************/
  30. #ifndef _riotime_h
  31. #define _riotime_h 1
  32. #ifndef lint
  33. #ifdef SCCS
  34. static char *_rio_riotime_h_sccs = "@(#)riotime.h 1.1" ;
  35. #endif
  36. #endif
  37. #define TWO_POWER_FIFTEEN (ushort)32768
  38. #define RioTime() riotime
  39. #define RioTimeAfter(time1,time2) ((ushort)time1 - (ushort)time2) < TWO_POWER_FIFTEEN
  40. #define RioTimePlus(time1,time2) ((ushort)time1 + (ushort)time2)
  41. /**************************************
  42. * Convert a RIO tick (1/10th second)
  43. * into transputer low priority ticks
  44. *************************************/
  45. #define RioTimeToLow(time) (time*(100000 / 64))
  46. #define RioLowToTime(time) ((time*64)/100000)
  47. #define RIOTENTHSECOND (ushort)1
  48. #define RIOSECOND (ushort)(RIOTENTHSECOND * 10)
  49. #endif
  50. /*********** end of file ***********/