{"id":51544922,"url":"https://github.com/millertechnologyperu/swift-embedded-pebble","last_synced_at":"2026-07-09T17:01:39.937Z","repository":{"id":365351572,"uuid":"1271703906","full_name":"MillerTechnologyPeru/swift-embedded-pebble","owner":"MillerTechnologyPeru","description":"Embedded Swift SDK for Pebble","archived":false,"fork":false,"pushed_at":"2026-06-17T01:15:29.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T02:19:35.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/MillerTechnologyPeru.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-16T23:54:01.000Z","updated_at":"2026-06-17T01:15:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MillerTechnologyPeru/swift-embedded-pebble","commit_stats":null,"previous_names":["millertechnologyperu/swift-embedded-pebble"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MillerTechnologyPeru/swift-embedded-pebble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MillerTechnologyPeru%2Fswift-embedded-pebble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MillerTechnologyPeru%2Fswift-embedded-pebble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MillerTechnologyPeru%2Fswift-embedded-pebble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MillerTechnologyPeru%2Fswift-embedded-pebble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MillerTechnologyPeru","download_url":"https://codeload.github.com/MillerTechnologyPeru/swift-embedded-pebble/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MillerTechnologyPeru%2Fswift-embedded-pebble/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35306717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-07-09T17:01:38.705Z","updated_at":"2026-07-09T17:01:39.913Z","avatar_url":"https://github.com/MillerTechnologyPeru.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-embedded-pebble\n\nA **Hello World** Pebble app for the **Pebble Time 2** (`emery` platform),\nwritten in **Embedded Swift**.\n\n\u003cimg width=\"200\" height=\"228\" alt=\"pebble_screenshot_2026-06-16_22-32-34\" src=\"https://github.com/user-attachments/assets/6d61a0e7-7d18-46cd-aa90-8a6f8d5cd6de\" /\u003e\n\nThe app shows a title, a live counter, and wires up the three right-side\nbuttons (↑ increment, ● reset, ↓ decrement).\n\n## Hardware target\n\n| Watch         | Platform | MCU              | Display          |\n|---------------|----------|------------------|------------------|\n| Pebble Time 2 | `emery`  | SiFli SF32LB52J  | 200×228          |\n|               |          | Cortex-M33 @ 240 MHz | 64-color e-paper |\n\nSwift target triple: `armv8m.main-none-none-eabi`\n\n## Project layout\n\n```\npebble-swift-hello/\n├── package.json               # Pebble app metadata\n├── wscript                    # WAF build (Swift 6.3+ aware)\n├── Makefile                   # Standalone make\n├── include/\n│   ├── pebble.h               # Master SDK header\n│   ├── module.modulemap       # Exposes pebble.h to Swift's C importer\n│   └── pebble/                # gtypes, fonts, graphics, layers, app\n└── src/\n    ├── swift/\n    │   ├── PebbleSDK.swift    # Zero-cost Swift wrappers (InlineArray, borrow accessors)\n    │   └── App.swift          # App logic (@c, InlineArray counter buf, \u0026+/\u0026-)\n    └── c/\n        └── main.c             # C entry: app_main() → swift_app_init()\n```\n\n## Building\n\n### Prerequisites\n\n1. **Swift 6.3+** (6.4 recommended for borrow accessors)\n   ```bash\n   # macOS\n   brew install swift      # or install Xcode 27+\n   # Linux — download from https://swift.org/download/\n   ```\n   Verify target support:\n   ```bash\n   swiftc -enable-experimental-feature Embedded \\\n     -target armv8m.main-none-none-eabi \\\n     -Xcc -mcpu=cortex-m33 -Xcc -mthumb \\\n     /dev/null -o /dev/null 2\u003e\u00261 | head -3\n   ```\n\n2. **`arm-none-eabi-gcc`**\n   ```bash\n   brew install --cask gcc-arm-embedded   # macOS\n   apt install gcc-arm-none-eabi          # Ubuntu/Debian\n   ```\n\n3. **Pebble SDK** (for `.pbw` packaging)\n   ```bash\n   pip install pebble-tool\n   pebble sdk install latest\n   ```\n\n### Standalone compile (no SDK needed)\n\n```bash\n# Compile Swift → ARM object + emit generated C header\nmake\n\n# View the @c-generated C header (swift_app_init declaration)\nmake header\n\n# Type-check with EmbeddedRestrictions warnings surfaced\nmake diagnostics\n\n# Inspect ARM symbols (verify swift_app_init is exported)\nmake symbols\n```\n\n### Full build via pebble-tool\n\n```bash\npebble build --platform emery\npebble install --emulator emery\npebble logs --emulator emery\n```\n\n## Entry point chain\n\n```\nPebbleOS\n  └─► app_main()                      [src/c/main.c]\n        └─► swift_app_init()           [src/swift/App.swift]\n              │  @c(\"swift_app_init\")  ← SE-0495, Swift 6.3\n              │  emits build/PebbleApp-Swift.h for C to #include\n              ├─ window_create()\n              ├─ window_stack_push()\n              ├─ windowLoad()\n              │    ├─ PebbleTextLayer / PebbleLayer wrappers\n              │    ├─ InlineArray\u003c8,CChar\u003e counter buffer (Swift 6.2)\n              │    └─ borrow accessors on rootLayer/bounds (Swift 6.4)\n              └─ app_event_loop()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillertechnologyperu%2Fswift-embedded-pebble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmillertechnologyperu%2Fswift-embedded-pebble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillertechnologyperu%2Fswift-embedded-pebble/lists"}