{"action":"created","comment":{"url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/comments/52108183","id":52108183,"diff_hunk":"@@ -286,39 +293,35 @@ void send_observations(u8 n, gps_time_t *t, navigation_measurement_t *m)\n }\n \n static BinarySemaphore solution_wakeup_sem;\n-#define tim5_isr Vector108\n-#define NVIC_TIM5_IRQ 50\n-void tim5_isr()\n+static void sol_gpt_cb(GPTDriver *gptd)\n {\n-  CH_IRQ_PROLOGUE();\n+  (void)gptd;\n   chSysLockFromIsr();\n \n   /* Wake up processing thread */\n   chBSemSignalI(&solution_wakeup_sem);\n \n-  timer_clear_flag(TIM5, TIM_SR_UIF);\n \n   chSysUnlockFromIsr();\n-  CH_IRQ_EPILOGUE();\n }\n \n-static void timer_set_period_check(uint32_t timer_peripheral, uint32_t period)\n+static void timer_set_period_check(GPTDriver *gptd, uint32_t period)\n {\n-  __asm__(\"CPSID i;\");\n-  TIM_ARR(timer_peripheral) = period;\n-  uint32_t tmp = TIM_CNT(timer_peripheral);\n+  chSysLock();\n+  gptChangeIntervalI(gptd, period);\n+  u32 tmp = gpt_lld_get_counter(gptd);","path":"src/solution.c","position":55,"original_position":55,"commit_id":"018c37a386081ffbc0204ff758397bce09d85f2b","original_commit_id":"018c37a386081ffbc0204ff758397bce09d85f2b","user":{"login":"jacobmcnamee","id":4461703,"avatar_url":"https://avatars.githubusercontent.com/u/4461703?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobmcnamee","html_url":"https://github.com/jacobmcnamee","followers_url":"https://api.github.com/users/jacobmcnamee/followers","following_url":"https://api.github.com/users/jacobmcnamee/following{/other_user}","gists_url":"https://api.github.com/users/jacobmcnamee/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobmcnamee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobmcnamee/subscriptions","organizations_url":"https://api.github.com/users/jacobmcnamee/orgs","repos_url":"https://api.github.com/users/jacobmcnamee/repos","events_url":"https://api.github.com/users/jacobmcnamee/events{/privacy}","received_events_url":"https://api.github.com/users/jacobmcnamee/received_events","type":"User","site_admin":false},"body":"gptGetCounterX()","created_at":"2016-02-06T22:05:36Z","updated_at":"2016-02-06T22:05:36Z","html_url":"https://github.com/swift-nav/piksi_firmware/pull/607#discussion_r52108183","pull_request_url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607","_links":{"self":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/comments/52108183"},"html":{"href":"https://github.com/swift-nav/piksi_firmware/pull/607#discussion_r52108183"},"pull_request":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607"}}},"pull_request":{"url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607","id":57924031,"html_url":"https://github.com/swift-nav/piksi_firmware/pull/607","diff_url":"https://github.com/swift-nav/piksi_firmware/pull/607.diff","patch_url":"https://github.com/swift-nav/piksi_firmware/pull/607.patch","issue_url":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/607","number":607,"state":"open","locked":false,"title":"Remove libopencm3 dependency.  Use ChibiOS/HAL.","user":{"login":"gsmcmullin","id":466364,"avatar_url":"https://avatars.githubusercontent.com/u/466364?v=3","gravatar_id":"","url":"https://api.github.com/users/gsmcmullin","html_url":"https://github.com/gsmcmullin","followers_url":"https://api.github.com/users/gsmcmullin/followers","following_url":"https://api.github.com/users/gsmcmullin/following{/other_user}","gists_url":"https://api.github.com/users/gsmcmullin/gists{/gist_id}","starred_url":"https://api.github.com/users/gsmcmullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsmcmullin/subscriptions","organizations_url":"https://api.github.com/users/gsmcmullin/orgs","repos_url":"https://api.github.com/users/gsmcmullin/repos","events_url":"https://api.github.com/users/gsmcmullin/events{/privacy}","received_events_url":"https://api.github.com/users/gsmcmullin/received_events","type":"User","site_admin":false},"body":"First cut at replacing libopencm3 and porting to ChibiOS/HAL.  Sorry for one giant commit, but doing it incrementally leaves conflicts between ChibiOS/HAL and libopencm3.\r\n\r\nUse ChibiOS/HAL PAL, EXT, SPI, Serial and GPT driver abstractions for relevant peripherals.\r\n- SPI driver with DMA doesn't work: results in DMA errors (disabled in this PR).\r\n- SPI code is wrapped for chip select handling.\r\n- Serial driver is interrupt driven (no DMA)\r\n- UART code is wrapped for configuration and statistics gathering.\r\n- 3DR radio code reworked to use `usart_chat.h` functions.\r\n\r\nlibopencm3 dependency removed.\r\n- RNG functions use ChibiOS provided STM32 definitions (abstraction is OK).\r\n- WDT functions use ChibiOS provided STM32 definitions (abstraction is OK, newer ChibiOS/HAL provides WDG driver interface).\r\n- Flash routines directly implemented in piksi_firmware (abstraction is OK).\r\n- Reset reason, fallback usart (on error) and fault handling need better abstraction, these do register level access.\r\n\r\n/cc @jacobmcnamee ","created_at":"2016-02-02T00:40:23Z","updated_at":"2016-02-06T22:05:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cd6e94b985b3d39e996a7edccaf4634a87fe966","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607/commits","review_comments_url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607/comments","review_comment_url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/607/comments","statuses_url":"https://api.github.com/repos/swift-nav/piksi_firmware/statuses/018c37a386081ffbc0204ff758397bce09d85f2b","head":{"label":"gsmcmullin:no_libopencm3","ref":"no_libopencm3","sha":"018c37a386081ffbc0204ff758397bce09d85f2b","user":{"login":"gsmcmullin","id":466364,"avatar_url":"https://avatars.githubusercontent.com/u/466364?v=3","gravatar_id":"","url":"https://api.github.com/users/gsmcmullin","html_url":"https://github.com/gsmcmullin","followers_url":"https://api.github.com/users/gsmcmullin/followers","following_url":"https://api.github.com/users/gsmcmullin/following{/other_user}","gists_url":"https://api.github.com/users/gsmcmullin/gists{/gist_id}","starred_url":"https://api.github.com/users/gsmcmullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsmcmullin/subscriptions","organizations_url":"https://api.github.com/users/gsmcmullin/orgs","repos_url":"https://api.github.com/users/gsmcmullin/repos","events_url":"https://api.github.com/users/gsmcmullin/events{/privacy}","received_events_url":"https://api.github.com/users/gsmcmullin/received_events","type":"User","site_admin":false},"repo":{"id":16241768,"name":"piksi_firmware","full_name":"gsmcmullin/piksi_firmware","owner":{"login":"gsmcmullin","id":466364,"avatar_url":"https://avatars.githubusercontent.com/u/466364?v=3","gravatar_id":"","url":"https://api.github.com/users/gsmcmullin","html_url":"https://github.com/gsmcmullin","followers_url":"https://api.github.com/users/gsmcmullin/followers","following_url":"https://api.github.com/users/gsmcmullin/following{/other_user}","gists_url":"https://api.github.com/users/gsmcmullin/gists{/gist_id}","starred_url":"https://api.github.com/users/gsmcmullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsmcmullin/subscriptions","organizations_url":"https://api.github.com/users/gsmcmullin/orgs","repos_url":"https://api.github.com/users/gsmcmullin/repos","events_url":"https://api.github.com/users/gsmcmullin/events{/privacy}","received_events_url":"https://api.github.com/users/gsmcmullin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gsmcmullin/piksi_firmware","description":"Firmware for the Piksi GNSS receiver.","fork":true,"url":"https://api.github.com/repos/gsmcmullin/piksi_firmware","forks_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/forks","keys_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/teams","hooks_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/hooks","issue_events_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/issues/events{/number}","events_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/events","assignees_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/assignees{/user}","branches_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/branches{/branch}","tags_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/tags","blobs_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/languages","stargazers_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/stargazers","contributors_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/contributors","subscribers_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/subscribers","subscription_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/subscription","commits_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/contents/{+path}","compare_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/merges","archive_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/downloads","issues_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/issues{/number}","pulls_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/labels{/name}","releases_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/releases{/id}","deployments_url":"https://api.github.com/repos/gsmcmullin/piksi_firmware/deployments","created_at":"2014-01-25T22:41:13Z","updated_at":"2014-06-19T20:04:55Z","pushed_at":"2016-02-02T00:46:31Z","git_url":"git://github.com/gsmcmullin/piksi_firmware.git","ssh_url":"git@github.com:gsmcmullin/piksi_firmware.git","clone_url":"https://github.com/gsmcmullin/piksi_firmware.git","svn_url":"https://github.com/gsmcmullin/piksi_firmware","homepage":"swift-nav.com","size":3965,"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":"master"}},"base":{"label":"swift-nav:master","ref":"master","sha":"92cee3b91fae164c8898d1b5f07c2195277c3cba","user":{"login":"swift-nav","id":1069835,"avatar_url":"https://avatars.githubusercontent.com/u/1069835?v=3","gravatar_id":"","url":"https://api.github.com/users/swift-nav","html_url":"https://github.com/swift-nav","followers_url":"https://api.github.com/users/swift-nav/followers","following_url":"https://api.github.com/users/swift-nav/following{/other_user}","gists_url":"https://api.github.com/users/swift-nav/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-nav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-nav/subscriptions","organizations_url":"https://api.github.com/users/swift-nav/orgs","repos_url":"https://api.github.com/users/swift-nav/repos","events_url":"https://api.github.com/users/swift-nav/events{/privacy}","received_events_url":"https://api.github.com/users/swift-nav/received_events","type":"Organization","site_admin":false},"repo":{"id":2464156,"name":"piksi_firmware","full_name":"swift-nav/piksi_firmware","owner":{"login":"swift-nav","id":1069835,"avatar_url":"https://avatars.githubusercontent.com/u/1069835?v=3","gravatar_id":"","url":"https://api.github.com/users/swift-nav","html_url":"https://github.com/swift-nav","followers_url":"https://api.github.com/users/swift-nav/followers","following_url":"https://api.github.com/users/swift-nav/following{/other_user}","gists_url":"https://api.github.com/users/swift-nav/gists{/gist_id}","starred_url":"https://api.github.com/users/swift-nav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swift-nav/subscriptions","organizations_url":"https://api.github.com/users/swift-nav/orgs","repos_url":"https://api.github.com/users/swift-nav/repos","events_url":"https://api.github.com/users/swift-nav/events{/privacy}","received_events_url":"https://api.github.com/users/swift-nav/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swift-nav/piksi_firmware","description":"Firmware for the Piksi GNSS receiver.","fork":false,"url":"https://api.github.com/repos/swift-nav/piksi_firmware","forks_url":"https://api.github.com/repos/swift-nav/piksi_firmware/forks","keys_url":"https://api.github.com/repos/swift-nav/piksi_firmware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swift-nav/piksi_firmware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swift-nav/piksi_firmware/teams","hooks_url":"https://api.github.com/repos/swift-nav/piksi_firmware/hooks","issue_events_url":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/events{/number}","events_url":"https://api.github.com/repos/swift-nav/piksi_firmware/events","assignees_url":"https://api.github.com/repos/swift-nav/piksi_firmware/assignees{/user}","branches_url":"https://api.github.com/repos/swift-nav/piksi_firmware/branches{/branch}","tags_url":"https://api.github.com/repos/swift-nav/piksi_firmware/tags","blobs_url":"https://api.github.com/repos/swift-nav/piksi_firmware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swift-nav/piksi_firmware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swift-nav/piksi_firmware/git/refs{/sha}","trees_url":"https://api.github.com/repos/swift-nav/piksi_firmware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swift-nav/piksi_firmware/statuses/{sha}","languages_url":"https://api.github.com/repos/swift-nav/piksi_firmware/languages","stargazers_url":"https://api.github.com/repos/swift-nav/piksi_firmware/stargazers","contributors_url":"https://api.github.com/repos/swift-nav/piksi_firmware/contributors","subscribers_url":"https://api.github.com/repos/swift-nav/piksi_firmware/subscribers","subscription_url":"https://api.github.com/repos/swift-nav/piksi_firmware/subscription","commits_url":"https://api.github.com/repos/swift-nav/piksi_firmware/commits{/sha}","git_commits_url":"https://api.github.com/repos/swift-nav/piksi_firmware/git/commits{/sha}","comments_url":"https://api.github.com/repos/swift-nav/piksi_firmware/comments{/number}","issue_comment_url":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/comments{/number}","contents_url":"https://api.github.com/repos/swift-nav/piksi_firmware/contents/{+path}","compare_url":"https://api.github.com/repos/swift-nav/piksi_firmware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swift-nav/piksi_firmware/merges","archive_url":"https://api.github.com/repos/swift-nav/piksi_firmware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swift-nav/piksi_firmware/downloads","issues_url":"https://api.github.com/repos/swift-nav/piksi_firmware/issues{/number}","pulls_url":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls{/number}","milestones_url":"https://api.github.com/repos/swift-nav/piksi_firmware/milestones{/number}","notifications_url":"https://api.github.com/repos/swift-nav/piksi_firmware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swift-nav/piksi_firmware/labels{/name}","releases_url":"https://api.github.com/repos/swift-nav/piksi_firmware/releases{/id}","deployments_url":"https://api.github.com/repos/swift-nav/piksi_firmware/deployments","created_at":"2011-09-26T23:35:50Z","updated_at":"2016-01-20T03:02:08Z","pushed_at":"2016-02-06T07:06:46Z","git_url":"git://github.com/swift-nav/piksi_firmware.git","ssh_url":"git@github.com:swift-nav/piksi_firmware.git","clone_url":"https://github.com/swift-nav/piksi_firmware.git","svn_url":"https://github.com/swift-nav/piksi_firmware","homepage":"swift-nav.com","size":5413,"stargazers_count":64,"watchers_count":64,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":76,"mirror_url":null,"open_issues_count":113,"forks":76,"open_issues":113,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607"},"html":{"href":"https://github.com/swift-nav/piksi_firmware/pull/607"},"issue":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/607"},"comments":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/issues/607/comments"},"review_comments":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607/comments"},"review_comment":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/pulls/607/commits"},"statuses":{"href":"https://api.github.com/repos/swift-nav/piksi_firmware/statuses/018c37a386081ffbc0204ff758397bce09d85f2b"}}}}