{"action":"created","comment":{"url":"https://api.github.com/repos/opentx/opentx/pulls/comments/93131190","pull_request_review_id":13653439,"id":93131190,"diff_hunk":"@@ -79,26 +94,177 @@ ISR(USART_RX_vect_N(TLM_USART))\n     telemetryRxBufferCount = 0;\n   }\n   else {\n-    processFrskyTelemetryData(data);\n+    processSerialData(data);\n   }\n \n   cli() ;\n   UCSRB_N(TLM_USART) |= (1 << RXCIE_N(TLM_USART)); // enable Interrupt\n }\n \n-void telemetryPortInit()\n-{\n-#if !defined(SIMU)\n-  RXD_DDR_N(TLM_USART) &= ~(1 << RXD_DDR_PIN_N(TLM_USART));   // set RXD pin as input\n-  RXD_PORT_N(TLM_USART) &= ~(1 << RXD_PORT_PIN_N(TLM_USART)); // disable pullup on RXD pin\n+static void uart_4800(void) {\n+  #undef BAUD\n+  #define BAUD 4800\n+  #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n \n+static void uart_9600(void) {\n   #undef BAUD\n   #define BAUD 9600\n   #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n+\n+static void uart_14400(void) {\n+  #undef BAUD\n+  #define BAUD 14400\n+  #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n \n+static void uart_19200(void) {\n+  #undef BAUD\n+  #define BAUD 19200\n+  #include <util/setbaud.h>\n   UBRRH_N(TLM_USART) = UBRRH_VALUE;\n   UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n   UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n+\n+static void uart_38400(void) {\n+  #undef BAUD\n+  #define BAUD 38400\n+  #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n+\n+static void uart_57600(void) {\n+  #undef BAUD\n+  #define BAUD 57600\n+  #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n+\n+static void uart_58798(void) {\n+  UBRRH_N(TLM_USART) = 0;\n+  UBRRL_N(TLM_USART) = 0x010;\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+}\n+\n+static void uart_76800(void) {\n+  #undef BAUD\n+  #define BAUD 76800\n+  #include <util/setbaud.h>\n+  UBRRH_N(TLM_USART) = UBRRH_VALUE;\n+  UBRRL_N(TLM_USART) = UBRRL_VALUE;\n+#if defined USE_2X\n+  UCSRA_N(TLM_USART) |= (1 << U2X_N(TLM_USART)); // enable double speed operation.\n+#else\n+  UCSRA_N(TLM_USART) &= ~(1 << U2X_N(TLM_USART)); // disable double speed operation.\n+#endif\n+}\n+\n+void telemetryPortInitFromIndex(uint8_t index) {","path":"radio/src/targets/common/avr/telemetry_driver.cpp","position":149,"original_position":149,"commit_id":"be2df0d5fbb1c9923b2cc55c632533c50e3e77a0","original_commit_id":"be2df0d5fbb1c9923b2cc55c632533c50e3e77a0","user":{"login":"bsongis","id":5603504,"avatar_url":"https://avatars.githubusercontent.com/u/5603504?v=3","gravatar_id":"","url":"https://api.github.com/users/bsongis","html_url":"https://github.com/bsongis","followers_url":"https://api.github.com/users/bsongis/followers","following_url":"https://api.github.com/users/bsongis/following{/other_user}","gists_url":"https://api.github.com/users/bsongis/gists{/gist_id}","starred_url":"https://api.github.com/users/bsongis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsongis/subscriptions","organizations_url":"https://api.github.com/users/bsongis/orgs","repos_url":"https://api.github.com/users/bsongis/repos","events_url":"https://api.github.com/users/bsongis/events{/privacy}","received_events_url":"https://api.github.com/users/bsongis/received_events","type":"User","site_admin":false},"body":"Yes I would completely remove the `telemetryPortInit(bauds)` function","created_at":"2016-12-19T22:12:44Z","updated_at":"2016-12-19T22:12:45Z","html_url":"https://github.com/opentx/opentx/pull/4152#discussion_r93131190","pull_request_url":"https://api.github.com/repos/opentx/opentx/pulls/4152","_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments/93131190"},"html":{"href":"https://github.com/opentx/opentx/pull/4152#discussion_r93131190"},"pull_request":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4152"}}},"pull_request":{"url":"https://api.github.com/repos/opentx/opentx/pulls/4152","id":98617737,"html_url":"https://github.com/opentx/opentx/pull/4152","diff_url":"https://github.com/opentx/opentx/pull/4152.diff","patch_url":"https://github.com/opentx/opentx/pull/4152.patch","issue_url":"https://api.github.com/repos/opentx/opentx/issues/4152","number":4152,"state":"open","locked":false,"title":"9X Mavlink fixes","user":{"login":"PTDreamer","id":815224,"avatar_url":"https://avatars.githubusercontent.com/u/815224?v=3","gravatar_id":"","url":"https://api.github.com/users/PTDreamer","html_url":"https://github.com/PTDreamer","followers_url":"https://api.github.com/users/PTDreamer/followers","following_url":"https://api.github.com/users/PTDreamer/following{/other_user}","gists_url":"https://api.github.com/users/PTDreamer/gists{/gist_id}","starred_url":"https://api.github.com/users/PTDreamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PTDreamer/subscriptions","organizations_url":"https://api.github.com/users/PTDreamer/orgs","repos_url":"https://api.github.com/users/PTDreamer/repos","events_url":"https://api.github.com/users/PTDreamer/events{/privacy}","received_events_url":"https://api.github.com/users/PTDreamer/received_events","type":"User","site_admin":false},"body":"Copied from #4148\r\nFixes #4132\r\nCleans the serial drivers by droping one of them. (negative LOC :) )\r\nAddresses the particular issue I was having (using opentx with ulrs) by creating a new non standard 58798bps speed. This is done on a separate commit which I can drop if considered a particular use case and not worth merging.\r\n\r\nPS-Although this is the same as #4148 I haven't tested this branch with real hw yet","created_at":"2016-12-19T18:42:08Z","updated_at":"2016-12-19T22:12:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"097bb0523b7dcb487cb9a8fc9a959c4e30b3aa57","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opentx/opentx/pulls/4152/commits","review_comments_url":"https://api.github.com/repos/opentx/opentx/pulls/4152/comments","review_comment_url":"https://api.github.com/repos/opentx/opentx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentx/opentx/issues/4152/comments","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/be2df0d5fbb1c9923b2cc55c632533c50e3e77a0","head":{"label":"PTDreamer:ulrs_next_pr","ref":"ulrs_next_pr","sha":"be2df0d5fbb1c9923b2cc55c632533c50e3e77a0","user":{"login":"PTDreamer","id":815224,"avatar_url":"https://avatars.githubusercontent.com/u/815224?v=3","gravatar_id":"","url":"https://api.github.com/users/PTDreamer","html_url":"https://github.com/PTDreamer","followers_url":"https://api.github.com/users/PTDreamer/followers","following_url":"https://api.github.com/users/PTDreamer/following{/other_user}","gists_url":"https://api.github.com/users/PTDreamer/gists{/gist_id}","starred_url":"https://api.github.com/users/PTDreamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PTDreamer/subscriptions","organizations_url":"https://api.github.com/users/PTDreamer/orgs","repos_url":"https://api.github.com/users/PTDreamer/repos","events_url":"https://api.github.com/users/PTDreamer/events{/privacy}","received_events_url":"https://api.github.com/users/PTDreamer/received_events","type":"User","site_admin":false},"repo":{"id":76691301,"name":"opentx","full_name":"PTDreamer/opentx","owner":{"login":"PTDreamer","id":815224,"avatar_url":"https://avatars.githubusercontent.com/u/815224?v=3","gravatar_id":"","url":"https://api.github.com/users/PTDreamer","html_url":"https://github.com/PTDreamer","followers_url":"https://api.github.com/users/PTDreamer/followers","following_url":"https://api.github.com/users/PTDreamer/following{/other_user}","gists_url":"https://api.github.com/users/PTDreamer/gists{/gist_id}","starred_url":"https://api.github.com/users/PTDreamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PTDreamer/subscriptions","organizations_url":"https://api.github.com/users/PTDreamer/orgs","repos_url":"https://api.github.com/users/PTDreamer/repos","events_url":"https://api.github.com/users/PTDreamer/events{/privacy}","received_events_url":"https://api.github.com/users/PTDreamer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PTDreamer/opentx","description":"OpenTX custom firmware for Transmitters","fork":true,"url":"https://api.github.com/repos/PTDreamer/opentx","forks_url":"https://api.github.com/repos/PTDreamer/opentx/forks","keys_url":"https://api.github.com/repos/PTDreamer/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PTDreamer/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PTDreamer/opentx/teams","hooks_url":"https://api.github.com/repos/PTDreamer/opentx/hooks","issue_events_url":"https://api.github.com/repos/PTDreamer/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/PTDreamer/opentx/events","assignees_url":"https://api.github.com/repos/PTDreamer/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/PTDreamer/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/PTDreamer/opentx/tags","blobs_url":"https://api.github.com/repos/PTDreamer/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PTDreamer/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PTDreamer/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/PTDreamer/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PTDreamer/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/PTDreamer/opentx/languages","stargazers_url":"https://api.github.com/repos/PTDreamer/opentx/stargazers","contributors_url":"https://api.github.com/repos/PTDreamer/opentx/contributors","subscribers_url":"https://api.github.com/repos/PTDreamer/opentx/subscribers","subscription_url":"https://api.github.com/repos/PTDreamer/opentx/subscription","commits_url":"https://api.github.com/repos/PTDreamer/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/PTDreamer/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/PTDreamer/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/PTDreamer/opentx/issues/comments{/number}","contents_url":"https://api.github.com/repos/PTDreamer/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/PTDreamer/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PTDreamer/opentx/merges","archive_url":"https://api.github.com/repos/PTDreamer/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PTDreamer/opentx/downloads","issues_url":"https://api.github.com/repos/PTDreamer/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/PTDreamer/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/PTDreamer/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/PTDreamer/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PTDreamer/opentx/labels{/name}","releases_url":"https://api.github.com/repos/PTDreamer/opentx/releases{/id}","deployments_url":"https://api.github.com/repos/PTDreamer/opentx/deployments","created_at":"2016-12-16T23:00:26Z","updated_at":"2016-12-16T23:00:31Z","pushed_at":"2016-12-19T18:22:52Z","git_url":"git://github.com/PTDreamer/opentx.git","ssh_url":"git@github.com:PTDreamer/opentx.git","clone_url":"https://github.com/PTDreamer/opentx.git","svn_url":"https://github.com/PTDreamer/opentx","homepage":"","size":137448,"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":"opentx:next","ref":"next","sha":"d52f89674c485c45d4345096c543d0efe3a80cca","user":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"repo":{"id":14794708,"name":"opentx","full_name":"opentx/opentx","owner":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentx/opentx","description":"OpenTX custom firmware for Transmitters","fork":false,"url":"https://api.github.com/repos/opentx/opentx","forks_url":"https://api.github.com/repos/opentx/opentx/forks","keys_url":"https://api.github.com/repos/opentx/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentx/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentx/opentx/teams","hooks_url":"https://api.github.com/repos/opentx/opentx/hooks","issue_events_url":"https://api.github.com/repos/opentx/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/opentx/opentx/events","assignees_url":"https://api.github.com/repos/opentx/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/opentx/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/opentx/opentx/tags","blobs_url":"https://api.github.com/repos/opentx/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentx/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentx/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentx/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/opentx/opentx/languages","stargazers_url":"https://api.github.com/repos/opentx/opentx/stargazers","contributors_url":"https://api.github.com/repos/opentx/opentx/contributors","subscribers_url":"https://api.github.com/repos/opentx/opentx/subscribers","subscription_url":"https://api.github.com/repos/opentx/opentx/subscription","commits_url":"https://api.github.com/repos/opentx/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentx/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentx/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentx/opentx/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentx/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/opentx/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentx/opentx/merges","archive_url":"https://api.github.com/repos/opentx/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentx/opentx/downloads","issues_url":"https://api.github.com/repos/opentx/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/opentx/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/opentx/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/opentx/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentx/opentx/labels{/name}","releases_url":"https://api.github.com/repos/opentx/opentx/releases{/id}","deployments_url":"https://api.github.com/repos/opentx/opentx/deployments","created_at":"2013-11-29T07:02:56Z","updated_at":"2016-12-15T21:05:05Z","pushed_at":"2016-12-19T22:11:51Z","git_url":"git://github.com/opentx/opentx.git","ssh_url":"git@github.com:opentx/opentx.git","clone_url":"https://github.com/opentx/opentx.git","svn_url":"https://github.com/opentx/opentx","homepage":"","size":137480,"stargazers_count":480,"watchers_count":480,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":279,"mirror_url":null,"open_issues_count":477,"forks":279,"open_issues":477,"watchers":480,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4152"},"html":{"href":"https://github.com/opentx/opentx/pull/4152"},"issue":{"href":"https://api.github.com/repos/opentx/opentx/issues/4152"},"comments":{"href":"https://api.github.com/repos/opentx/opentx/issues/4152/comments"},"review_comments":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4152/comments"},"review_comment":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4152/commits"},"statuses":{"href":"https://api.github.com/repos/opentx/opentx/statuses/be2df0d5fbb1c9923b2cc55c632533c50e3e77a0"}}}}
{"actor":{"display_login":"bsongis"}}