{"id":17193688,"url":"https://github.com/andrei-markeev/ts2c-target-esp-idf","last_synced_at":"2025-04-11T11:07:36.488Z","repository":{"id":57381377,"uuid":"177351463","full_name":"andrei-markeev/ts2c-target-esp-idf","owner":"andrei-markeev","description":"ESP-IDF target for TS2C transpiler","archived":false,"fork":false,"pushed_at":"2019-03-24T11:20:29.000Z","size":9,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T15:13:34.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/andrei-markeev.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}},"created_at":"2019-03-23T23:44:06.000Z","updated_at":"2023-02-26T03:22:24.000Z","dependencies_parsed_at":"2022-09-26T16:50:29.198Z","dependency_job_id":null,"html_url":"https://github.com/andrei-markeev/ts2c-target-esp-idf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-markeev%2Fts2c-target-esp-idf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-markeev%2Fts2c-target-esp-idf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-markeev%2Fts2c-target-esp-idf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei-markeev%2Fts2c-target-esp-idf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrei-markeev","download_url":"https://codeload.github.com/andrei-markeev/ts2c-target-esp-idf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245415164,"owners_count":20611497,"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-10-15T01:44:43.933Z","updated_at":"2025-03-25T07:22:08.204Z","avatar_url":"https://github.com/andrei-markeev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"ESP-IDF target for TS2C transpiler\n==================================\n\nThis projects provides header definitions and tooling for using [TS2C](https://github.com/andrei-markeev/ts2c-target-esp-idf) for ESP-IDF development.\n\n**Status:** Work in progress.\n\nUsage\n-----\n\n```\nnpm install ts2c-target-esp-idf\n```\n\nAfter that, you can create .ts files, `import` all necessary ESP-IDF dependencies and use them:\n\n```ts\nimport { esp_restart } from 'ts2c-target-esp-idf/esp_system.h';\nimport { portTICK_PERIOD_MS, vTaskDelay } from 'ts2c-target-esp-idf/freertos/task.h';\nimport 'ts2c-target-esp-idf/freertos/FreeRTOS.h/index';\n\nconsole.log(\"Hello world!\");\n\nconsole.log(\"Restarting in 10 seconds...\");\nvTaskDelay(10000 / portTICK_PERIOD_MS);\nesp_restart();\n```\n\nWhen your code is ready:\n\n```\nnpm i -g ts2c\nts2c your-file.ts\n```\n\nThat will create corresponding .c file, which you can then compile and flash using ESP-IDF tools.\n\nExample above will be transpiled to the following .c file:\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003cesp_system.h\u003e\n#include \u003cfreertos/task.h\u003e\n#include \u003cfreertos/FreeRTOS.h\u003e\nint main(void) {\n    printf(\"Hello world!\\n\");\n    printf(\"Restarting in 10 seconds...\\n\");\n    vTaskDelay(10000 / portTICK_PERIOD_MS);\n    esp_restart();\n\n    return 0;\n}\n```\n\nMore examples - in [examples](https://github.com/andrei-markeev/ts2c-target-esp-idf/tree/master/examples) folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-markeev%2Fts2c-target-esp-idf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei-markeev%2Fts2c-target-esp-idf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei-markeev%2Fts2c-target-esp-idf/lists"}