Skip to content

Commit

Permalink
SGF22.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed Feb 16, 2024
1 parent 53d5684 commit b18adb0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Multiprotocol/SGF22_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ Multiprotocol is distributed in the hope that it will be useful,
#define SGF22_BIND_COUNT 50
#define SGF22_RF_NUM_CHANNELS 4

//packet[8]
#define SGF22_FLAG_3D 0x00
#define SGF22_FLAG_ROLL 0x08
#define SGF22_FLAG_LIGHT 0x04
#define SGF22_FLAG_VIDEO 0x10
#define SGF22_FLAG_6G 0x40
#define SGF22_FLAG_VERTICAL 0xC0
#define SGF22_FLAG_3D 0x00
#define SGF22_FLAG_ROLL 0x08
//packet[9]
#define SGF22_FLAG_PHOTO 0x40

static void __attribute__((unused)) SGF22_send_packet()
Expand All @@ -56,12 +59,14 @@ static void __attribute__((unused)) SGF22_send_packet()
packet[0] = 0x1B;
packet[8] = SGF22_FLAG_3D // default
| GET_FLAG(CH6_SW, SGF22_FLAG_ROLL) // roll
| GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT); // press up throttle trim for light
| GET_FLAG(CH7_SW, SGF22_FLAG_LIGHT) // push up throttle trim for light
| GET_FLAG(CH9_SW, SGF22_FLAG_VIDEO); // push down throttle trim for video
if(Channel_data[CH5] > CHANNEL_MIN_COMMAND)
packet[8] |= SGF22_FLAG_6G; // mode 1 - 6g
if(Channel_data[CH5] > CHANNEL_MAX_COMMAND)
packet[8] |= SGF22_FLAG_VERTICAL; // mode 0 - vertical
GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO); // press down throttle trim for photo
packet[9] = GET_FLAG(CH8_SW, SGF22_FLAG_PHOTO); // press in throttle trim for photo
packet[10] = 0x42; // no fine tune
packet[11] = 0x10; // no fine tune
}
Expand Down

0 comments on commit b18adb0

Please sign in to comment.