{"action":"opened","number":1590,"pull_request":{"url":"https://api.github.com/repos/particle-iot/firmware/pulls/1590","id":228958141,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4OTU4MTQx","html_url":"https://github.com/particle-iot/firmware/pull/1590","diff_url":"https://github.com/particle-iot/firmware/pull/1590.diff","patch_url":"https://github.com/particle-iot/firmware/pull/1590.patch","issue_url":"https://api.github.com/repos/particle-iot/firmware/issues/1590","number":1590,"state":"open","locked":false,"title":"Bootloader and Device OS use same HAL driver, Implement mirror button…","user":{"login":"YutingYou","id":7424522,"node_id":"MDQ6VXNlcjc0MjQ1MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/7424522?v=4","gravatar_id":"","url":"https://api.github.com/users/YutingYou","html_url":"https://github.com/YutingYou","followers_url":"https://api.github.com/users/YutingYou/followers","following_url":"https://api.github.com/users/YutingYou/following{/other_user}","gists_url":"https://api.github.com/users/YutingYou/gists{/gist_id}","starred_url":"https://api.github.com/users/YutingYou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YutingYou/subscriptions","organizations_url":"https://api.github.com/users/YutingYou/orgs","repos_url":"https://api.github.com/users/YutingYou/repos","events_url":"https://api.github.com/users/YutingYou/events{/privacy}","received_events_url":"https://api.github.com/users/YutingYou/received_events","type":"User","site_admin":false},"body":"### Problem\r\n1. Bootloader uses Nordic driver for button and led while Device OS uses Particle HAL driver. In this PR, both bootloader and Deivce OS will use  Particle HAL driver.\r\n\r\n2. Implement mirror button and mirror led.\r\n#### Note:\r\nBootloader increases to 32808 Bytes\r\n\r\n```\r\n   text    data     bss     dec     hex filename\r\n  32808     812    6856   40476    9e1c ../build/target/bootloader/platform-14-lto/bootloader.elf\r\n```\r\n\r\n### Steps to Test\r\n#### 1. Mirror Button Test\r\n1. Build and flash bootloader application \r\n2. Build and flash below example app\r\n3. Press button or mirror button to enter listening mode and exit listening mode\r\n4. Observe the console log, it outputs click counter and debounce time.\r\n5. Enter safe mode and DFU mode in the bootloader.\r\n6. Use mirror button D2 to repeat step 5\r\n\r\n#### 2. Mirror LED Test\r\n1. Build and flash bootloader application \r\n2. Build and flash below example app\r\n3. Use three LED and connect them to A3, A4, A5 pin\r\n4. Observe LED state in Device OS and bootloader\r\n\r\n#### 3. Mirror LED unit test\r\nTest application path: /user/tests/wiring/no_fixture/led.cpp\r\nYou should change A7 pin to A3, because A7 doesn't exit on Xenon.\r\n\r\n### Example App\r\n\r\n```c\r\n #include \"application.h\"\r\n\r\nSYSTEM_MODE(MANUAL);\r\nSerial1LogHandler   logHandler(115200, LOG_LEVEL_ALL);\r\n\r\nstatic volatile int counter = 0;\r\n\r\nvoid setup() {\r\n    RGB.mirrorTo(A3, A4, A5, false, true);\r\n\r\n    System.buttonMirror(D2, FALLING, true);\r\n\r\n    System.on(button_click, [](system_event_t ev, int clicks) -> void {\r\n        counter++;\r\n    });\r\n}\r\n\r\nvoid loop() {\r\n    Log.info(\"counter: %d\", counter);\r\n    delay(1000);\r\n}\r\n```\r\n\r\n### References\r\n\r\n[CH20601]\r\n[CH20613]\r\n[CH19813]\r\n\r\n---\r\n\r\n### Completeness\r\n\r\n- [x] User is totes amazing for contributing!\r\n- [x] Contributor has signed CLA ([Info here](https://github.com/spark/firmware/blob/develop/CONTRIBUTING.md))\r\n- [x] Problem and Solution clearly stated\r\n- [x] Run unit/integration/application tests on device\r\n- [ ] Added documentation\r\n","created_at":"2018-11-07T09:02:33Z","updated_at":"2018-11-07T09:02:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/particle-iot/firmware/pulls/1590/commits","review_comments_url":"https://api.github.com/repos/particle-iot/firmware/pulls/1590/comments","review_comment_url":"https://api.github.com/repos/particle-iot/firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/particle-iot/firmware/issues/1590/comments","statuses_url":"https://api.github.com/repos/particle-iot/firmware/statuses/ded25a2fac77d7c7cd6ba6f006d64687e9304fcc","head":{"label":"particle-iot:feature/hal/mirror-button-led","ref":"feature/hal/mirror-button-led","sha":"ded25a2fac77d7c7cd6ba6f006d64687e9304fcc","user":{"login":"particle-iot","id":2348966,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDg5NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/2348966?v=4","gravatar_id":"","url":"https://api.github.com/users/particle-iot","html_url":"https://github.com/particle-iot","followers_url":"https://api.github.com/users/particle-iot/followers","following_url":"https://api.github.com/users/particle-iot/following{/other_user}","gists_url":"https://api.github.com/users/particle-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-iot/subscriptions","organizations_url":"https://api.github.com/users/particle-iot/orgs","repos_url":"https://api.github.com/users/particle-iot/repos","events_url":"https://api.github.com/users/particle-iot/events{/privacy}","received_events_url":"https://api.github.com/users/particle-iot/received_events","type":"Organization","site_admin":false},"repo":{"id":8720130,"node_id":"MDEwOlJlcG9zaXRvcnk4NzIwMTMw","name":"firmware","full_name":"particle-iot/firmware","private":false,"owner":{"login":"particle-iot","id":2348966,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDg5NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/2348966?v=4","gravatar_id":"","url":"https://api.github.com/users/particle-iot","html_url":"https://github.com/particle-iot","followers_url":"https://api.github.com/users/particle-iot/followers","following_url":"https://api.github.com/users/particle-iot/following{/other_user}","gists_url":"https://api.github.com/users/particle-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-iot/subscriptions","organizations_url":"https://api.github.com/users/particle-iot/orgs","repos_url":"https://api.github.com/users/particle-iot/repos","events_url":"https://api.github.com/users/particle-iot/events{/privacy}","received_events_url":"https://api.github.com/users/particle-iot/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/particle-iot/firmware","description":"Device OS (Firmware) for Particle Devices","fork":false,"url":"https://api.github.com/repos/particle-iot/firmware","forks_url":"https://api.github.com/repos/particle-iot/firmware/forks","keys_url":"https://api.github.com/repos/particle-iot/firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/particle-iot/firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/particle-iot/firmware/teams","hooks_url":"https://api.github.com/repos/particle-iot/firmware/hooks","issue_events_url":"https://api.github.com/repos/particle-iot/firmware/issues/events{/number}","events_url":"https://api.github.com/repos/particle-iot/firmware/events","assignees_url":"https://api.github.com/repos/particle-iot/firmware/assignees{/user}","branches_url":"https://api.github.com/repos/particle-iot/firmware/branches{/branch}","tags_url":"https://api.github.com/repos/particle-iot/firmware/tags","blobs_url":"https://api.github.com/repos/particle-iot/firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/particle-iot/firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/particle-iot/firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/particle-iot/firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/particle-iot/firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/particle-iot/firmware/languages","stargazers_url":"https://api.github.com/repos/particle-iot/firmware/stargazers","contributors_url":"https://api.github.com/repos/particle-iot/firmware/contributors","subscribers_url":"https://api.github.com/repos/particle-iot/firmware/subscribers","subscription_url":"https://api.github.com/repos/particle-iot/firmware/subscription","commits_url":"https://api.github.com/repos/particle-iot/firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/particle-iot/firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/particle-iot/firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/particle-iot/firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/particle-iot/firmware/contents/{+path}","compare_url":"https://api.github.com/repos/particle-iot/firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/particle-iot/firmware/merges","archive_url":"https://api.github.com/repos/particle-iot/firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/particle-iot/firmware/downloads","issues_url":"https://api.github.com/repos/particle-iot/firmware/issues{/number}","pulls_url":"https://api.github.com/repos/particle-iot/firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/particle-iot/firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/particle-iot/firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/particle-iot/firmware/labels{/name}","releases_url":"https://api.github.com/repos/particle-iot/firmware/releases{/id}","deployments_url":"https://api.github.com/repos/particle-iot/firmware/deployments","created_at":"2013-03-12T04:42:33Z","updated_at":"2018-11-06T23:09:10Z","pushed_at":"2018-11-07T08:29:26Z","git_url":"git://github.com/particle-iot/firmware.git","ssh_url":"git@github.com:particle-iot/firmware.git","clone_url":"https://github.com/particle-iot/firmware.git","svn_url":"https://github.com/particle-iot/firmware","homepage":"https://www.particle.io/","size":128673,"stargazers_count":763,"watchers_count":763,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":447,"mirror_url":null,"archived":false,"open_issues_count":207,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":447,"open_issues":207,"watchers":763,"default_branch":"develop"}},"base":{"label":"particle-iot:mesh-develop","ref":"mesh-develop","sha":"65041d2542a487055bcfd2e5a89d08115b7ec169","user":{"login":"particle-iot","id":2348966,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDg5NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/2348966?v=4","gravatar_id":"","url":"https://api.github.com/users/particle-iot","html_url":"https://github.com/particle-iot","followers_url":"https://api.github.com/users/particle-iot/followers","following_url":"https://api.github.com/users/particle-iot/following{/other_user}","gists_url":"https://api.github.com/users/particle-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-iot/subscriptions","organizations_url":"https://api.github.com/users/particle-iot/orgs","repos_url":"https://api.github.com/users/particle-iot/repos","events_url":"https://api.github.com/users/particle-iot/events{/privacy}","received_events_url":"https://api.github.com/users/particle-iot/received_events","type":"Organization","site_admin":false},"repo":{"id":8720130,"node_id":"MDEwOlJlcG9zaXRvcnk4NzIwMTMw","name":"firmware","full_name":"particle-iot/firmware","private":false,"owner":{"login":"particle-iot","id":2348966,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDg5NjY=","avatar_url":"https://avatars2.githubusercontent.com/u/2348966?v=4","gravatar_id":"","url":"https://api.github.com/users/particle-iot","html_url":"https://github.com/particle-iot","followers_url":"https://api.github.com/users/particle-iot/followers","following_url":"https://api.github.com/users/particle-iot/following{/other_user}","gists_url":"https://api.github.com/users/particle-iot/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-iot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-iot/subscriptions","organizations_url":"https://api.github.com/users/particle-iot/orgs","repos_url":"https://api.github.com/users/particle-iot/repos","events_url":"https://api.github.com/users/particle-iot/events{/privacy}","received_events_url":"https://api.github.com/users/particle-iot/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/particle-iot/firmware","description":"Device OS (Firmware) for Particle Devices","fork":false,"url":"https://api.github.com/repos/particle-iot/firmware","forks_url":"https://api.github.com/repos/particle-iot/firmware/forks","keys_url":"https://api.github.com/repos/particle-iot/firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/particle-iot/firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/particle-iot/firmware/teams","hooks_url":"https://api.github.com/repos/particle-iot/firmware/hooks","issue_events_url":"https://api.github.com/repos/particle-iot/firmware/issues/events{/number}","events_url":"https://api.github.com/repos/particle-iot/firmware/events","assignees_url":"https://api.github.com/repos/particle-iot/firmware/assignees{/user}","branches_url":"https://api.github.com/repos/particle-iot/firmware/branches{/branch}","tags_url":"https://api.github.com/repos/particle-iot/firmware/tags","blobs_url":"https://api.github.com/repos/particle-iot/firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/particle-iot/firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/particle-iot/firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/particle-iot/firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/particle-iot/firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/particle-iot/firmware/languages","stargazers_url":"https://api.github.com/repos/particle-iot/firmware/stargazers","contributors_url":"https://api.github.com/repos/particle-iot/firmware/contributors","subscribers_url":"https://api.github.com/repos/particle-iot/firmware/subscribers","subscription_url":"https://api.github.com/repos/particle-iot/firmware/subscription","commits_url":"https://api.github.com/repos/particle-iot/firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/particle-iot/firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/particle-iot/firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/particle-iot/firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/particle-iot/firmware/contents/{+path}","compare_url":"https://api.github.com/repos/particle-iot/firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/particle-iot/firmware/merges","archive_url":"https://api.github.com/repos/particle-iot/firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/particle-iot/firmware/downloads","issues_url":"https://api.github.com/repos/particle-iot/firmware/issues{/number}","pulls_url":"https://api.github.com/repos/particle-iot/firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/particle-iot/firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/particle-iot/firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/particle-iot/firmware/labels{/name}","releases_url":"https://api.github.com/repos/particle-iot/firmware/releases{/id}","deployments_url":"https://api.github.com/repos/particle-iot/firmware/deployments","created_at":"2013-03-12T04:42:33Z","updated_at":"2018-11-06T23:09:10Z","pushed_at":"2018-11-07T08:29:26Z","git_url":"git://github.com/particle-iot/firmware.git","ssh_url":"git@github.com:particle-iot/firmware.git","clone_url":"https://github.com/particle-iot/firmware.git","svn_url":"https://github.com/particle-iot/firmware","homepage":"https://www.particle.io/","size":128673,"stargazers_count":763,"watchers_count":763,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":447,"mirror_url":null,"archived":false,"open_issues_count":207,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":447,"open_issues":207,"watchers":763,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/particle-iot/firmware/pulls/1590"},"html":{"href":"https://github.com/particle-iot/firmware/pull/1590"},"issue":{"href":"https://api.github.com/repos/particle-iot/firmware/issues/1590"},"comments":{"href":"https://api.github.com/repos/particle-iot/firmware/issues/1590/comments"},"review_comments":{"href":"https://api.github.com/repos/particle-iot/firmware/pulls/1590/comments"},"review_comment":{"href":"https://api.github.com/repos/particle-iot/firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/particle-iot/firmware/pulls/1590/commits"},"statuses":{"href":"https://api.github.com/repos/particle-iot/firmware/statuses/ded25a2fac77d7c7cd6ba6f006d64687e9304fcc"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":557,"deletions":759,"changed_files":20}}
{"actor":{"display_login":"YutingYou"}}