You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.2 KiB

  1. CMakeLists.txt | 10 ++++------
  2. api/mraa/types.h | 1 +
  3. include/mraa_internal.h | 7 +++++++
  4. src/CMakeLists.txt | 5 +++++
  5. src/i2c/i2c.c | 2 +-
  6. src/mraa.c | 3 +++
  7. src/uart/uart.c | 1 +
  8. 7 files changed, 22 insertions(+), 7 deletions(-)
  9. --- a/CMakeLists.txt
  10. +++ b/CMakeLists.txt
  11. @@ -14,12 +14,7 @@
  12. set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
  13. # Make a version file containing the current version from git.
  14. -include (GetGitRevisionDescription)
  15. -git_describe (VERSION "--tags")
  16. -if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
  17. - message (WARNING " - Install git to compile a production libmraa!")
  18. - set (VERSION "v0.8.1-dirty")
  19. -endif ()
  20. +set (VERSION "v0.9.0")
  21. message (INFO " - libmraa Version ${VERSION}")
  22. @@ -84,8 +79,10 @@
  23. set (X86PLAT ON)
  24. elseif (DETECTED_ARCH MATCHES "arm.*")
  25. set (ARMPLAT ON)
  26. +elseif (DETECTED_ARCH MATCHES "mips")
  27. + set (MIPSPLAT ON)
  28. else ()
  29. - message(FATAL_ERROR "Only x86 and arm platforms currently supported")
  30. + message(FATAL_ERROR "Only x86, arm and mips platforms currently supported")
  31. endif()
  32. if (BUILDSWIGPYTHON)
  33. --- a/api/mraa/types.h
  34. +++ b/api/mraa/types.h
  35. @@ -46,6 +46,7 @@
  36. MRAA_BEAGLEBONE = 6, /**< The different BeagleBone Black Modes B/C */
  37. MRAA_BANANA = 7, /**< Allwinner A20 based Banana Pi and Banana Pro */
  38. MRAA_INTEL_NUC5 = 8, /**< The Intel 5th generations Broadwell NUCs */
  39. + MRAA_MTK_LINKIT = 9, /**< Mediatek MT7688 based Linkit (Air) */
  40. // USB platform extenders start at 256
  41. MRAA_FTDI_FT4222 = 256, /**< FTDI FT4222 USB to i2c bridge */
  42. --- a/include/mraa_internal.h
  43. +++ b/include/mraa_internal.h
  44. @@ -66,6 +66,13 @@
  45. mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board);
  46. /**
  47. + * runtime detect running arm platforms
  48. + *
  49. + * @return mraa_platform_t of the init'ed platform
  50. + */
  51. +mraa_platform_t mraa_mips_platform();
  52. +
  53. +/**
  54. * helper function to check if file exists
  55. *
  56. * @param filename to check
  57. --- a/src/CMakeLists.txt
  58. +++ b/src/CMakeLists.txt
  59. @@ -71,6 +71,11 @@
  60. add_subdirectory(usb)
  61. endif ()
  62. +if (MIPSPLAT)
  63. + add_subdirectory(mips)
  64. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSPLAT=1")
  65. +endif()
  66. +
  67. set (mraa_LIB_SRCS
  68. ${mraa_LIB_PLAT_SRCS_NOAUTO}
  69. # autogenerated version file
  70. --- a/src/i2c/i2c.c
  71. +++ b/src/i2c/i2c.c
  72. @@ -31,9 +31,9 @@
  73. #include <stdlib.h>
  74. #include <unistd.h>
  75. #include <fcntl.h>
  76. +#include <errno.h>
  77. #include <inttypes.h>
  78. #include <sys/types.h>
  79. -#include <sys/errno.h>
  80. #include <sys/ioctl.h>
  81. #include "linux/i2c-dev.h"
  82. --- a/src/mraa.c
  83. +++ b/src/mraa.c
  84. @@ -111,6 +111,9 @@
  85. #elif defined(ARMPLAT)
  86. // Use runtime ARM platform detection
  87. platform_type = mraa_arm_platform();
  88. +#elif MIPSPLAT
  89. + // Use runtime ARM platform detection
  90. + platform_type = mraa_mips_platform();
  91. #else
  92. #error mraa_ARCH NOTHING
  93. #endif
  94. --- a/src/uart/uart.c
  95. +++ b/src/uart/uart.c
  96. @@ -26,6 +26,7 @@
  97. #include <stdlib.h>
  98. #include <sys/stat.h>
  99. +#include <sys/time.h>
  100. #include <unistd.h>
  101. #include <string.h>
  102. #include <termios.h>