{"action":"created","comment":{"url":"https://api.github.com/repos/betaflight/betaflight/pulls/comments/74681659","id":74681659,"diff_hunk":"@@ -165,10 +163,15 @@ uint32_t CDC_Send_DATA(uint8_t *ptrBuffer, uint8_t sendLength)\n     return sendLength;\n }\n \n+uint32_t CDC_Send_FreeBytes(void)\n+{\n+\t/* return the bytes free in the circular buffer */\n+    return ((APP_Rx_ptr_out - APP_Rx_ptr_in) + (-((int)(APP_Rx_ptr_out <= APP_Rx_ptr_in)) & APP_RX_DATA_SIZE)) - 1;","path":"src/main/vcpf4/usbd_cdc_vcp.c","position":29,"original_position":29,"commit_id":"9c303d666930b2407e93d543fe11dcdbe60ad773","original_commit_id":"9c303d666930b2407e93d543fe11dcdbe60ad773","user":{"login":"blckmn","id":6168871,"avatar_url":"https://avatars.githubusercontent.com/u/6168871?v=3","gravatar_id":"","url":"https://api.github.com/users/blckmn","html_url":"https://github.com/blckmn","followers_url":"https://api.github.com/users/blckmn/followers","following_url":"https://api.github.com/users/blckmn/following{/other_user}","gists_url":"https://api.github.com/users/blckmn/gists{/gist_id}","starred_url":"https://api.github.com/users/blckmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blckmn/subscriptions","organizations_url":"https://api.github.com/users/blckmn/orgs","repos_url":"https://api.github.com/users/blckmn/repos","events_url":"https://api.github.com/users/blckmn/events{/privacy}","received_events_url":"https://api.github.com/users/blckmn/received_events","type":"User","site_admin":false},"body":"Performance is important here as this is evaluated on every byte moved into the buffer. This method requires no evaluation step, it has to be more performant.\r\n\r\nReadability is important, but not at the expense of slowing the CPU pipeline down. I'll make a comment to aid in readability.","created_at":"2016-08-13T04:46:55Z","updated_at":"2016-08-13T04:46:55Z","html_url":"https://github.com/betaflight/betaflight/pull/991#discussion_r74681659","pull_request_url":"https://api.github.com/repos/betaflight/betaflight/pulls/991","_links":{"self":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/comments/74681659"},"html":{"href":"https://github.com/betaflight/betaflight/pull/991#discussion_r74681659"},"pull_request":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/991"}}},"pull_request":{"url":"https://api.github.com/repos/betaflight/betaflight/pulls/991","id":81203015,"html_url":"https://github.com/betaflight/betaflight/pull/991","diff_url":"https://github.com/betaflight/betaflight/pull/991.diff","patch_url":"https://github.com/betaflight/betaflight/pull/991.patch","issue_url":"https://api.github.com/repos/betaflight/betaflight/issues/991","number":991,"state":"open","locked":false,"title":"VCP improvements to remove need for delay in serial_cli for F4 targets.","user":{"login":"blckmn","id":6168871,"avatar_url":"https://avatars.githubusercontent.com/u/6168871?v=3","gravatar_id":"","url":"https://api.github.com/users/blckmn","html_url":"https://github.com/blckmn","followers_url":"https://api.github.com/users/blckmn/followers","following_url":"https://api.github.com/users/blckmn/following{/other_user}","gists_url":"https://api.github.com/users/blckmn/gists{/gist_id}","starred_url":"https://api.github.com/users/blckmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blckmn/subscriptions","organizations_url":"https://api.github.com/users/blckmn/orgs","repos_url":"https://api.github.com/users/blckmn/repos","events_url":"https://api.github.com/users/blckmn/events{/privacy}","received_events_url":"https://api.github.com/users/blckmn/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-13T01:23:58Z","updated_at":"2016-08-13T04:46:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d388d78a45ca11eacaec0ab482a14eb566614db2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/betaflight/betaflight/pulls/991/commits","review_comments_url":"https://api.github.com/repos/betaflight/betaflight/pulls/991/comments","review_comment_url":"https://api.github.com/repos/betaflight/betaflight/pulls/comments{/number}","comments_url":"https://api.github.com/repos/betaflight/betaflight/issues/991/comments","statuses_url":"https://api.github.com/repos/betaflight/betaflight/statuses/9c303d666930b2407e93d543fe11dcdbe60ad773","head":{"label":"blckmn:vcp_fix","ref":"vcp_fix","sha":"9c303d666930b2407e93d543fe11dcdbe60ad773","user":{"login":"blckmn","id":6168871,"avatar_url":"https://avatars.githubusercontent.com/u/6168871?v=3","gravatar_id":"","url":"https://api.github.com/users/blckmn","html_url":"https://github.com/blckmn","followers_url":"https://api.github.com/users/blckmn/followers","following_url":"https://api.github.com/users/blckmn/following{/other_user}","gists_url":"https://api.github.com/users/blckmn/gists{/gist_id}","starred_url":"https://api.github.com/users/blckmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blckmn/subscriptions","organizations_url":"https://api.github.com/users/blckmn/orgs","repos_url":"https://api.github.com/users/blckmn/repos","events_url":"https://api.github.com/users/blckmn/events{/privacy}","received_events_url":"https://api.github.com/users/blckmn/received_events","type":"User","site_admin":false},"repo":{"id":55281678,"name":"betaflight","full_name":"blckmn/betaflight","owner":{"login":"blckmn","id":6168871,"avatar_url":"https://avatars.githubusercontent.com/u/6168871?v=3","gravatar_id":"","url":"https://api.github.com/users/blckmn","html_url":"https://github.com/blckmn","followers_url":"https://api.github.com/users/blckmn/followers","following_url":"https://api.github.com/users/blckmn/following{/other_user}","gists_url":"https://api.github.com/users/blckmn/gists{/gist_id}","starred_url":"https://api.github.com/users/blckmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blckmn/subscriptions","organizations_url":"https://api.github.com/users/blckmn/orgs","repos_url":"https://api.github.com/users/blckmn/repos","events_url":"https://api.github.com/users/blckmn/events{/privacy}","received_events_url":"https://api.github.com/users/blckmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blckmn/betaflight","description":"Clean-code version of the baseflight flight controller firmware","fork":true,"url":"https://api.github.com/repos/blckmn/betaflight","forks_url":"https://api.github.com/repos/blckmn/betaflight/forks","keys_url":"https://api.github.com/repos/blckmn/betaflight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blckmn/betaflight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blckmn/betaflight/teams","hooks_url":"https://api.github.com/repos/blckmn/betaflight/hooks","issue_events_url":"https://api.github.com/repos/blckmn/betaflight/issues/events{/number}","events_url":"https://api.github.com/repos/blckmn/betaflight/events","assignees_url":"https://api.github.com/repos/blckmn/betaflight/assignees{/user}","branches_url":"https://api.github.com/repos/blckmn/betaflight/branches{/branch}","tags_url":"https://api.github.com/repos/blckmn/betaflight/tags","blobs_url":"https://api.github.com/repos/blckmn/betaflight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blckmn/betaflight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blckmn/betaflight/git/refs{/sha}","trees_url":"https://api.github.com/repos/blckmn/betaflight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blckmn/betaflight/statuses/{sha}","languages_url":"https://api.github.com/repos/blckmn/betaflight/languages","stargazers_url":"https://api.github.com/repos/blckmn/betaflight/stargazers","contributors_url":"https://api.github.com/repos/blckmn/betaflight/contributors","subscribers_url":"https://api.github.com/repos/blckmn/betaflight/subscribers","subscription_url":"https://api.github.com/repos/blckmn/betaflight/subscription","commits_url":"https://api.github.com/repos/blckmn/betaflight/commits{/sha}","git_commits_url":"https://api.github.com/repos/blckmn/betaflight/git/commits{/sha}","comments_url":"https://api.github.com/repos/blckmn/betaflight/comments{/number}","issue_comment_url":"https://api.github.com/repos/blckmn/betaflight/issues/comments{/number}","contents_url":"https://api.github.com/repos/blckmn/betaflight/contents/{+path}","compare_url":"https://api.github.com/repos/blckmn/betaflight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blckmn/betaflight/merges","archive_url":"https://api.github.com/repos/blckmn/betaflight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blckmn/betaflight/downloads","issues_url":"https://api.github.com/repos/blckmn/betaflight/issues{/number}","pulls_url":"https://api.github.com/repos/blckmn/betaflight/pulls{/number}","milestones_url":"https://api.github.com/repos/blckmn/betaflight/milestones{/number}","notifications_url":"https://api.github.com/repos/blckmn/betaflight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blckmn/betaflight/labels{/name}","releases_url":"https://api.github.com/repos/blckmn/betaflight/releases{/id}","deployments_url":"https://api.github.com/repos/blckmn/betaflight/deployments","created_at":"2016-04-02T06:43:25Z","updated_at":"2016-06-22T05:29:03Z","pushed_at":"2016-08-13T03:38:28Z","git_url":"git://github.com/blckmn/betaflight.git","ssh_url":"git@github.com:blckmn/betaflight.git","clone_url":"https://github.com/blckmn/betaflight.git","svn_url":"https://github.com/blckmn/betaflight","homepage":"http://cleanflight.com","size":75995,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"betaflight:development","ref":"development","sha":"236fb5598a836522a1884f1cc0091790278ce52e","user":{"login":"betaflight","id":19597933,"avatar_url":"https://avatars.githubusercontent.com/u/19597933?v=3","gravatar_id":"","url":"https://api.github.com/users/betaflight","html_url":"https://github.com/betaflight","followers_url":"https://api.github.com/users/betaflight/followers","following_url":"https://api.github.com/users/betaflight/following{/other_user}","gists_url":"https://api.github.com/users/betaflight/gists{/gist_id}","starred_url":"https://api.github.com/users/betaflight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betaflight/subscriptions","organizations_url":"https://api.github.com/users/betaflight/orgs","repos_url":"https://api.github.com/users/betaflight/repos","events_url":"https://api.github.com/users/betaflight/events{/privacy}","received_events_url":"https://api.github.com/users/betaflight/received_events","type":"Organization","site_admin":false},"repo":{"id":37060852,"name":"betaflight","full_name":"betaflight/betaflight","owner":{"login":"betaflight","id":19597933,"avatar_url":"https://avatars.githubusercontent.com/u/19597933?v=3","gravatar_id":"","url":"https://api.github.com/users/betaflight","html_url":"https://github.com/betaflight","followers_url":"https://api.github.com/users/betaflight/followers","following_url":"https://api.github.com/users/betaflight/following{/other_user}","gists_url":"https://api.github.com/users/betaflight/gists{/gist_id}","starred_url":"https://api.github.com/users/betaflight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betaflight/subscriptions","organizations_url":"https://api.github.com/users/betaflight/orgs","repos_url":"https://api.github.com/users/betaflight/repos","events_url":"https://api.github.com/users/betaflight/events{/privacy}","received_events_url":"https://api.github.com/users/betaflight/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/betaflight/betaflight","description":"Betaflight Flight Controller Firmware","fork":true,"url":"https://api.github.com/repos/betaflight/betaflight","forks_url":"https://api.github.com/repos/betaflight/betaflight/forks","keys_url":"https://api.github.com/repos/betaflight/betaflight/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betaflight/betaflight/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betaflight/betaflight/teams","hooks_url":"https://api.github.com/repos/betaflight/betaflight/hooks","issue_events_url":"https://api.github.com/repos/betaflight/betaflight/issues/events{/number}","events_url":"https://api.github.com/repos/betaflight/betaflight/events","assignees_url":"https://api.github.com/repos/betaflight/betaflight/assignees{/user}","branches_url":"https://api.github.com/repos/betaflight/betaflight/branches{/branch}","tags_url":"https://api.github.com/repos/betaflight/betaflight/tags","blobs_url":"https://api.github.com/repos/betaflight/betaflight/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betaflight/betaflight/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betaflight/betaflight/git/refs{/sha}","trees_url":"https://api.github.com/repos/betaflight/betaflight/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betaflight/betaflight/statuses/{sha}","languages_url":"https://api.github.com/repos/betaflight/betaflight/languages","stargazers_url":"https://api.github.com/repos/betaflight/betaflight/stargazers","contributors_url":"https://api.github.com/repos/betaflight/betaflight/contributors","subscribers_url":"https://api.github.com/repos/betaflight/betaflight/subscribers","subscription_url":"https://api.github.com/repos/betaflight/betaflight/subscription","commits_url":"https://api.github.com/repos/betaflight/betaflight/commits{/sha}","git_commits_url":"https://api.github.com/repos/betaflight/betaflight/git/commits{/sha}","comments_url":"https://api.github.com/repos/betaflight/betaflight/comments{/number}","issue_comment_url":"https://api.github.com/repos/betaflight/betaflight/issues/comments{/number}","contents_url":"https://api.github.com/repos/betaflight/betaflight/contents/{+path}","compare_url":"https://api.github.com/repos/betaflight/betaflight/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betaflight/betaflight/merges","archive_url":"https://api.github.com/repos/betaflight/betaflight/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betaflight/betaflight/downloads","issues_url":"https://api.github.com/repos/betaflight/betaflight/issues{/number}","pulls_url":"https://api.github.com/repos/betaflight/betaflight/pulls{/number}","milestones_url":"https://api.github.com/repos/betaflight/betaflight/milestones{/number}","notifications_url":"https://api.github.com/repos/betaflight/betaflight/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betaflight/betaflight/labels{/name}","releases_url":"https://api.github.com/repos/betaflight/betaflight/releases{/id}","deployments_url":"https://api.github.com/repos/betaflight/betaflight/deployments","created_at":"2015-06-08T10:37:44Z","updated_at":"2016-08-12T20:49:20Z","pushed_at":"2016-08-13T04:04:26Z","git_url":"git://github.com/betaflight/betaflight.git","ssh_url":"git@github.com:betaflight/betaflight.git","clone_url":"https://github.com/betaflight/betaflight.git","svn_url":"https://github.com/betaflight/betaflight","homepage":"","size":88145,"stargazers_count":554,"watchers_count":554,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":206,"mirror_url":null,"open_issues_count":65,"forks":206,"open_issues":65,"watchers":554,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/991"},"html":{"href":"https://github.com/betaflight/betaflight/pull/991"},"issue":{"href":"https://api.github.com/repos/betaflight/betaflight/issues/991"},"comments":{"href":"https://api.github.com/repos/betaflight/betaflight/issues/991/comments"},"review_comments":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/991/comments"},"review_comment":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/betaflight/betaflight/pulls/991/commits"},"statuses":{"href":"https://api.github.com/repos/betaflight/betaflight/statuses/9c303d666930b2407e93d543fe11dcdbe60ad773"}}}}
{"actor":{"display_login":"blckmn"}}