{"action":"created","comment":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/29997467","id":29997467,"diff_hunk":"@@ -486,6 +502,135 @@ uint8_t SPIOutput::P9813CreateFlag(uint8_t red, uint8_t green, uint8_t blue) {\n   return ~flag;\n }\n \n+\n+void SPIOutput::IndividualAPA102Control(const DmxBuffer &buffer) {\n+  // some detailed information on the protocol:\n+  // https://cpldcpu.wordpress.com/2014/11/30/understanding-the-apa102-superled/\n+  // Data-Struct\n+  // StartFrame: 4Byte = 32Bits zeros (APA102_START_FRAME_BYTES)\n+  // LEDFrame: 1Byte FF ; 3Byte color info (Blue, Green, Red)\n+  // EndFrame: (n/2)bits; n = pixel_count\n+\n+  // latch_bytes = EndFrame ??\n+  const uint8_t latch_bytes = CalculateAPA102LatchBytes(m_pixel_count);\n+  // OLA_INFO << \"latch_bytes \" << static_cast<int>(latch_bytes);\n+\n+  // calculate dmx-start-address\n+  const unsigned int first_slot = m_start_address - 1;  // 0 offset\n+  // OLA_INFO << \"first_slot \" << static_cast<int>(first_slot);\n+\n+  // only do something if minimum 1pixel can be updated..\n+  if (buffer.Size() - first_slot < APA102_SLOTS_PER_PIXEL) {\n+    // not even 3 bytes of data, don't bother updating\n+    return;\n+  }\n+\n+  // We always check out the entire string length, even if we only have data\n+  // for part of it\n+  const unsigned int output_length = APA102_START_FRAME_BYTES +\n+                                (m_pixel_count * APA102_SPI_BYTES_PER_PIXEL);\n+  // OLA_INFO << \"output_length \" << static_cast<int>(output_length);\n+  uint8_t *output = m_backend->Checkout(m_output_number, output_length,\n+                                        latch_bytes);\n+  // only update spi data if possible\n+  if (!output)","path":"plugins/spi/SPIOutput.cpp","position":83,"original_position":83,"commit_id":"5b891ac0b5ece3495a7e8c4ecd37b1be9a73606f","original_commit_id":"5b891ac0b5ece3495a7e8c4ecd37b1be9a73606f","user":{"login":"peternewman","id":6216436,"avatar_url":"https://avatars.githubusercontent.com/u/6216436?v=3","gravatar_id":"","url":"https://api.github.com/users/peternewman","html_url":"https://github.com/peternewman","followers_url":"https://api.github.com/users/peternewman/followers","following_url":"https://api.github.com/users/peternewman/following{/other_user}","gists_url":"https://api.github.com/users/peternewman/gists{/gist_id}","starred_url":"https://api.github.com/users/peternewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternewman/subscriptions","organizations_url":"https://api.github.com/users/peternewman/orgs","repos_url":"https://api.github.com/users/peternewman/repos","events_url":"https://api.github.com/users/peternewman/events{/privacy}","received_events_url":"https://api.github.com/users/peternewman/received_events","type":"User","site_admin":false},"body":"Can you add { } brackets around the return, so we don't have a dangling statement.","created_at":"2015-05-10T00:13:02Z","updated_at":"2015-05-10T00:13:02Z","html_url":"https://github.com/OpenLightingProject/ola/pull/722#discussion_r29997467","pull_request_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722","_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/29997467"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/722#discussion_r29997467"},"pull_request":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722"}}},"pull_request":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722","id":34388803,"html_url":"https://github.com/OpenLightingProject/ola/pull/722","diff_url":"https://github.com/OpenLightingProject/ola/pull/722.diff","patch_url":"https://github.com/OpenLightingProject/ola/pull/722.patch","issue_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/722","number":722,"state":"open","locked":false,"title":"SPI Plugin - added APA102","user":{"login":"s-light","id":1340319,"avatar_url":"https://avatars.githubusercontent.com/u/1340319?v=3","gravatar_id":"","url":"https://api.github.com/users/s-light","html_url":"https://github.com/s-light","followers_url":"https://api.github.com/users/s-light/followers","following_url":"https://api.github.com/users/s-light/following{/other_user}","gists_url":"https://api.github.com/users/s-light/gists{/gist_id}","starred_url":"https://api.github.com/users/s-light/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-light/subscriptions","organizations_url":"https://api.github.com/users/s-light/orgs","repos_url":"https://api.github.com/users/s-light/repos","events_url":"https://api.github.com/users/s-light/events{/privacy}","received_events_url":"https://api.github.com/users/s-light/received_events","type":"User","site_admin":false},"body":"basic functionality is working. (mainly copied the P9813)\r\nTested with RPi and LED-Strip:\r\nthere is some strange behavior of the first led-\r\nit continuously shines green.. but if i check with an osci the data seems correct...\r\nadditional sometimes there seems to be noise on the datalines (leds are flickering)\r\neventually this is caused by my level shifter / breadboard setup..\r\nwill have to check this if i get an alternative chip.\r\n\r\non the software site the 'EndFrame' of the protocol is not right. but its working for up to some leds (not tested) -\r\ni want to fix this but i did not get how this can be modified with the current system (i need some help/info for the 'Checkout' function)","created_at":"2015-04-29T17:57:29Z","updated_at":"2015-05-10T00:13:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcde2c34bd25bd08a5ed50882367c5ffff2aba44","assignee":null,"milestone":{"url":"https://api.github.com/repos/OpenLightingProject/ola/milestones/3","html_url":"https://github.com/OpenLightingProject/ola/milestones/0.9.6","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones/3/labels","id":991702,"number":3,"title":"0.9.6","description":"","creator":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":20,"state":"open","created_at":"2015-02-23T17:46:32Z","updated_at":"2015-05-09T23:13:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722/commits","review_comments_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722/comments","review_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/722/comments","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/5b891ac0b5ece3495a7e8c4ecd37b1be9a73606f","head":{"label":"s-light:SPI_APA102","ref":"SPI_APA102","sha":"5b891ac0b5ece3495a7e8c4ecd37b1be9a73606f","user":{"login":"s-light","id":1340319,"avatar_url":"https://avatars.githubusercontent.com/u/1340319?v=3","gravatar_id":"","url":"https://api.github.com/users/s-light","html_url":"https://github.com/s-light","followers_url":"https://api.github.com/users/s-light/followers","following_url":"https://api.github.com/users/s-light/following{/other_user}","gists_url":"https://api.github.com/users/s-light/gists{/gist_id}","starred_url":"https://api.github.com/users/s-light/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-light/subscriptions","organizations_url":"https://api.github.com/users/s-light/orgs","repos_url":"https://api.github.com/users/s-light/repos","events_url":"https://api.github.com/users/s-light/events{/privacy}","received_events_url":"https://api.github.com/users/s-light/received_events","type":"User","site_admin":false},"repo":{"id":34374680,"name":"ola","full_name":"s-light/ola","owner":{"login":"s-light","id":1340319,"avatar_url":"https://avatars.githubusercontent.com/u/1340319?v=3","gravatar_id":"","url":"https://api.github.com/users/s-light","html_url":"https://github.com/s-light","followers_url":"https://api.github.com/users/s-light/followers","following_url":"https://api.github.com/users/s-light/following{/other_user}","gists_url":"https://api.github.com/users/s-light/gists{/gist_id}","starred_url":"https://api.github.com/users/s-light/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-light/subscriptions","organizations_url":"https://api.github.com/users/s-light/orgs","repos_url":"https://api.github.com/users/s-light/repos","events_url":"https://api.github.com/users/s-light/events{/privacy}","received_events_url":"https://api.github.com/users/s-light/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s-light/ola","description":"The Open Lighting Architecture","fork":true,"url":"https://api.github.com/repos/s-light/ola","forks_url":"https://api.github.com/repos/s-light/ola/forks","keys_url":"https://api.github.com/repos/s-light/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s-light/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s-light/ola/teams","hooks_url":"https://api.github.com/repos/s-light/ola/hooks","issue_events_url":"https://api.github.com/repos/s-light/ola/issues/events{/number}","events_url":"https://api.github.com/repos/s-light/ola/events","assignees_url":"https://api.github.com/repos/s-light/ola/assignees{/user}","branches_url":"https://api.github.com/repos/s-light/ola/branches{/branch}","tags_url":"https://api.github.com/repos/s-light/ola/tags","blobs_url":"https://api.github.com/repos/s-light/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s-light/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s-light/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/s-light/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s-light/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/s-light/ola/languages","stargazers_url":"https://api.github.com/repos/s-light/ola/stargazers","contributors_url":"https://api.github.com/repos/s-light/ola/contributors","subscribers_url":"https://api.github.com/repos/s-light/ola/subscribers","subscription_url":"https://api.github.com/repos/s-light/ola/subscription","commits_url":"https://api.github.com/repos/s-light/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/s-light/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/s-light/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/s-light/ola/issues/comments{/number}","contents_url":"https://api.github.com/repos/s-light/ola/contents/{+path}","compare_url":"https://api.github.com/repos/s-light/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s-light/ola/merges","archive_url":"https://api.github.com/repos/s-light/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s-light/ola/downloads","issues_url":"https://api.github.com/repos/s-light/ola/issues{/number}","pulls_url":"https://api.github.com/repos/s-light/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/s-light/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/s-light/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s-light/ola/labels{/name}","releases_url":"https://api.github.com/repos/s-light/ola/releases{/id}","created_at":"2015-04-22T07:07:07Z","updated_at":"2015-04-26T00:04:51Z","pushed_at":"2015-05-06T11:53:38Z","git_url":"git://github.com/s-light/ola.git","ssh_url":"git@github.com:s-light/ola.git","clone_url":"https://github.com/s-light/ola.git","svn_url":"https://github.com/s-light/ola","homepage":"https://www.openlighting.org/ola/","size":16499,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenLightingProject:master","ref":"master","sha":"b927fe119534992c360490483d90906afae51345","user":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"repo":{"id":15233168,"name":"ola","full_name":"OpenLightingProject/ola","owner":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenLightingProject/ola","description":"The Open Lighting Architecture","fork":false,"url":"https://api.github.com/repos/OpenLightingProject/ola","forks_url":"https://api.github.com/repos/OpenLightingProject/ola/forks","keys_url":"https://api.github.com/repos/OpenLightingProject/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenLightingProject/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenLightingProject/ola/teams","hooks_url":"https://api.github.com/repos/OpenLightingProject/ola/hooks","issue_events_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/events{/number}","events_url":"https://api.github.com/repos/OpenLightingProject/ola/events","assignees_url":"https://api.github.com/repos/OpenLightingProject/ola/assignees{/user}","branches_url":"https://api.github.com/repos/OpenLightingProject/ola/branches{/branch}","tags_url":"https://api.github.com/repos/OpenLightingProject/ola/tags","blobs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenLightingProject/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenLightingProject/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenLightingProject/ola/languages","stargazers_url":"https://api.github.com/repos/OpenLightingProject/ola/stargazers","contributors_url":"https://api.github.com/repos/OpenLightingProject/ola/contributors","subscribers_url":"https://api.github.com/repos/OpenLightingProject/ola/subscribers","subscription_url":"https://api.github.com/repos/OpenLightingProject/ola/subscription","commits_url":"https://api.github.com/repos/OpenLightingProject/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenLightingProject/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenLightingProject/ola/contents/{+path}","compare_url":"https://api.github.com/repos/OpenLightingProject/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenLightingProject/ola/merges","archive_url":"https://api.github.com/repos/OpenLightingProject/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenLightingProject/ola/downloads","issues_url":"https://api.github.com/repos/OpenLightingProject/ola/issues{/number}","pulls_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenLightingProject/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/labels{/name}","releases_url":"https://api.github.com/repos/OpenLightingProject/ola/releases{/id}","created_at":"2013-12-16T18:06:52Z","updated_at":"2015-05-04T20:48:19Z","pushed_at":"2015-05-08T08:26:00Z","git_url":"git://github.com/OpenLightingProject/ola.git","ssh_url":"git@github.com:OpenLightingProject/ola.git","clone_url":"https://github.com/OpenLightingProject/ola.git","svn_url":"https://github.com/OpenLightingProject/ola","homepage":"https://www.openlighting.org/ola/","size":23861,"stargazers_count":83,"watchers_count":83,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":83,"forks":48,"open_issues":83,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/722"},"issue":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/722"},"comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/722/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/722/commits"},"statuses":{"href":"https://api.github.com/repos/OpenLightingProject/ola/statuses/5b891ac0b5ece3495a7e8c4ecd37b1be9a73606f"}}}}