{"action":"created","comment":{"url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments/45251300","id":45251300,"diff_hunk":"@@ -104,10 +104,10 @@ static int8_t airspeedADCPin=-1;\n // Private functions\n static void airspeedTask(void *parameters);\n void baro_airspeedGet(BaroAirspeedData *baroAirspeedData, uint32_t *lastSysTime, uint8_t airspeedSensorType, int8_t airspeedADCPin);\n-static void AirspeedSettingsUpdatedCb(UAVObjEvent * ev);\n+static void AirspeedSettingsUpdatedCb(UAVObjEvent * ev, void *ctx, void *obj, int len);","path":"flight/Modules/Airspeed/airspeed.c","position":5,"original_position":5,"commit_id":"83e884ecd3fd91299c9ee54a55f6374dcfad09ff","original_commit_id":"dd228258ddc002d44a8e7d2b1010317f9d545d3e","user":{"login":"mlyle","id":90903,"avatar_url":"https://avatars.githubusercontent.com/u/90903?v=3","gravatar_id":"","url":"https://api.github.com/users/mlyle","html_url":"https://github.com/mlyle","followers_url":"https://api.github.com/users/mlyle/followers","following_url":"https://api.github.com/users/mlyle/following{/other_user}","gists_url":"https://api.github.com/users/mlyle/gists{/gist_id}","starred_url":"https://api.github.com/users/mlyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlyle/subscriptions","organizations_url":"https://api.github.com/users/mlyle/orgs","repos_url":"https://api.github.com/users/mlyle/repos","events_url":"https://api.github.com/users/mlyle/events{/privacy}","received_events_url":"https://api.github.com/users/mlyle/received_events","type":"User","site_admin":false},"body":"It's not the \"default call\".  It's the existing code.  People abuse the callback by putting the entirety of configuration update handler stuff in it (very resource intensive and potentially unsafe in multiple ways).  Then they want to invoke the handler directly because they're not guaranteed that the callback ever gets called or when that first call will happen.  So they pump a \"fake event\" with no details (NULL, NULL, NULL, 0).","created_at":"2015-11-18T19:54:50Z","updated_at":"2015-11-18T19:54:50Z","html_url":"https://github.com/TauLabs/TauLabs/pull/2062#discussion_r45251300","pull_request_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062","_links":{"self":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments/45251300"},"html":{"href":"https://github.com/TauLabs/TauLabs/pull/2062#discussion_r45251300"},"pull_request":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062"}}},"pull_request":{"url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062","id":50888032,"html_url":"https://github.com/TauLabs/TauLabs/pull/2062","diff_url":"https://github.com/TauLabs/TauLabs/pull/2062.diff","patch_url":"https://github.com/TauLabs/TauLabs/pull/2062.patch","issue_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/2062","number":2062,"state":"open","locked":false,"title":"WIP WIP: Event callback drastic refactor","user":{"login":"mlyle","id":90903,"avatar_url":"https://avatars.githubusercontent.com/u/90903?v=3","gravatar_id":"","url":"https://api.github.com/users/mlyle","html_url":"https://github.com/mlyle","followers_url":"https://api.github.com/users/mlyle/followers","following_url":"https://api.github.com/users/mlyle/following{/other_user}","gists_url":"https://api.github.com/users/mlyle/gists{/gist_id}","starred_url":"https://api.github.com/users/mlyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlyle/subscriptions","organizations_url":"https://api.github.com/users/mlyle/orgs","repos_url":"https://api.github.com/users/mlyle/repos","events_url":"https://api.github.com/users/mlyle/events{/privacy}","received_events_url":"https://api.github.com/users/mlyle/received_events","type":"User","site_admin":false},"body":"This is a branch I started work on today.  It is likely to be very controversial.  These are the goals:\r\n\r\n* Eliminate the event system thread.\r\n* Pass the actual UAVOs to callbacks to avoid multiple chained rapid traversals of locks, task switching, and associated overhead.\r\n* Add a \"context pointer\" to callbacks to make it more easily possible to have multiple instances of subsystems and shared implementations of callback code between modules.\r\n\r\nItems I still plan to implement:\r\n\r\n* A dedicated callback stack so that analysis of stack utilization is intuitive.\r\n* ~~Folding the remaining event system role (periodic callbacks) into System module.~~\r\n* Prevention of auto-recursion on callbacks and improvement of callback recursion in general.\r\n\r\nNote that this means that setting UAVOs can directly invoke the callbacks-- perhaps in a very high priority task.  It's my opinion this is better than before, because:\r\n\r\n* Nearly all tasks touch UAVOs\r\n* Nearly all of the callbacks currently trigger accesses to UAVOs, obtaining the giant UAVO lock and excluding higher priority tasks anyways\r\n* The actual task switching / priority inheritance / obtaining of the locks are very expensive operations, so strolling through them less is a win in total execution time.\r\n* Many tasks follow a pattern where they get inputs in the beginning and set outputs in the end; this \"end time\" is when it is best to be delayed.\r\n* It is possible to obtain flight parameters synchronous to when they are generated, e.g. for autotune or logging.  The elimination of dropped and duplicated samples from race conditions in task activation is a big potential win for the system's consistency and flight performance.\r\n\r\nCurrent status:  This works in the simulator.  Further cleanup and the above work is required, along with a fair degree of flight test.","created_at":"2015-11-17T00:29:35Z","updated_at":"2015-11-18T19:54:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46979d407a9d949a854e9a7516b964b14b1932c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062/commits","review_comments_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062/comments","review_comment_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/2062/comments","statuses_url":"https://api.github.com/repos/TauLabs/TauLabs/statuses/83e884ecd3fd91299c9ee54a55f6374dcfad09ff","head":{"label":"mlyle:mpl-flightuavobjwork","ref":"mpl-flightuavobjwork","sha":"83e884ecd3fd91299c9ee54a55f6374dcfad09ff","user":{"login":"mlyle","id":90903,"avatar_url":"https://avatars.githubusercontent.com/u/90903?v=3","gravatar_id":"","url":"https://api.github.com/users/mlyle","html_url":"https://github.com/mlyle","followers_url":"https://api.github.com/users/mlyle/followers","following_url":"https://api.github.com/users/mlyle/following{/other_user}","gists_url":"https://api.github.com/users/mlyle/gists{/gist_id}","starred_url":"https://api.github.com/users/mlyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlyle/subscriptions","organizations_url":"https://api.github.com/users/mlyle/orgs","repos_url":"https://api.github.com/users/mlyle/repos","events_url":"https://api.github.com/users/mlyle/events{/privacy}","received_events_url":"https://api.github.com/users/mlyle/received_events","type":"User","site_admin":false},"repo":{"id":33151589,"name":"taulabs","full_name":"mlyle/taulabs","owner":{"login":"mlyle","id":90903,"avatar_url":"https://avatars.githubusercontent.com/u/90903?v=3","gravatar_id":"","url":"https://api.github.com/users/mlyle","html_url":"https://github.com/mlyle","followers_url":"https://api.github.com/users/mlyle/followers","following_url":"https://api.github.com/users/mlyle/following{/other_user}","gists_url":"https://api.github.com/users/mlyle/gists{/gist_id}","starred_url":"https://api.github.com/users/mlyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlyle/subscriptions","organizations_url":"https://api.github.com/users/mlyle/orgs","repos_url":"https://api.github.com/users/mlyle/repos","events_url":"https://api.github.com/users/mlyle/events{/privacy}","received_events_url":"https://api.github.com/users/mlyle/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mlyle/taulabs","description":"","fork":true,"url":"https://api.github.com/repos/mlyle/taulabs","forks_url":"https://api.github.com/repos/mlyle/taulabs/forks","keys_url":"https://api.github.com/repos/mlyle/taulabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlyle/taulabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlyle/taulabs/teams","hooks_url":"https://api.github.com/repos/mlyle/taulabs/hooks","issue_events_url":"https://api.github.com/repos/mlyle/taulabs/issues/events{/number}","events_url":"https://api.github.com/repos/mlyle/taulabs/events","assignees_url":"https://api.github.com/repos/mlyle/taulabs/assignees{/user}","branches_url":"https://api.github.com/repos/mlyle/taulabs/branches{/branch}","tags_url":"https://api.github.com/repos/mlyle/taulabs/tags","blobs_url":"https://api.github.com/repos/mlyle/taulabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlyle/taulabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlyle/taulabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlyle/taulabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlyle/taulabs/statuses/{sha}","languages_url":"https://api.github.com/repos/mlyle/taulabs/languages","stargazers_url":"https://api.github.com/repos/mlyle/taulabs/stargazers","contributors_url":"https://api.github.com/repos/mlyle/taulabs/contributors","subscribers_url":"https://api.github.com/repos/mlyle/taulabs/subscribers","subscription_url":"https://api.github.com/repos/mlyle/taulabs/subscription","commits_url":"https://api.github.com/repos/mlyle/taulabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlyle/taulabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlyle/taulabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlyle/taulabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlyle/taulabs/contents/{+path}","compare_url":"https://api.github.com/repos/mlyle/taulabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlyle/taulabs/merges","archive_url":"https://api.github.com/repos/mlyle/taulabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlyle/taulabs/downloads","issues_url":"https://api.github.com/repos/mlyle/taulabs/issues{/number}","pulls_url":"https://api.github.com/repos/mlyle/taulabs/pulls{/number}","milestones_url":"https://api.github.com/repos/mlyle/taulabs/milestones{/number}","notifications_url":"https://api.github.com/repos/mlyle/taulabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlyle/taulabs/labels{/name}","releases_url":"https://api.github.com/repos/mlyle/taulabs/releases{/id}","created_at":"2015-03-30T22:24:21Z","updated_at":"2015-10-04T06:32:53Z","pushed_at":"2015-11-18T18:38:15Z","git_url":"git://github.com/mlyle/taulabs.git","ssh_url":"git@github.com:mlyle/taulabs.git","clone_url":"https://github.com/mlyle/taulabs.git","svn_url":"https://github.com/mlyle/taulabs","homepage":"taulabs.org","size":210784,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"TauLabs:next","ref":"next","sha":"ab719fb9c6f82925d53acc7c92ad17ba30aebfc5","user":{"login":"TauLabs","id":3201381,"avatar_url":"https://avatars.githubusercontent.com/u/3201381?v=3","gravatar_id":"","url":"https://api.github.com/users/TauLabs","html_url":"https://github.com/TauLabs","followers_url":"https://api.github.com/users/TauLabs/followers","following_url":"https://api.github.com/users/TauLabs/following{/other_user}","gists_url":"https://api.github.com/users/TauLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/TauLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TauLabs/subscriptions","organizations_url":"https://api.github.com/users/TauLabs/orgs","repos_url":"https://api.github.com/users/TauLabs/repos","events_url":"https://api.github.com/users/TauLabs/events{/privacy}","received_events_url":"https://api.github.com/users/TauLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":6589168,"name":"TauLabs","full_name":"TauLabs/TauLabs","owner":{"login":"TauLabs","id":3201381,"avatar_url":"https://avatars.githubusercontent.com/u/3201381?v=3","gravatar_id":"","url":"https://api.github.com/users/TauLabs","html_url":"https://github.com/TauLabs","followers_url":"https://api.github.com/users/TauLabs/followers","following_url":"https://api.github.com/users/TauLabs/following{/other_user}","gists_url":"https://api.github.com/users/TauLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/TauLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TauLabs/subscriptions","organizations_url":"https://api.github.com/users/TauLabs/orgs","repos_url":"https://api.github.com/users/TauLabs/repos","events_url":"https://api.github.com/users/TauLabs/events{/privacy}","received_events_url":"https://api.github.com/users/TauLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TauLabs/TauLabs","description":"","fork":false,"url":"https://api.github.com/repos/TauLabs/TauLabs","forks_url":"https://api.github.com/repos/TauLabs/TauLabs/forks","keys_url":"https://api.github.com/repos/TauLabs/TauLabs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TauLabs/TauLabs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TauLabs/TauLabs/teams","hooks_url":"https://api.github.com/repos/TauLabs/TauLabs/hooks","issue_events_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/events{/number}","events_url":"https://api.github.com/repos/TauLabs/TauLabs/events","assignees_url":"https://api.github.com/repos/TauLabs/TauLabs/assignees{/user}","branches_url":"https://api.github.com/repos/TauLabs/TauLabs/branches{/branch}","tags_url":"https://api.github.com/repos/TauLabs/TauLabs/tags","blobs_url":"https://api.github.com/repos/TauLabs/TauLabs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TauLabs/TauLabs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TauLabs/TauLabs/git/refs{/sha}","trees_url":"https://api.github.com/repos/TauLabs/TauLabs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TauLabs/TauLabs/statuses/{sha}","languages_url":"https://api.github.com/repos/TauLabs/TauLabs/languages","stargazers_url":"https://api.github.com/repos/TauLabs/TauLabs/stargazers","contributors_url":"https://api.github.com/repos/TauLabs/TauLabs/contributors","subscribers_url":"https://api.github.com/repos/TauLabs/TauLabs/subscribers","subscription_url":"https://api.github.com/repos/TauLabs/TauLabs/subscription","commits_url":"https://api.github.com/repos/TauLabs/TauLabs/commits{/sha}","git_commits_url":"https://api.github.com/repos/TauLabs/TauLabs/git/commits{/sha}","comments_url":"https://api.github.com/repos/TauLabs/TauLabs/comments{/number}","issue_comment_url":"https://api.github.com/repos/TauLabs/TauLabs/issues/comments{/number}","contents_url":"https://api.github.com/repos/TauLabs/TauLabs/contents/{+path}","compare_url":"https://api.github.com/repos/TauLabs/TauLabs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TauLabs/TauLabs/merges","archive_url":"https://api.github.com/repos/TauLabs/TauLabs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TauLabs/TauLabs/downloads","issues_url":"https://api.github.com/repos/TauLabs/TauLabs/issues{/number}","pulls_url":"https://api.github.com/repos/TauLabs/TauLabs/pulls{/number}","milestones_url":"https://api.github.com/repos/TauLabs/TauLabs/milestones{/number}","notifications_url":"https://api.github.com/repos/TauLabs/TauLabs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TauLabs/TauLabs/labels{/name}","releases_url":"https://api.github.com/repos/TauLabs/TauLabs/releases{/id}","created_at":"2012-11-08T01:01:18Z","updated_at":"2015-11-18T13:13:24Z","pushed_at":"2015-11-18T18:38:16Z","git_url":"git://github.com/TauLabs/TauLabs.git","ssh_url":"git@github.com:TauLabs/TauLabs.git","clone_url":"https://github.com/TauLabs/TauLabs.git","svn_url":"https://github.com/TauLabs/TauLabs","homepage":"taulabs.org","size":276273,"stargazers_count":293,"watchers_count":293,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":332,"mirror_url":null,"open_issues_count":279,"forks":332,"open_issues":279,"watchers":293,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062"},"html":{"href":"https://github.com/TauLabs/TauLabs/pull/2062"},"issue":{"href":"https://api.github.com/repos/TauLabs/TauLabs/issues/2062"},"comments":{"href":"https://api.github.com/repos/TauLabs/TauLabs/issues/2062/comments"},"review_comments":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062/comments"},"review_comment":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TauLabs/TauLabs/pulls/2062/commits"},"statuses":{"href":"https://api.github.com/repos/TauLabs/TauLabs/statuses/83e884ecd3fd91299c9ee54a55f6374dcfad09ff"}}}}