{"id":16135101,"url":"https://github.com/mingdonghu/ring_fifo_module","last_synced_at":"2025-04-06T15:52:30.438Z","repository":{"id":169243630,"uuid":"627491994","full_name":"mingdonghu/ring_fifo_module","owner":"mingdonghu","description":"通用化的环形队列模块C接口实现","archived":false,"fork":false,"pushed_at":"2023-04-14T14:03:47.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T21:49:48.411Z","etag":null,"topics":["fifo-queue"],"latest_commit_sha":null,"homepage":"https://www.yuque.com/mingdonghu/embediot/tenrgz?singleDoc# 《环形队列的原理和C语言实现》","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mingdonghu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-13T15:20:19.000Z","updated_at":"2023-04-13T15:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"33fc1742-b0d3-4bbd-87ff-23a1ee4a7bd8","html_url":"https://github.com/mingdonghu/ring_fifo_module","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"74a82c0a763740323777ffbef8a11e655dfa2ba9"},"previous_names":["mingdonghu/ring_fifo_module"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingdonghu%2Fring_fifo_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingdonghu%2Fring_fifo_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingdonghu%2Fring_fifo_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mingdonghu%2Fring_fifo_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mingdonghu","download_url":"https://codeload.github.com/mingdonghu/ring_fifo_module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509164,"owners_count":20950233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fifo-queue"],"created_at":"2024-10-09T23:05:17.535Z","updated_at":"2025-04-06T15:52:30.418Z","avatar_url":"https://github.com/mingdonghu.png","language":"C","readme":"# ring fifo\n\u003e 通用化的环形队列模块,特点如下：\n- 多平台支持(MCU/RTOS/Linux/Windows)\n- 支持C99,支持C/C++编译器编译\n- 支持动态/静态分配队列的内存空间\n- 支持缓冲数据类型宏配置\n\n## 1.下载\n``` bash\ngit clone https://github.com/mingdonghu/ring_fifo_module.git\n```\n## 2.编译与运行示例\n### 方式1：使用make工具\n``` bash\nmake\nsudo chmod +x test\n./test\n```\n### 方式2：使用VScode工具\n- 第一步，开发主机需要提前安装VScode 编译器和相应的C/C++插件以及支持C/C++语言的编译器(MSVC/GCC/MingW)\n- 第二步，配置`.vscode/`目录下的task.json和launch.json文件\n\n## 3.示例代码\n```c\n#include \"ring_fifo.h\"\n#include \u003cstdio.h\u003e\n\nint main(int argc, char const *argv[]) {\n  p_ring_fifo_t p_ring_fifo = ring_fifo_create();\n  if (p_ring_fifo == NULL) {\n    printf(\"ring_fifo_create failed\\n\");\n    return -1;\n  }\n  printf(\"ring_fifo_create success\\n\");\n\n  for (int i = 0; i \u003c 50; i++) {\n    int ret = ring_fifo_write(p_ring_fifo, (data_t)i);\n    if (ret != 0) {\n      printf(\"ring_fifo_write failed\\n\");\n      return -1;\n    }\n    printf(\"write data = %d\\n\", p_ring_fifo-\u003edata_buf[i]);\n  }\n  printf(\"--------------------\\n\");\n  \n  data_t data_from_ringfifo = 0;\n  for (int i = 0; i \u003c 50; i++) {\n    int ret = ring_fifo_read(p_ring_fifo, \u0026data_from_ringfifo);\n    if (ret != 0) {\n      printf(\"ring_fifo_read failed\\n\");\n      return -1;\n    }\n    printf(\"read data = %d\\n\", data_from_ringfifo);\n  }\n\n  int ret = ring_fifo_destroy(p_ring_fifo);\n  if (ret != 0) {\n    printf(\"ring_fifo_destroy failed\\n\");\n    return -1;\n  }\n  printf(\"ring_fifo_destroy success\\n\");\n\n  return 0;\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingdonghu%2Fring_fifo_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingdonghu%2Fring_fifo_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingdonghu%2Fring_fifo_module/lists"}