mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-22 Flight/PiOS: Spektrum hacks, doubled supervisor timer and ?loss? counter to the channel8 value
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2907 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
d38c44f529
commit
d9ad0e9a8f
@ -195,6 +195,13 @@ int32_t PIOS_SPEKTRUM_Decode(uint8_t b)
|
|||||||
bytecount++;
|
bytecount++;
|
||||||
if (sync == 0) {
|
if (sync == 0) {
|
||||||
sync_word = (prev_byte << 8) + b;
|
sync_word = (prev_byte << 8) + b;
|
||||||
|
if(bytecount==1)
|
||||||
|
{
|
||||||
|
/* record losscounter into channel8 */
|
||||||
|
CaptureValueTemp[7]=b;
|
||||||
|
/* instant write */
|
||||||
|
CaptureValue[7]=b;
|
||||||
|
}
|
||||||
if (((sync_word & 0x00FE) == 0) && (bytecount == 2)) {
|
if (((sync_word & 0x00FE) == 0) && (bytecount == 2)) {
|
||||||
/* sync low byte always 0x01, high byte seems to be random when switching TX on off on, loss counter??? */
|
/* sync low byte always 0x01, high byte seems to be random when switching TX on off on, loss counter??? */
|
||||||
if (sync_word & 0x01) {
|
if (sync_word & 0x01) {
|
||||||
@ -271,7 +278,7 @@ void PIOS_SPEKTRUM_irq_handler() {
|
|||||||
frame_error=0;
|
frame_error=0;
|
||||||
sync_of++;
|
sync_of++;
|
||||||
/* watchdog activated */
|
/* watchdog activated */
|
||||||
if (sync_of > 3) {
|
if (sync_of > 6) {
|
||||||
/* signal lost */
|
/* signal lost */
|
||||||
sync_of = 0;
|
sync_of = 0;
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user