{"id":22007760,"url":"https://github.com/rubberduck203/avr-template","last_synced_at":"2026-02-27T23:15:11.715Z","repository":{"id":83177968,"uuid":"106347960","full_name":"rubberduck203/avr-template","owner":"rubberduck203","description":"Template for avr-gcc projects utilizing CppUTest for unit tests","archived":false,"fork":false,"pushed_at":"2019-04-22T20:38:43.000Z","size":20,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T04:34:13.970Z","etag":null,"topics":["avr","avr-gcc","avr-template","cpputest","makefile","template"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","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/rubberduck203.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":"2017-10-10T00:07:36.000Z","updated_at":"2025-03-19T21:07:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"31105f55-7ae1-46d5-a788-a8db1edf1c8c","html_url":"https://github.com/rubberduck203/avr-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubberduck203/avr-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Favr-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Favr-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Favr-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Favr-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubberduck203","download_url":"https://codeload.github.com/rubberduck203/avr-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubberduck203%2Favr-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29918976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["avr","avr-gcc","avr-template","cpputest","makefile","template"],"created_at":"2024-11-30T01:29:12.156Z","updated_at":"2026-02-27T23:15:11.699Z","avatar_url":"https://github.com/rubberduck203.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# avr-template\n\nThis project is a bare bones directory structure and makefiles for working with [avr-gcc][avr-gcc] and [CppUTest][cpputest]. \n\nIt's designed to work with the [rubberduck/avr docker image][avr-docker], but should work on any *nix (or Mac) system, given you've installed avr-gcc, CppUTest, and pkg-config.\nI've not tested on Windows, but I suspect a little bit of work would need to be done in order to make everything work correctly for that OS. (Pull Requests welcome!)\n\nAs of now, the makefiles only support C for the AVR code, but I'd like to add full support for C++ in the future. \n\n[avr-gcc]: http://www.atmel.com/webdoc/avrlibcreferencemanual/overview_1overview_gcc.html\n[cpputest]: http://cpputest.github.io/\n[avr-docker]: https://hub.docker.com/r/rubberduck/avr/\n\n## Getting Started\nTo use, clone this project and copy into a new repository.\n\n```bash\nmkdir newProject\ngit clone https://github.com/rubberduck203/avr-template.git\ncd $_\n```\n\nIn `src/makefile` modify the following lines as appropriate for your device.\n\n```bash\n# name of the resulting program/hex file\nPROGNAME = demo\n# Valid avr-gcc device from this list: \n# http://www.atmel.com/webdoc/avrlibcreferencemanual/index_1supp_devices.html\nDEVICE = atxmega128a1\n# Processor speed (check your datasheet)\nF_CPU = 32000000UL\n```\n\nThe file that holds `main` in the `src` directory must be excluded from the test build,\nor you'll get an error about having multiple mains defined.\nIf you change the name of `Demo.c` you must update this line in `test/makefile` accordingly.\n\n```bash\n# Include all the source from src, except the entry point\nsrcFiles := $(filter-out $(SRC)/Demo.c, $(wildcard $(SRC)/*.c*))\n```\n\nRunning `make` will build and run the tests, then, if successful, compile, link, and generate the *.hex file for your avr device.\n`obj` and `bin` directories are created automatically.\n\n## Supported Make targets\n\n- all: Run tests, build hex file, display size\n- avr: Build hex file, display size\n- size: Display the AVR Memory Usage\n- check: Run tests\n- clean: Delete all files in all `bin` and `obj` directories\n- install: Use AVRDUDE to upload your program to the device\n\n## Mocks\n\nMocks are stored in the `test/mocks` directory and made available as system includes in the test builds.\nThis allows you to reference `\u003cavr/io.h\u003e` and `\u003cutil/delay.h\u003e` in your code under test without referencing the real AVR include files, which is problematic as the avr-asm has some instructions that are unavailable to the regular gcc compiler.\n\nThe `PORT_t` definition in `\u003cavr/io.h\u003e` should be updated according to your particular target device.\nThe real headers for these are available in the avr-gcc installation directory under `avr/include/avr`.\n\nMore mocks may be added in this directory as needed. The test makefile will automatically put them on the path as system (angle bracket) includes.\n\n## Docker-Compose\n\nThere's a docker-compose file in the root of this directory that points to an [AVR toolchain docker image](https://hub.docker.com/r/rubberduck/avr).\nTo use it, run this command.\n\n```bash\ndocker-compose run --rm buildtools\n```\n\n## License\n\nThe template and makefiles are licensed under the [MIT License](LICENSE) so you're free to include the template in your own projects. The MIT License is used in order to limit the licensing restrictions that other licenses would impose on your project. I want you to be free to use this in your own work without worrying about the implications of viral licenses. Just give credit where credit is due and pay it forward.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2Favr-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubberduck203%2Favr-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubberduck203%2Favr-template/lists"}