main.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. PROJECT = "test"
  2. VERSION = "1.0.0"
  3. log.style(1)
  4. log.info("main", PROJECT, VERSION)
  5. local coreall = {
  6. "adc",
  7. "audio",
  8. "bit64",
  9. "camera",
  10. "can",
  11. "cc",
  12. "codec",
  13. "crypto",
  14. "dac",
  15. "eink",
  16. "ercoap",
  17. "errDump",
  18. "fastlz",
  19. "fatfs",
  20. "fonts",
  21. "fota",
  22. "fs",
  23. "fskv",
  24. "ftp",
  25. "gmssl",
  26. "gpio",
  27. "gtfont",
  28. "hmeta",
  29. "ht1621",
  30. "http",
  31. "httpsrv",
  32. "i2c",
  33. "i2s",
  34. "iconv",
  35. "io",
  36. "ioqueue",
  37. "iotauth",
  38. "iperf",
  39. "ir",
  40. "json",
  41. "keyboard",
  42. "lcd",
  43. "lcdseg",
  44. "libcoap",
  45. "libgnss",
  46. "little_flash",
  47. "log",
  48. "lora",
  49. "lora2",
  50. "lvgl",
  51. "max30102",
  52. "mcu",
  53. "miniz",
  54. "mlx90640",
  55. "mobile",
  56. "mqtt",
  57. "nes",
  58. "netdrv",
  59. "onewire",
  60. "os",
  61. "otp",
  62. "pack",
  63. "pm",
  64. "protobuf",
  65. "pwm",
  66. "repl",
  67. "rsa",
  68. "rtc",
  69. "rtos",
  70. "sdio",
  71. "sfd",
  72. "sfud",
  73. "sms",
  74. "socket",
  75. "softkb",
  76. "spi",
  77. "statem",
  78. "string",
  79. "sys",
  80. "sysplus",
  81. "timer",
  82. "tp",
  83. "u8g2",
  84. "uart",
  85. "w5500",
  86. "wdt",
  87. "websocket",
  88. "wlan",
  89. "xxtea",
  90. "yhm27xx",
  91. "ymodem",
  92. "zbuff"
  93. }
  94. local moduleall = {}
  95. local function trim(s)
  96. return (s:gsub("^%s*(.-)%s*$", "%1"))
  97. end
  98. local function contains(arr, val)
  99. for _, v in ipairs(arr) do
  100. if v == val then
  101. return true
  102. end
  103. end
  104. return false
  105. end
  106. local function getmoduleall()
  107. local s1
  108. for k, v in pairs(_G) do
  109. s1 = trim(k)
  110. table.insert(moduleall,s1)
  111. end
  112. end
  113. local function getcorelist()
  114. local s1,s3
  115. local bn = 0
  116. for _, s1 in ipairs(coreall) do
  117. bn = 16 - #s1
  118. s3 = s1 .. string.rep(" ", bn)
  119. if contains(moduleall, s1) then
  120. s3 = s3 .. "YES"
  121. else
  122. s3 = s3 .. "NOT"
  123. end
  124. log.info(s3)
  125. end
  126. end
  127. local function task1()
  128. log.info("task1 ")
  129. local sid = 0
  130. sys.wait(1000)
  131. while true do
  132. if sid == 0 then
  133. getmoduleall()
  134. elseif sid == 1 then
  135. getcorelist()
  136. end
  137. sid = sid + 1
  138. log.info("sid: ", sid)
  139. if sid < 3 then
  140. sys.wait(1000)
  141. else
  142. sys.wait(100000)
  143. end
  144. end
  145. end
  146. sysplus.taskInitEx(task1, "corelib")
  147. sys.run()