common.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /******************************************************************************
  2. *
  3. * @brief provide header files to be included by all project files.
  4. *
  5. *******************************************************************************/
  6. #ifndef _COMMON_H_
  7. #define _COMMON_H_
  8. #define swap_bytes(ptrWord) *ptrWord = (*ptrWord >>8) | (*ptrWord<<8)
  9. typedef unsigned long dword;
  10. typedef unsigned short word;
  11. /********************************************************************/
  12. /*
  13. * Debug prints ON (#define) or OFF (#undef)
  14. */
  15. #define DEBUG
  16. #define DEBUG_PRINT
  17. /*
  18. * Include the generic CPU header file
  19. */
  20. #include "arm_cm0.h"
  21. /*
  22. * Include the platform specific header file
  23. */
  24. #if (defined(NV32))
  25. #include "NV32_config.h"
  26. #elif (defined(FRDM_NV32M3))
  27. #include "NV32M3_config.h"
  28. #elif (defined(FRDM_NV32M4))
  29. #include "NV32M4_config.h"
  30. #else
  31. #error "No valid board defined"
  32. #endif
  33. /*
  34. * Include the cpu specific header file
  35. */
  36. #if (defined(CPU_NV32))
  37. #include "NV32.h"
  38. #elif (defined(CPU_NV32M3))
  39. #include "NV32M3.h"
  40. #elif (defined(CPU_NV32M4))
  41. #include "NV32M4.h"
  42. #else
  43. #error "No valid CPU defined"
  44. #endif
  45. /*
  46. * Include any toolchain specfic header files
  47. */
  48. #if (defined(__MWERKS__))
  49. #include "mwerks.h"
  50. #elif (defined(__DCC__))
  51. #include "build/wrs/diab.h"
  52. #elif (defined(__ghs__))
  53. #include "build/ghs/ghs.h"
  54. #elif (defined(__GNUC__))
  55. #if (defined(IAR))
  56. #include "build/gnu/gnu.h"
  57. #endif
  58. #elif (defined(IAR))
  59. #include "iar.h"
  60. #elif (defined(KEIL))
  61. #else
  62. #warning "No toolchain specific header included"
  63. #endif
  64. /*
  65. * Include common utilities
  66. */
  67. #define ASSERT(x)
  68. #if (defined(IAR))
  69. #include "intrinsics.h"
  70. #endif
  71. /********************************************************************/
  72. #endif /* _COMMON_H_ */