Skip to content

Commit

Permalink
[fl2sitl] add INAV 8.0 permids / modes
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Oct 30, 2024
1 parent e3be74a commit eb3a7a9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 57 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ require (
github.com/mattn/go-tty v0.0.7 // indirect
github.com/mazznoer/csscolorparser v0.1.5 // indirect
github.com/twpayne/go-kmz v0.0.0-20160614194227-165281381e72 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/sys v0.26.0 // indirect
inav v1.0.0 // indirect
styles v1.0.0 // indirect
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ github.com/yookoala/realpath v1.0.0/go.mod h1:gJJMA9wuX7AcqLy1+ffPatSCySA1FQ2S8Y
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
110 changes: 59 additions & 51 deletions pkg/sitlgen/inav_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,61 @@ import (
)

const (
PERM_ARM = 0
PERM_ANGLE = 1
PERM_HORIZON = 2
PERM_NAV_ALTHOLD = 3
PERM_HEADING_HOLD = 5
PERM_HEADFREE = 6
PERM_HEADADJ = 7
PERM_CAMSTAB = 8
PERM_NAV_RTH = 10
PERM_NAV_POSHOLD = 11
PERM_MANUAL = 12
PERM_BEEPER = 13
PERM_LEDS_OFF = 15
PERM_LIGHTS = 16
PERM_OSD_OFF = 19
PERM_TELEMETRY = 20
PERM_AUTO_TUNE = 21
PERM_BLACKBOX = 26
PERM_FAILSAFE = 27
PERM_NAV_WP = 28
PERM_AIR_MODE = 29
PERM_HOME_RESET = 30
PERM_GCS_NAV = 31
PERM_FPV_ANGLE_MIX = 32
PERM_SURFACE = 33
PERM_FLAPERON = 34
PERM_TURN_ASSIST = 35
PERM_NAV_LAUNCH = 36
PERM_SERVO_AUTOTRIM = 37
PERM_CAMERA_CONTROL_1 = 39
PERM_CAMERA_CONTROL_2 = 40
PERM_CAMERA_CONTROL_3 = 41
PERM_OSD_ALT_1 = 42
PERM_OSD_ALT_2 = 43
PERM_OSD_ALT_3 = 44
PERM_NAV_COURSE_HOLD = 45
PERM_MC_BRAKING = 46
PERM_LOITER_CHANGE = 49
PERM_MSP_RC_OVERRIDE = 50
PERM_PREARM = 51
PERM_TURTLE = 52
PERM_NAV_CRUISE = 53
PERM_AUTO_LEVEL_TRIM = 54
PERM_WP_PLANNER = 55
PERM_SOARING = 56
PERM_MISSION_CHANGE = 59
PERM_BEEPER_MUTE = 60
PERM_MULTI_FUNCTION = 61
PERM_MIXER_PROFILE_2 = 62
PERM_MIXER_TRANSITION = 63
PERM_ANGLE_HOLD = 64
PERM_ARM = 0
PERM_ANGLE = 1
PERM_HORIZON = 2
PERM_NAV_ALTHOLD = 3
PERM_HEADING_HOLD = 5
PERM_HEADFREE = 6
PERM_HEADADJ = 7
PERM_CAMSTAB = 8
PERM_NAV_RTH = 10
PERM_NAV_POSHOLD = 11
PERM_MANUAL = 12
PERM_BEEPER = 13
PERM_LEDS_OFF = 15
PERM_LIGHTS = 16
PERM_OSD_OFF = 19
PERM_TELEMETRY = 20
PERM_AUTO_TUNE = 21
PERM_BLACKBOX = 26
PERM_FAILSAFE = 27
PERM_NAV_WP = 28
PERM_AIR_MODE = 29
PERM_HOME_RESET = 30
PERM_GCS_NAV = 31
PERM_FPV_ANGLE_MIX = 32
PERM_SURFACE = 33
PERM_FLAPERON = 34
PERM_TURN_ASSIST = 35
PERM_NAV_LAUNCH = 36
PERM_SERVO_AUTOTRIM = 37
PERM_CAMERA_CONTROL_1 = 39
PERM_CAMERA_CONTROL_2 = 40
PERM_CAMERA_CONTROL_3 = 41
PERM_OSD_ALT_1 = 42
PERM_OSD_ALT_2 = 43
PERM_OSD_ALT_3 = 44
PERM_NAV_COURSE_HOLD = 45
PERM_MC_BRAKING = 46
PERM_LOITER_CHANGE = 49
PERM_MSP_RC_OVERRIDE = 50
PERM_PREARM = 51
PERM_TURTLE = 52
PERM_NAV_CRUISE = 53
PERM_AUTO_LEVEL_TRIM = 54
PERM_WP_PLANNER = 55
PERM_SOARING = 56
PERM_MISSION_CHANGE = 59
PERM_BEEPER_MUTE = 60
PERM_MULTI_FUNCTION = 61
PERM_MIXER_PROFILE_2 = 62
PERM_MIXER_TRANSITION = 63
PERM_ANGLE_HOLD = 64
PERM_GIMBAL_LEVEL_TILT = 65
PERM_GIMBAL_LEVEL_ROLL = 66
PERM_GIMBAL_CENTER = 67
PERM_GIMBAL_HEADTRACKER = 68
)

var pnames = []struct {
Expand Down Expand Up @@ -113,6 +117,10 @@ var pnames = []struct {
{permid: PERM_MIXER_PROFILE_2, name: "MIXER PROFILE 2"},
{permid: PERM_MIXER_TRANSITION, name: "MIXER TRANSITION"},
{permid: PERM_ANGLE_HOLD, name: "ANGLE HOLD"},
{permid: PERM_GIMBAL_LEVEL_TILT, name: "GIMBAL LEVEL TILT"},
{permid: PERM_GIMBAL_LEVEL_ROLL, name: "GIMBAL LEVEL ROLL"},
{permid: PERM_GIMBAL_CENTER, name: "GIMBAL CENTRE"},
{permid: PERM_GIMBAL_HEADTRACKER, name: "GIMBAL HEAD TRACKER"},
}

type FModeMap struct {
Expand Down

0 comments on commit eb3a7a9

Please sign in to comment.