Skip to content

Commit

Permalink
issue #478 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
rokath committed Aug 10, 2024
1 parent 832e4c1 commit fe82bc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/args/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Example: "-ban dbg:wrn -ban diag" results in suppressing all as debug, diag and
Example: "-pick err:wrn -pick default" results in suppressing all messages despite of as error, warning and default tagged messages. Not usable in conjunction with "-ban".`) // multi flag
fsScLog.StringVar(&decoder.PackageFraming, "packageFraming", "TCOBSv1", `Use "none" or "COBS" as alternative. "COBS" needs "#define TRICE_FRAMING TRICE_FRAMING_COBS" inside "triceConfig.h".`)
fsScLog.StringVar(&decoder.PackageFraming, "pf", "TCOBSv1", "Short for '-packageFraming'.")
fsScLog.BoolVar(&trexDecoder.AddNewlineToEachTriceMessage, "addNL", false, `Add a newline char at trice messages end to use for example "hi" instead of "hi\n" in source code.`)
}

func refreshInit() {
Expand Down
5 changes: 4 additions & 1 deletion internal/trexDecoder/trexDecoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
)

var Doubled16BitID bool
var AddNewlineToEachTriceMessage bool

/*
var (
Expand Down Expand Up @@ -441,7 +442,9 @@ func (p *trexDec) Read(b []byte) (n int, err error) {
var ok bool
p.LutMutex.RLock()
p.Trice, ok = p.Lut[triceID]
// p.Trice.Strg += `\n` // this would add a newline to each single Trice message
if AddNewlineToEachTriceMessage {
p.Trice.Strg += `\n` // this adds a newline to each single Trice message
}
p.LutMutex.RUnlock()
if !ok {
if p.packageFraming == packageFramingNone {
Expand Down

0 comments on commit fe82bc6

Please sign in to comment.