{"id":25444137,"url":"https://github.com/aj528/mprintf","last_synced_at":"2026-03-05T00:36:33.094Z","repository":{"id":234852936,"uuid":"789624185","full_name":"AJ528/mprintf","owner":"AJ528","description":"simple no-float 32-bit printf","archived":false,"fork":false,"pushed_at":"2025-01-05T00:45:11.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T01:25:09.767Z","etag":null,"topics":["arm","c","embedded","printf","simple"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AJ528.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":"2024-04-21T04:45:25.000Z","updated_at":"2025-01-05T00:45:15.000Z","dependencies_parsed_at":"2025-01-05T01:32:31.910Z","dependency_job_id":null,"html_url":"https://github.com/AJ528/mprintf","commit_stats":null,"previous_names":["ratman528/mprintf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ528%2Fmprintf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ528%2Fmprintf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ528%2Fmprintf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AJ528%2Fmprintf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AJ528","download_url":"https://codeload.github.com/AJ528/mprintf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239311597,"owners_count":19618013,"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":["arm","c","embedded","printf","simple"],"created_at":"2025-02-17T15:19:42.869Z","updated_at":"2025-11-01T18:30:24.154Z","avatar_url":"https://github.com/AJ528.png","language":"C","readme":"# mprintf\nsimple no-float 32-bit printf\n\n### Status \nDoes everything I need it to. Will fix bugs as I come across them.\n\n### How to use this in an embedded project\n1. Copy `mprint.h` and `mprint.c` into your project\n2. In `mprint.c`, replace all the calls to `putchar()` with the appropriate one for your platform. In embedded projects, this is commonly a function that outputs data over UART.\n3. Once `putchar()` is replaced, the `#include \u003cstdio.h\u003e` line in `mprintf.c` should no longer be needed. Feel free to delete it.\n4. If needed, adjust the newline encoding in `print_newline()`.\n5. Done!\n\n### How to measure the size of this project\n1. copy these files into an embedded project.\n2. compile the project.\n3. measure the size of the `mprintf.o` object file using `size -A`.\n4. the total size is found from summing all relevant sections together.\n\n\n### Details\nCompiles down to 1554 bytes on `arm-none-eabi-gcc` with `-Os` optimizations. This can be made slightly smaller depending on which functions are actually called.\nmprintf is about 450 lines of code (per David A. Wheeler's `SLOCCount`).\n\nMax RAM usage can be controlled by changing the `printf()` buffer size. Shrinking the buffer saves RAM at the cost of decreasing the maximum string length `printf()` can handle.\n\nSupports b, c, d, i, p, s, u, X, x, and % conversion flags, minimum field widths, and 0- +# format flags.\n\nDesigned with Cortex-M microcontrollers in mind, but there's no microcontroller-specific code in the file.\n\nI also included testing using Greatest from https://github.com/silentbicycle/greatest. There's a number of tests that compare mprintf against the standard printf.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj528%2Fmprintf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faj528%2Fmprintf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faj528%2Fmprintf/lists"}