GitHub PullRequestReviewCommentEvent at 2014-07-04 01:36:25
Repository: firmware
Actor: jiahuang
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/tessel/firmware/pulls/comments/14544849","id":14544849,"diff_hunk":"@@ -258,9 +257,112 @@ int hw_spi_transfer (size_t port, size_t txlen, size_t rxlen, const uint8_t *txb\n   if (SPIx->is_slave) {\n     scu_pinmux(0xF, 1u, PUP_DISABLE | PDN_ENABLE |  MD_EZI | MD_ZI | MD_EHS, FUNC2);  //  SSP0 SSEL0\n   }\n+}\n \n+int hw_spi_transfer (size_t port, size_t txlen, size_t rxlen, const uint8_t *txbuf, uint8_t *rxbuf, uint32_t txref, uint32_t rxref, void (*callback)())\n+{\n   // Tell the runtime to keep the event loop active until this event is done\n+  hw_spi_transfer_helper(port, txlen, rxlen, txbuf, rxbuf, txref, rxref, callback);\n   tm_event_ref(&async_spi_event);\n \n   return 0;\n }\n+\n+struct spi_closure spi_batch_closure = {\n+  .port = 0,\n+};\n+\n+// cycles the CS pin to start a new spi transfer\n+void cycleCS (uint8_t cs_pin) {\n+  hw_digital_write(cs_pin, 1);\n+  hw_digital_write(cs_pin, 0);\n+}\n+\n+// batch spi recursive callback. each call writes another chunk of spi data\n+void hw_spi_transfer_batch_callback () {\n+  tm_event_unref(&async_spi_event);\n+  \n+  spi_batch_closure.chunks_index++;\n+\n+  cycleCS(spi_batch_closure.cspin);","path":"src/hw/hw_spi_async.c","position":43,"original_position":43,"commit_id":"ebdebfcb50cf24a652628608fbb42093bd0b2922","original_commit_id":"ebdebfcb50cf24a652628608fbb42093bd0b2922","user":{"login":"jiahuang","id":577629,"avatar_url":"https://avatars.githubusercontent.com/u/577629?","gravatar_id":"a94e578f348e488d0ce6894ebaaa12a1","url":"https://api.github.com/users/jiahuang","html_url":"https://github.com/jiahuang","followers_url":"https://api.github.com/users/jiahuang/followers","following_url":"https://api.github.com/users/jiahuang/following{/other_user}","gists_url":"https://api.github.com/users/jiahuang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiahuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiahuang/subscriptions","organizations_url":"https://api.github.com/users/jiahuang/orgs","repos_url":"https://api.github.com/users/jiahuang/repos","events_url":"https://api.github.com/users/jiahuang/events{/privacy}","received_events_url":"https://api.github.com/users/jiahuang/received_events","type":"User","site_admin":false},"body":"Doesn't CS already get toggled during the SPI transfer?","created_at":"2014-07-04T01:36:25Z","updated_at":"2014-07-04T01:36:25Z","html_url":"https://github.com/tessel/firmware/pull/38#discussion_r14544849","pull_request_url":"https://api.github.com/repos/tessel/firmware/pulls/38","_links":{"self":{"href":"https://api.github.com/repos/tessel/firmware/pulls/comments/14544849"},"html":{"href":"https://github.com/tessel/firmware/pull/38#discussion_r14544849"},"pull_request":{"href":"https://api.github.com/repos/tessel/firmware/pulls/38"}}},"pull_request":{"url":"https://api.github.com/repos/tessel/firmware/pulls/38","id":17973039,"html_url":"https://github.com/tessel/firmware/pull/38","diff_url":"https://github.com/tessel/firmware/pull/38.diff","patch_url":"https://github.com/tessel/firmware/pull/38.patch","issue_url":"https://api.github.com/repos/tessel/firmware/issues/38","number":38,"state":"open","title":"Nl spi batch","user":{"login":"nlintz","id":1192661,"avatar_url":"https://avatars.githubusercontent.com/u/1192661?","gravatar_id":"1e4566e622059c1dafe6e0f4348db442","url":"https://api.github.com/users/nlintz","html_url":"https://github.com/nlintz","followers_url":"https://api.github.com/users/nlintz/followers","following_url":"https://api.github.com/users/nlintz/following{/other_user}","gists_url":"https://api.github.com/users/nlintz/gists{/gist_id}","starred_url":"https://api.github.com/users/nlintz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlintz/subscriptions","organizations_url":"https://api.github.com/users/nlintz/orgs","repos_url":"https://api.github.com/users/nlintz/repos","events_url":"https://api.github.com/users/nlintz/events{/privacy}","received_events_url":"https://api.github.com/users/nlintz/received_events","type":"User","site_admin":false},"body":"Implemented spi batch\r\n\r\nreviewed by: @tcr @jiahuang @tcr @johnnyman727 ","created_at":"2014-07-03T23:03:56Z","updated_at":"2014-07-04T01:36:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1a4e8af12e7315ac4bea71a72904541bb2d1a5b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tessel/firmware/pulls/38/commits","review_comments_url":"https://api.github.com/repos/tessel/firmware/pulls/38/comments","review_comment_url":"https://api.github.com/repos/tessel/firmware/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tessel/firmware/issues/38/comments","statuses_url":"https://api.github.com/repos/tessel/firmware/statuses/ebdebfcb50cf24a652628608fbb42093bd0b2922","head":{"label":"tessel:nl-spi-batch","ref":"nl-spi-batch","sha":"ebdebfcb50cf24a652628608fbb42093bd0b2922","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?","gravatar_id":"9c6fed6c1f75a3051ddf064b9a91c841","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":20428146,"name":"firmware","full_name":"tessel/firmware","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?","gravatar_id":"9c6fed6c1f75a3051ddf064b9a91c841","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/firmware","description":"Tessel Firmware","fork":false,"url":"https://api.github.com/repos/tessel/firmware","forks_url":"https://api.github.com/repos/tessel/firmware/forks","keys_url":"https://api.github.com/repos/tessel/firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/firmware/teams","hooks_url":"https://api.github.com/repos/tessel/firmware/hooks","issue_events_url":"https://api.github.com/repos/tessel/firmware/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/firmware/events","assignees_url":"https://api.github.com/repos/tessel/firmware/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/firmware/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/firmware/tags","blobs_url":"https://api.github.com/repos/tessel/firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/firmware/languages","stargazers_url":"https://api.github.com/repos/tessel/firmware/stargazers","contributors_url":"https://api.github.com/repos/tessel/firmware/contributors","subscribers_url":"https://api.github.com/repos/tessel/firmware/subscribers","subscription_url":"https://api.github.com/repos/tessel/firmware/subscription","commits_url":"https://api.github.com/repos/tessel/firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/firmware/issues/comments/{number}","contents_url":"https://api.github.com/repos/tessel/firmware/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/firmware/merges","archive_url":"https://api.github.com/repos/tessel/firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/firmware/downloads","issues_url":"https://api.github.com/repos/tessel/firmware/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/firmware/labels{/name}","releases_url":"https://api.github.com/repos/tessel/firmware/releases{/id}","created_at":"2014-06-03T03:16:14Z","updated_at":"2014-06-28T07:41:19Z","pushed_at":"2014-07-04T01:20:09Z","git_url":"git://github.com/tessel/firmware.git","ssh_url":"git@github.com:tessel/firmware.git","clone_url":"https://github.com/tessel/firmware.git","svn_url":"https://github.com/tessel/firmware","homepage":null,"size":2441,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":12,"default_branch":"master"}},"base":{"label":"tessel:master","ref":"master","sha":"58b5cd01abdd1a0529e080a5024dd5ba1ee0c8ba","user":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?","gravatar_id":"9c6fed6c1f75a3051ddf064b9a91c841","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"repo":{"id":20428146,"name":"firmware","full_name":"tessel/firmware","owner":{"login":"tessel","id":5573563,"avatar_url":"https://avatars.githubusercontent.com/u/5573563?","gravatar_id":"9c6fed6c1f75a3051ddf064b9a91c841","url":"https://api.github.com/users/tessel","html_url":"https://github.com/tessel","followers_url":"https://api.github.com/users/tessel/followers","following_url":"https://api.github.com/users/tessel/following{/other_user}","gists_url":"https://api.github.com/users/tessel/gists{/gist_id}","starred_url":"https://api.github.com/users/tessel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tessel/subscriptions","organizations_url":"https://api.github.com/users/tessel/orgs","repos_url":"https://api.github.com/users/tessel/repos","events_url":"https://api.github.com/users/tessel/events{/privacy}","received_events_url":"https://api.github.com/users/tessel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tessel/firmware","description":"Tessel Firmware","fork":false,"url":"https://api.github.com/repos/tessel/firmware","forks_url":"https://api.github.com/repos/tessel/firmware/forks","keys_url":"https://api.github.com/repos/tessel/firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tessel/firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tessel/firmware/teams","hooks_url":"https://api.github.com/repos/tessel/firmware/hooks","issue_events_url":"https://api.github.com/repos/tessel/firmware/issues/events{/number}","events_url":"https://api.github.com/repos/tessel/firmware/events","assignees_url":"https://api.github.com/repos/tessel/firmware/assignees{/user}","branches_url":"https://api.github.com/repos/tessel/firmware/branches{/branch}","tags_url":"https://api.github.com/repos/tessel/firmware/tags","blobs_url":"https://api.github.com/repos/tessel/firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tessel/firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tessel/firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/tessel/firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tessel/firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/tessel/firmware/languages","stargazers_url":"https://api.github.com/repos/tessel/firmware/stargazers","contributors_url":"https://api.github.com/repos/tessel/firmware/contributors","subscribers_url":"https://api.github.com/repos/tessel/firmware/subscribers","subscription_url":"https://api.github.com/repos/tessel/firmware/subscription","commits_url":"https://api.github.com/repos/tessel/firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/tessel/firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/tessel/firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/tessel/firmware/issues/comments/{number}","contents_url":"https://api.github.com/repos/tessel/firmware/contents/{+path}","compare_url":"https://api.github.com/repos/tessel/firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tessel/firmware/merges","archive_url":"https://api.github.com/repos/tessel/firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tessel/firmware/downloads","issues_url":"https://api.github.com/repos/tessel/firmware/issues{/number}","pulls_url":"https://api.github.com/repos/tessel/firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/tessel/firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/tessel/firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tessel/firmware/labels{/name}","releases_url":"https://api.github.com/repos/tessel/firmware/releases{/id}","created_at":"2014-06-03T03:16:14Z","updated_at":"2014-06-28T07:41:19Z","pushed_at":"2014-07-04T01:20:09Z","git_url":"git://github.com/tessel/firmware.git","ssh_url":"git@github.com:tessel/firmware.git","clone_url":"https://github.com/tessel/firmware.git","svn_url":"https://github.com/tessel/firmware","homepage":null,"size":2441,"stargazers_count":12,"watchers_count":12,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tessel/firmware/pulls/38"},"html":{"href":"https://github.com/tessel/firmware/pull/38"},"issue":{"href":"https://api.github.com/repos/tessel/firmware/issues/38"},"comments":{"href":"https://api.github.com/repos/tessel/firmware/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/tessel/firmware/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/tessel/firmware/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tessel/firmware/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/tessel/firmware/statuses/ebdebfcb50cf24a652628608fbb42093bd0b2922"}}}}