generate_rtthread_kconfig.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import os
  2. def get_example_list():
  3. path = 'example'
  4. app_list = []
  5. files = os.listdir(path)
  6. for file in files:
  7. file_path = os.path.join(path, file)
  8. if os.path.isdir(file_path):
  9. app_list.append(file)
  10. return app_list
  11. port_sets = ['rtthread_uart',
  12. 'rtthread_artpi',]
  13. chipset_sets = ['artpi_ap6212',
  14. 'csr8910',
  15. 'pts_dongle',
  16. 'common', ]
  17. def get_kconfig_list(type, sets):
  18. for set in sets:
  19. tmp_str = "PKG_ZEPHYR_POLLING_%s_%s" % (type, set.upper())
  20. print("config %s" % tmp_str)
  21. print(" bool \"%s\"" % set)
  22. print("")
  23. print("")
  24. print("")
  25. for set in sets:
  26. tmp_str = "PKG_ZEPHYR_POLLING_%s_%s" % (type, set.upper())
  27. print("default \"%s\" if %s" % (set, tmp_str))
  28. print("")
  29. print("")
  30. print("")
  31. if __name__ == '__main__':
  32. app_sets = get_example_list()
  33. get_kconfig_list("EXAMPLE", app_sets)
  34. get_kconfig_list("CHIPSET", chipset_sets)
  35. get_kconfig_list("PORT", port_sets)