{"id":21471796,"url":"https://github.com/brianredbeard/mb-badgepython","last_synced_at":"2025-03-17T07:17:29.405Z","repository":{"id":212743482,"uuid":"609301674","full_name":"brianredbeard/mb-badgepython","owner":"brianredbeard","description":"A private fork of badgePython (pre-release)","archived":false,"fork":false,"pushed_at":"2023-07-26T01:05:52.000Z","size":5461,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"monkeybadge","last_synced_at":"2025-01-23T16:25:16.415Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianredbeard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-03T20:12:39.000Z","updated_at":"2023-12-15T22:34:31.000Z","dependencies_parsed_at":"2023-12-16T01:06:05.377Z","dependency_job_id":null,"html_url":"https://github.com/brianredbeard/mb-badgepython","commit_stats":null,"previous_names":["brianredbeard/mb-badgepython"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmb-badgepython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmb-badgepython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmb-badgepython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianredbeard%2Fmb-badgepython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianredbeard","download_url":"https://codeload.github.com/brianredbeard/mb-badgepython/tar.gz/refs/heads/monkeybadge","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989731,"owners_count":20379648,"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":[],"created_at":"2024-11-23T09:45:41.807Z","updated_at":"2025-03-17T07:17:29.378Z","avatar_url":"https://github.com/brianredbeard.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BadgePython\nExperimental try at making an ESP-IDF v4.0 compatible Badge oriented Micropython firmware\n\n## Supported environments\n* Linux\n* Mac OS\n* (Maybe WSL 2 on Windows?)\n\n## Setup (generic, default configuration)\n1. Clone the repo\n2. Run `make prepare` to clone submodules and install the configuration files\n3. Run `make build` to build the firmware\n4. Run `make flash` to flash the firmware to the device\n\n## Setup (MCH2022 badge app)\n1. Clone the repo\n2. Run `make prepare-mch2022` to clone submodules and install the configuration files\n3. Run `make build` to build the firmware\n4. Install the file `build/badge_firmware.bin` as an app via WebUSB\n\n## Other make commands\n* `make clean` remove existing build files\n* `make erase` completely wipe clean the flash memory of the target device\n* `make flash` program the bootloader, partition table and firmware into the target device\n* `make monitor` to open the serial monitor and debugger application\n* `make menuconfig` to open the SDK menuconfig configuration interface\n\n## Changes over old firmware\n1. python module bridges (e.g. modi2c.c) are now placed inside the driver folder. So the micropython folder stays untouched. You need to register the file for it to be include in the build. More on this later.  \n2. Init in platform.c are now also handled with a generator so you only need to register the init function with cmake. When properly done no dummy init functions are necessary when the driver is disabled.  \n3. All drivers are now compiled with cmake.  \n4. uPy is now based on upstream micropython.    \n5. Bluetooth support is enabled (BLE only for now).    \n\n## Registering a new driver\nA working example can be found in de driver_bus_i2c folder.  \nIn CMakelists.txt added all sources necessary for your driver and requirement for micropython and any other module.  \nIf there is configuration option to disable the driver wrap you srcs in an cmake if statement.  \nTo register the micropython bindings append your files/name as follows:\n \u003eset(EXTMODS \"${EXTMODS}\" \"${mods}\" CACHE INTERNAL \"\")  \n \u003eset(EXTMODS_NAMES \"${EXTMODS_NAMES}\" \"${mod_name}\" CACHE INTERNAL \"\")  \n \n where mods is all the full filepaths containing micropython bindings and mod_name contains the module name\n in the module files all includes not from uPy should be wrapped in #ifndef NO_QSTR \nTo register driver with an init function register as followed:  \n \u003eset(EXTMODS_INIT \"${EXTMODS_INIT}\" \"\\\"${mod_name}\\\"@\\\"${mod_register}\\\"^\" CACHE INTERNAL \"\")  \n \n where mod_register is the register message. This can also be done in a cmake if statement to not register the init/module when the driver is disabled.  \n Registering should be done in the project_include.cmake file. This ensures that the mods are registered before micropython is build.\n\n## Registering builtin python modules\nIn the main folder there are 2 folders for this. Manifests and python_modules. The python_modules folder is collection of modules people can include in their badge build. To include one these modules add to your badge specific manifest. This manifest should be stored in the manifests folder and can be selected in menuconfig.  \nThe $(PORT_DIR) var is linked to the modules folder. The $(BOARD_DIR) is in python_modules/badge_hardware_name folder. This is included in the default manifest. The $(MPY_DIR) var is linked to the uPy component folder. DO NOT store modules in here.\n\n\n## Issues\n1. QSTR regeneration may or may not be supported\n2. uPy configuration options need to be readded.\n3. Expect a lot of bugs ;)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianredbeard%2Fmb-badgepython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianredbeard%2Fmb-badgepython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianredbeard%2Fmb-badgepython/lists"}