{"action":"created","issue":{"url":"https://api.github.com/repos/cleanflight/cleanflight/issues/1340","labels_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/1340/labels{/name}","comments_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/1340/comments","events_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/1340/events","html_url":"https://github.com/cleanflight/cleanflight/pull/1340","id":108121158,"number":1340,"title":"Delay no data detection for serial rx when no signal received","user":{"login":"fnurgel","id":1340036,"avatar_url":"https://avatars.githubusercontent.com/u/1340036?v=3","gravatar_id":"","url":"https://api.github.com/users/fnurgel","html_url":"https://github.com/fnurgel","followers_url":"https://api.github.com/users/fnurgel/followers","following_url":"https://api.github.com/users/fnurgel/following{/other_user}","gists_url":"https://api.github.com/users/fnurgel/gists{/gist_id}","starred_url":"https://api.github.com/users/fnurgel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnurgel/subscriptions","organizations_url":"https://api.github.com/users/fnurgel/orgs","repos_url":"https://api.github.com/users/fnurgel/repos","events_url":"https://api.github.com/users/fnurgel/events{/privacy}","received_events_url":"https://api.github.com/users/fnurgel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-24T12:32:07Z","updated_at":"2015-09-24T13:49:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cleanflight/cleanflight/pulls/1340","html_url":"https://github.com/cleanflight/cleanflight/pull/1340","diff_url":"https://github.com/cleanflight/cleanflight/pull/1340.diff","patch_url":"https://github.com/cleanflight/cleanflight/pull/1340.patch"},"body":"detectAndApplySignalLossBehaviour() currently assumes rxData is always present when the rx is connected properly (rxDataReceived == true). This does not seem to be the case atleast when failsafe kicks in on a SBUS receiver.\r\nrxSignalReceived is reset based on time and rxDataReceived is reset every frame, which seems to create the difference.\r\nWhen the rx flags failsafe, rxDataReceived is sometimes not flagged true when entering detectAndApplySignalLossBehaviour() resulting in a 'flickering' between the rx values and PPM_RCVR_TIMEOUT (in turn resulting in invalid pulse).\r\nOn current master this is not too big of an issue, but it is there:\r\n![cf_master-150923](https://cloud.githubusercontent.com/assets/1340036/10072991/e9fdb094-62c5-11e5-8e1d-269e20a9e0d2.png)\r\n\r\nHowever, when tinkering with the loops, like in borisbstyle/betaflight, the issue is much more visible:\r\n![cf_betaflight-150923](https://cloud.githubusercontent.com/assets/1340036/10073007/11af6682-62c6-11e5-8343-c1aa55b75010.png)\r\n(the actual failsafe values are abnormal for the sake of simply displaying the issue)\r\n\r\nThe failsafe and signalLoss code seems a bit complex as it is and this certainly does not help the cause.\r\nAlso this might simply be the result of some other timing problem and thus this workaround might in that case just hide the actual problem.\r\nThe attached commit is requiring 50 frames with no data before it treats it as actual no data.\r\n"},"comment":{"url":"https://api.github.com/repos/cleanflight/cleanflight/issues/comments/142933326","html_url":"https://github.com/cleanflight/cleanflight/pull/1340#issuecomment-142933326","issue_url":"https://api.github.com/repos/cleanflight/cleanflight/issues/1340","id":142933326,"user":{"login":"henn1001","id":10023892,"avatar_url":"https://avatars.githubusercontent.com/u/10023892?v=3","gravatar_id":"","url":"https://api.github.com/users/henn1001","html_url":"https://github.com/henn1001","followers_url":"https://api.github.com/users/henn1001/followers","following_url":"https://api.github.com/users/henn1001/following{/other_user}","gists_url":"https://api.github.com/users/henn1001/gists{/gist_id}","starred_url":"https://api.github.com/users/henn1001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henn1001/subscriptions","organizations_url":"https://api.github.com/users/henn1001/orgs","repos_url":"https://api.github.com/users/henn1001/repos","events_url":"https://api.github.com/users/henn1001/events{/privacy}","received_events_url":"https://api.github.com/users/henn1001/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T13:49:23Z","updated_at":"2015-09-24T13:49:23Z","body":"@ProDrone should have more insight into this."}}