Skip to content

Commit

Permalink
JJRC345: add RTH on CH7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Langer committed May 21, 2020
1 parent 53f58ce commit 48e4cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Multiprotocol/JJRC345_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

enum JJRC345_FLAGS {
// flags going to packet[8]
//JJRC345_FLAG_FLIP = 0x80,
JJRC345_FLAG_HEADLESS = 0x40,
JJRC345_FLAG_RTH = 0x80,
};

static uint8_t __attribute__((unused)) JJRC345_convert_channel(uint8_t num)
Expand Down Expand Up @@ -92,7 +92,9 @@ static void __attribute__((unused)) JJRC345_send_packet()
}
packet[3] = (packet[4] >= 0xB7) ? 0x0e : 0x0a; // Some throttle flag. 0A when Thr <= B6, 0E when Thr >= B7, sometimes 06 when moving Ele/Ail

packet[8] = GET_FLAG(CH6_SW,JJRC345_FLAG_HEADLESS); // Headless mode: 00 normal, 40 headless. Rudder trim, 00 when not used, 01..1F when trimmed left, 20..3F
packet[8] = 0x00 // Rudder trim, 00 when not used, 01..1F when trimmed left, 20..3F
| GET_FLAG(CH6_SW,JJRC345_FLAG_HEADLESS) // Headless mode: 00 normal, 40 headless
| GET_FLAG(CH7_SW,JJRC345_FLAG_RTH); // RTH: 80 active
packet[9] = 0; // Elevator trim, 00 when not used, 20..25 when trimmed up, 0..1F when trimmed down
packet[10] = 0x40; // Aileron trim, 40 when not used, 40..5F when trimmed left, 61..7F when trimmed right

Expand Down
6 changes: 3 additions & 3 deletions Protocols_Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -1101,9 +1101,9 @@ ARM|
## JJRC345 - *71*
Model: JJRC345

CH1|CH2|CH3|CH4|CH5|CH6
---|---|---|---|---|---
A|E|T|R|FLIP|HEADLESS
CH1|CH2|CH3|CH4|CH5|CH6|CH7
---|---|---|---|---|---|---
A|E|T|R|FLIP|HEADLESS|RTH

## KF606 - *49*
Model: KF606
Expand Down

0 comments on commit 48e4cad

Please sign in to comment.