Skip to content

Commit

Permalink
use permid (vice boxid) for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
stronnag committed Apr 9, 2024
1 parent cdcb079 commit 3cb984d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/sitlgen/msp.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type MSPSerial struct {
}

type ModeRange struct {
boxid byte
permid byte
chanidx byte
start byte
end byte
Expand Down Expand Up @@ -520,7 +520,7 @@ func (m *MSPSerial) init(nchan chan RCInfo, schan chan byte, conf SimMeta) {
log.Println("Serial init completed, with modes")
if options.Config.Verbose > 1 {
for _, u := range m.mranges {
_, s := mode_to_fm(uint16(u.boxid))
_, s := mode_to_fm(uint16(u.permid))
log.Printf(" %+v %s\n", u, s)
}
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sitlgen/sitlgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ func (x *SitlGen) change_mode(mranges []ModeRange, _from, _to uint16) string {
str := fmt.Sprintf("<%s> => <%s>", fstr, tstr)
for _, v := range from {
for _, m := range mranges {
if uint16(m.boxid) == v {
if uint16(m.permid) == v {
x.rc.chans[MODE_OFFSET+m.chanidx] = clrvalue(mranges, m)
}
}
}

for _, v := range to {
for _, m := range mranges {
if uint16(m.boxid) == v {
if uint16(m.permid) == v {
x.rc.chans[MODE_OFFSET+m.chanidx] = setvalue(m)
}
}
Expand Down Expand Up @@ -298,7 +298,7 @@ func log_mode_change(mranges []ModeRange, imodes []uint16, fname string, chg str
sb.WriteByte(' ')
for _, r := range mranges {
for _, k := range imodes {
if uint16(r.boxid) == k {
if uint16(r.permid) == k {
fmt.Fprintf(&sb, " %+v", r)
}
}
Expand Down Expand Up @@ -590,7 +590,7 @@ func (x *SitlGen) Run(rdrchan chan interface{}, meta types.FlightMeta) {
if x.swchan == -1 {
mranges = m.get_ranges()
for _, r := range mranges {
if r.boxid == PERM_ARM {
if r.permid == PERM_ARM {
x.swchan = 4 + int16(r.chanidx)
x.swval = uint16(r.end+r.start)*25/2 + 900
break
Expand Down

0 comments on commit 3cb984d

Please sign in to comment.